{"id":400,"date":"2018-01-21T15:58:28","date_gmt":"2018-01-21T15:58:28","guid":{"rendered":"http:\/\/www.ciraltos.com\/?p=400"},"modified":"2023-03-24T00:35:06","modified_gmt":"2023-03-24T05:35:06","slug":"dynamic-azure-arm-template-server-deployments","status":"publish","type":"post","link":"https:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/","title":{"rendered":"Dynamic Azure ARM Template for Server Deployments"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft size-medium wp-image-402\" src=\"\/wp-content\/uploads\/2018\/01\/Dynamic-ARM-Template-300x223.png\" alt=\"Dynamic ARM Template\" width=\"300\" height=\"223\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2018\/01\/Dynamic-ARM-Template-300x223.png 300w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2018\/01\/Dynamic-ARM-Template.png 395w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>Ever since I started using Template Deployments I have been perfecting a Dynamic Azure ARM Template for server deployments.\u00a0 I finally reached a point where I feel this template is complete and am excited to share it with the world.\u00a0 The code can be found on my GitHub page <a href=\"https:\/\/github.com\/tsrob50\/DynamicNumberVMandDataDisk\" target=\"_blank\" rel=\"noopener\">here<\/a>.\u00a0 A brief explications of parameter values are listed below.<!--more--><\/p>\n<h2>First, an Overview<\/h2>\n<p>The goal of this ARM template is to deploy a number of servers specified in the parameter file and add to each server a number of data drives, also specified in the parameter file.\u00a0 The JSON template uses the Copy and CopyIndex() code to create the servers.\u00a0 This provides looping like functionality to the JSON template, incrementally increasing values such as server name, NIC name, drive names and so on.\u00a0 I used the term \u201clooping like\u201d because the servers are not created one at a time like traditional looping, they are created in parallel with ARM deployments.\u00a0 This way, there is little difference in the time it takes to deploy 2 or 8 VM\u2019s.<\/p>\n<p>The last tweak to the ARM template was to set the number of unmanaged data drives in the parameter file and have them created and attached to each server.\u00a0 This was done by adding another copy command in the virtual machine resource for the data drives.\u00a0 I struggled with this for a while, but found the solution as part of an <a href=\"https:\/\/github.com\/Azure\/azure-quickstart-templates\/tree\/master\/201-vm-dynamic-data-disks-selection\" target=\"_blank\" rel=\"noopener\">Azure quick start template<\/a> .\u00a0 The referenced template accomplishes a similar goal as the one I created with some differences in how it\u2019s done.<\/p>\n<p>After the servers are created and data drives attached, Azure Desired State Configuration can be used to group them into one logical drive.\u00a0 For information on how to do this with Storage Space Direct and Azure DSC, see my post <a href=\"http:\/\/www.ciraltos.com\/storage-spaces-dsc\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<blockquote><p>Keep storage limits in mind when using this template.\u00a0 \u00a0Be sure the total number of drives does not go beyond a storage accounts drive count, IoPS, or capacity limits.\u00a0 Information on storage limits can be found <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-subscription-service-limits#storage-limits\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p><\/blockquote>\n<p>And one last note, this template does not configure public IP\u2019s.\u00a0 My environment has other networking magic in place that negates the need for public IP\u2019s.<\/p>\n<h2>Parameters of Interest:<\/h2>\n<p>No need to go over the obvious parameters.\u00a0 Here are some of the more interesting ones:<\/p>\n<p><strong>virtualMachineNamePrefix:<\/strong> This is the name of the VM with the copy index added to the end.\u00a0 For example, setting the value to \u201cserver\u201d and creating three servers will result I server1, server2, server3.<\/p>\n<p><strong>adminPassword:<\/strong> It\u2019s bad form to store passwords in code.\u00a0 The local admin password is stored in the Key Vault and referenced by the vaults ID.\u00a0 More information can be found <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-resource-manager\/resource-manager-keyvault-parameter\" target=\"_blank\" rel=\"noopener\">here.<\/a><\/p>\n<p><strong>firstIPAddress:<\/strong> This is the IP of the first VM.\u00a0 The value will increment by one on the last octet for each additional server.<\/p>\n<p><strong>VirtualNetworkDresourceGroup:<\/strong> This assumes the vNet the VM\u2019s are connecting to is in a different resource group.\u00a0 If not, just add the deployment RG here.<\/p>\n<p><strong>numberOfDataDisks:<\/strong> The number of data disks attached to each server.\u00a0 Be sure the VM size will support this number and the total number of disks deployed does not exceed any storage account limitations.<\/p>\n<p><strong>domainUsername:<\/strong> The domain account used to join the servers to the domain.<\/p>\n<p><strong>domainPassword:<\/strong> Simular to adminPassword, the Key Vault ID and secretName of the domain join account.<\/p>\n<p><strong>domainJoinOptions:<\/strong> There is limited documentation on this, the value \u201c3\u201d will add the server to the domain<\/p>\n<p><strong>numberOfInstances:<\/strong> The number of VM\u2019s to deploy.\u00a0 Minimum is set to 2 in the template.<\/p>\n<p>That\u2019s all there is to it.<\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever since I started using Template Deployments I have been perfecting a Dynamic Azure ARM Template for server deployments.\u00a0 I finally reached a point where I feel this template is complete and am excited to share it with the world.\u00a0 The code can be found on my GitHub page here.\u00a0 A brief explications of parameter &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/\"> <span class=\"screen-reader-text\">Dynamic Azure ARM Template for Server Deployments<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":4098,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[2],"tags":[175,9,184,186,125,183,160,187,174,185],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Dynamic Azure ARM Template for Server Deployments - ciraltos<\/title>\n<meta name=\"description\" content=\"The goal of this template is to deploy a number of servers specified in the parameter file and add to each server a number of data drives, also specified in the parameter file.\u00a0 The JSON template uses the Copy and CopyIndex() code to create the servers.\u00a0 This provides looping like functionality to the JSON template, incrementally increasing values such as server name, NIC name, drive names and so on.\u00a0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dynamic Azure ARM Template for Server Deployments - ciraltos\" \/>\n<meta property=\"og:description\" content=\"The goal of this template is to deploy a number of servers specified in the parameter file and add to each server a number of data drives, also specified in the parameter file.\u00a0 The JSON template uses the Copy and CopyIndex() code to create the servers.\u00a0 This provides looping like functionality to the JSON template, incrementally increasing values such as server name, NIC name, drive names and so on.\u00a0\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/\" \/>\n<meta property=\"og:site_name\" content=\"ciraltos\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-21T15:58:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-24T05:35:06+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Dynamic-ARM-Template-300x223-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"223\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Travis Roberts\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:site\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Travis Roberts\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/\"},\"author\":{\"name\":\"Travis Roberts\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"headline\":\"Dynamic Azure ARM Template for Server Deployments\",\"datePublished\":\"2018-01-21T15:58:28+00:00\",\"dateModified\":\"2023-03-24T05:35:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/\"},\"wordCount\":604,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"keywords\":[\"ARM\",\"Azure\",\"data disk\",\"deployment\",\"dsc\",\"Dynamic Azure ARM Template\",\"New-AzureRMResourceGroupDeployment\",\"resource group\",\"template\",\"virtual disk\"],\"articleSection\":[\"Azure\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/\",\"url\":\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/\",\"name\":\"Dynamic Azure ARM Template for Server Deployments - ciraltos\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#website\"},\"datePublished\":\"2018-01-21T15:58:28+00:00\",\"dateModified\":\"2023-03-24T05:35:06+00:00\",\"description\":\"The goal of this template is to deploy a number of servers specified in the parameter file and add to each server a number of data drives, also specified in the parameter file.\u00a0 The JSON template uses the Copy and CopyIndex() code to create the servers.\u00a0 This provides looping like functionality to the JSON template, incrementally increasing values such as server name, NIC name, drive names and so on.\u00a0\",\"breadcrumb\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ciraltos.com\/staging2\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dynamic Azure ARM Template for Server Deployments\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#website\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/\",\"name\":\"ciraltos\",\"description\":\"cloud, technology and trends\",\"publisher\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\",\"name\":\"Travis Roberts\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"contentUrl\":\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"width\":5657,\"height\":3563,\"caption\":\"Travis Roberts\"},\"logo\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.ciraltos.com\",\"https:\/\/twitter.com\/ciraltos\"],\"url\":\"https:\/\/www.ciraltos.com\/staging2\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dynamic Azure ARM Template for Server Deployments - ciraltos","description":"The goal of this template is to deploy a number of servers specified in the parameter file and add to each server a number of data drives, also specified in the parameter file.\u00a0 The JSON template uses the Copy and CopyIndex() code to create the servers.\u00a0 This provides looping like functionality to the JSON template, incrementally increasing values such as server name, NIC name, drive names and so on.\u00a0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/","og_locale":"en_US","og_type":"article","og_title":"Dynamic Azure ARM Template for Server Deployments - ciraltos","og_description":"The goal of this template is to deploy a number of servers specified in the parameter file and add to each server a number of data drives, also specified in the parameter file.\u00a0 The JSON template uses the Copy and CopyIndex() code to create the servers.\u00a0 This provides looping like functionality to the JSON template, incrementally increasing values such as server name, NIC name, drive names and so on.\u00a0","og_url":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/","og_site_name":"ciraltos","article_published_time":"2018-01-21T15:58:28+00:00","article_modified_time":"2023-03-24T05:35:06+00:00","og_image":[{"width":300,"height":223,"url":"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Dynamic-ARM-Template-300x223-1.png","type":"image\/png"}],"author":"Travis Roberts","twitter_card":"summary_large_image","twitter_creator":"@ciraltos","twitter_site":"@ciraltos","twitter_misc":{"Written by":"Travis Roberts","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/#article","isPartOf":{"@id":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/"},"author":{"name":"Travis Roberts","@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"headline":"Dynamic Azure ARM Template for Server Deployments","datePublished":"2018-01-21T15:58:28+00:00","dateModified":"2023-03-24T05:35:06+00:00","mainEntityOfPage":{"@id":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/"},"wordCount":604,"commentCount":0,"publisher":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"keywords":["ARM","Azure","data disk","deployment","dsc","Dynamic Azure ARM Template","New-AzureRMResourceGroupDeployment","resource group","template","virtual disk"],"articleSection":["Azure"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/","url":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/","name":"Dynamic Azure ARM Template for Server Deployments - ciraltos","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#website"},"datePublished":"2018-01-21T15:58:28+00:00","dateModified":"2023-03-24T05:35:06+00:00","description":"The goal of this template is to deploy a number of servers specified in the parameter file and add to each server a number of data drives, also specified in the parameter file.\u00a0 The JSON template uses the Copy and CopyIndex() code to create the servers.\u00a0 This provides looping like functionality to the JSON template, incrementally increasing values such as server name, NIC name, drive names and so on.\u00a0","breadcrumb":{"@id":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.ciraltos.com\/staging2\/dynamic-azure-arm-template-server-deployments\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ciraltos.com\/staging2\/"},{"@type":"ListItem","position":2,"name":"Dynamic Azure ARM Template for Server Deployments"}]},{"@type":"WebSite","@id":"https:\/\/www.ciraltos.com\/staging2\/#website","url":"https:\/\/www.ciraltos.com\/staging2\/","name":"ciraltos","description":"cloud, technology and trends","publisher":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a","name":"Travis Roberts","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/","url":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","contentUrl":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","width":5657,"height":3563,"caption":"Travis Roberts"},"logo":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.ciraltos.com","https:\/\/twitter.com\/ciraltos"],"url":"https:\/\/www.ciraltos.com\/staging2\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/400"}],"collection":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/comments?post=400"}],"version-history":[{"count":5,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/400\/revisions"}],"predecessor-version":[{"id":4099,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/400\/revisions\/4099"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media\/4098"}],"wp:attachment":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media?parent=400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/categories?post=400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/tags?post=400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}