{"id":14446,"date":"2020-07-31T04:56:37","date_gmt":"2020-07-31T04:56:37","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=14446"},"modified":"2022-04-04T10:09:13","modified_gmt":"2022-04-04T10:09:13","slug":"setting-resource-location-in-arm-template-and-test-vm","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/","title":{"rendered":"Setting resource location in ARM template and Test VM"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>AZ-303 is retired.\u00a0<a href=\"https:\/\/www.testpreptraining.ai\/designing-microsoft-azure-infrastructure-solutions-az-305\" target=\"_blank\" rel=\"noreferrer noopener\">AZ-305<\/a>\u00a0replacement is available.<\/strong> <\/h2>\n\n\n\n<p>This tutorial will help you learn about Setting resource location in ARM template and describes how to deploy and test an Azure virtual machine (VM) from the generalized VHD image created in the previous section (Create Azure VM technical asset)&nbsp;to ensure the VHD image meets Azure Marketplace publishing requirements.<\/p>\n\n\n\n<p>When deploying an Azure Resource Manager (ARM) template, you must provide a location for each resource. The location doesn&#8217;t need to be the same location as the resource group location.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"get-available-locations\"><strong>Get available locations<\/strong><\/h3>\n\n\n\n<p>Different resource types are supported in different locations. To get the supported locations for a resource type, use Azure PowerShell or Azure CLI.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"use-location-parameter\"><strong>Use location parameter<\/strong><\/h3>\n\n\n\n<p>To allow for flexibility when deploying your template, use a parameter to specify the location for resources. Set the default value of the parameter to&nbsp;<code>resourceGroup().location<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Test VM<\/strong><\/h3>\n\n\n\n<p>Complete these steps to generate a compatibility report, which certifies your VHD image can be used on Azure Marketplace.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Firstly, Create and deploy certificate required for remote VM management to Azure Key Vault.<\/li><li>Subsequently, Deploy an Azure VM from your generalized VHD image created in&nbsp;Create Azure VM technical asset.<\/li><li>Furthermore, Run tests on the deployed VM to ensure the VHD image is ready to be published and used to deploy VMs.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"running-scripts\"><strong>Running scripts<\/strong><\/h3>\n\n\n\n<p>This contains three scripts to be run in PowerShell. The desktop PowerShell works best, however, the Azure Cloud Shell can also be used with the PowerShell option selected (top left of window).<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Firstly, Ensure PowerShell is configured to run scripts.<ul><li>Always open PowerShell with the&nbsp;<strong>Run as administrator<\/strong>&nbsp;option.<\/li><li>Ensure you can run these scripts:&nbsp;<code>Set-ExecutionPolicy<\/code>&nbsp;and&nbsp;<code>RemoteSigned<\/code>.<\/li><\/ul><\/li><li>Also, Install Azure CLI.<\/li><li>Subsequently, Install Azure PowerShell Az Module.<ol><li><strong>Option A<\/strong>: No modules installed yet.<ul><li><code>Install-Module -Name Az -AllowClobber -Scope AllUsers<\/code>For more information, see&nbsp;Install Azure PowerShell module.<\/li><\/ul><\/li><li><strong>Option B<\/strong>: Currently using AzureRM module.<ul><li>Uninstall-AzureRM<\/li><li>Install-Module -Name Az -AllowClobber -Scope AllUsers<\/li><li>Enable-AzureRmAlias -Scope CurrentUserFor more information, see&nbsp;Migrate Azure PowerShell from AzureRM to Az.<\/li><\/ul><\/li><\/ol><\/li><li>Lastly, Save session parameters.<\/li><\/ol>\n\n\n\n<p>The scripts in this section use session variables\/parameters. If you close the session, the parameters are erased. We recommend using one session to run all scripts to avoid parameter value errors. If this is not possible, you&#8217;ll have to reinitialize the parameters when opening a new session, especially for the later scripts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-certificates-for-azure-key-vault\"><strong>Create certificates for Azure Key Vault<\/strong><\/h3>\n\n\n\n<p>This process consists of three steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Create the security certificate.<\/li><li>Create the Azure Key Vault to store the certificate.<\/li><li>Store the certificates to the key vault.<\/li><\/ol>\n\n\n\n<p>You can use either a new or an existing Azure resource group for this work.<\/p>\n\n\n\n<p>Next step is to Deploy an Azure VM from your generalized VHD image. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"run-tests-on-the-deployed-vm\"><strong>Lastly,<\/strong> <strong>Run tests on the deployed VM<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"download-and-run-the-certification-test-tool\"><strong>Download and run the certification test tool<\/strong><\/h4>\n\n\n\n<p>The Certification Test Tool for Azure Certified is a self-test tool that runs on a local Windows machine but tests an Azure-based Windows or Linux VM. It certifies that your user VM image can be used with Microsoft Azure and that the guidance and requirements around preparing your VHD have been met. This tool ensures your VM is ready to publish per Azure Marketplace requirements.\u201d<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Download and install the most recent&nbsp;Certification Test Tool for Azure Certified.<\/li><li>Open the certification tool, then select&nbsp;<strong>Start New Test<\/strong>.<\/li><li>From the&nbsp;<strong>Test Information<\/strong>&nbsp;screen, enter a&nbsp;<strong>Test Name<\/strong>&nbsp;for the test run.<\/li><li>Select the&nbsp;<strong>Platform<\/strong>&nbsp;for your VM, either Windows Server or Linux. Your platform choice affects the remaining options.<\/li><li>If your VM is using this database service, select the&nbsp;<strong>Test for Azure SQL Database<\/strong>&nbsp;check box.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/microsoft-azure-architect-technologies-az-303-free-practice-test\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png\" alt=\"free practice test for AZ- 303 and learn to Setting resource location in ARM template and Test VM \" class=\"wp-image-13928\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png 960w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5-750x117.png 750w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-az-303-microsoft-azure-architect-technologies\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Go back to home page <\/strong><\/a><\/p>\n\n\n\n<p class=\"has-text-align-right\"><strong>Reference documentation &#8211; <\/strong><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-resource-manager\/templates\/resource-location?tabs=azure-powershell\">Set resource location in ARM template<\/a><\/p>\n\n\n\n<p class=\"has-text-align-right\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/marketplace\/partner-center-portal\/azure-vm-image-certification#deploy-an-azure-vm-from-your-generalized-vhd-image\" target=\"_blank\" rel=\"noreferrer noopener\">Test Virtual Machine (VM) deployed from VHD<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AZ-303 is retired.\u00a0AZ-305\u00a0replacement is available. This tutorial will help you learn about Setting resource location in ARM template and describes how to deploy and test an Azure virtual machine (VM) from the generalized VHD image created in the previous section (Create Azure VM technical asset)&nbsp;to ensure the VHD image meets Azure Marketplace publishing requirements. When&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-14446","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setting resource location in ARM template and Test VM<\/title>\n<meta name=\"description\" content=\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Setting resource location in ARM template and Test VM.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting resource location in ARM template and Test VM\" \/>\n<meta property=\"og:description\" content=\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Setting resource location in ARM template and Test VM.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-04T10:09:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/\",\"name\":\"Setting resource location in ARM template and Test VM\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2020-07-31T04:56:37+00:00\",\"dateModified\":\"2022-04-04T10:09:13+00:00\",\"description\":\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Setting resource location in ARM template and Test VM.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting resource location in ARM template and Test VM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting resource location in ARM template and Test VM","description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Setting resource location in ARM template and Test VM.","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":"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/","og_locale":"en_US","og_type":"article","og_title":"Setting resource location in ARM template and Test VM","og_description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Setting resource location in ARM template and Test VM.","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2022-04-04T10:09:13+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/","name":"Setting resource location in ARM template and Test VM","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2020-07-31T04:56:37+00:00","dateModified":"2022-04-04T10:09:13+00:00","description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Setting resource location in ARM template and Test VM.","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/setting-resource-location-in-arm-template-and-test-vm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Setting resource location in ARM template and Test VM"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/14446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=14446"}],"version-history":[{"count":2,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/14446\/revisions"}],"predecessor-version":[{"id":54066,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/14446\/revisions\/54066"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=14446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=14446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=14446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}