{"id":4005,"date":"2016-12-02T12:27:31","date_gmt":"2016-12-02T17:27:31","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/azuregov\/?p=4005"},"modified":"2016-12-02T12:27:31","modified_gmt":"2016-12-02T17:27:31","slug":"azure-quickstart-templates","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azuregov\/azure-quickstart-templates\/","title":{"rendered":"Azure QuickStart Templates for Azure Government"},"content":{"rendered":"<p><span>With the release of <\/span><a href=\"https:\/\/blogs.msdn.microsoft.com\/azuregov\/2016\/09\/27\/iaas-just-got-easier-for-government\/\"><span>Azure Resource Manager<\/span><\/a><span> on Microsoft Azure Government (MAG), users are now able to provision and deploy applications using declarative templates.<\/span><span>\u00a0 <\/span><span>A full listing of publicly contributed templates can be found at <\/span><a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/templates\/\"><span>https:\/\/azure.microsoft.com\/en-us\/documentation\/templates\/<\/span><\/a><span> .<\/span><\/p>\n<h2><span>How to use QuickStart Templates in MAG<\/span><\/h2>\n<p><span>Many of the contributed templates in our Github repo <\/span><a href=\"https:\/\/github.com\/Azure\/azure-quickstart-templates\"><span>https:\/\/github.com\/Azure\/azure-quickstart-templates<\/span><\/a><span> will work on MAG without modification.<\/span><span>\u00a0 <\/span><span>Deploy options are described below.<\/span><span>\u00a0 <\/span><\/p>\n<p><span>Templates that don\u2019t follow the best practices outlined in our Github repo typically won\u2019t run for a couple reasons.<\/span><\/p>\n<h2><span>Hardcoded namespace for storage<\/span><\/h2>\n<p><span>MAG uses different endpoints for services like storage.<\/span><span>\u00a0 <\/span><span>If the template hardcodes <\/span>blob.core.windows.net <span>for say an OSdisk, the template will fail on MAG.<\/span><span>\u00a0 <\/span><span>Instead, templates should reference the namespace like:<\/span><\/p>\n<table class=\"table table-bordered table-condensed table-striped\">\n<tbody>\n<tr>\n<td><span>&#8220;osDisk&#8221;: {&#8220;name&#8221;: &#8220;osdisk&#8221;,&#8221;vhd&#8221;: {&#8220;uri&#8221;: &#8220;[concat(reference(concat(&#8216;Microsoft.Storage\/storageAccounts\/&#8217;, <\/span><\/p>\n<p><span>variables(&#8216;storageAccountName&#8217;)), &#8216;2015-06-15&#8217;).primaryEndpoints.blob, variables(&#8216;vmStorageAccountContainerName&#8217;),<\/span><\/p>\n<p><span>&#8216;\/&#8217;,variables(&#8216;OSDiskName&#8217;),&#8217;.vhd&#8217;)]&#8221;}}<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Hardcoded locations in template outside of MAG<\/h2>\n<p>Our best practices state \u201cDo not use a parameter to specify the\u00a0location. Use the location property of the resourceGroup instead. By using the\u00a0resourceGroup().location\u00a0expression for all your resources, the resources in the template will automatically be deployed in the same location as the resource group.\u201d<\/p>\n<p>If you see US East or other commercial regions hardcoded in a template, you can either modify them with the MAG region you want to use or update the template to follow the best practices.<\/p>\n<p>See <a href=\"https:\/\/github.com\/Azure\/azure-quickstart-templates\/blob\/master\/1-CONTRIBUTION-GUIDE\/best-practices.md#best-practices\">Best Practices Guide<\/a> for more information.<\/p>\n<h2>Ways to Deploy<\/h2>\n<p><strong>Use the &#8220;Deploy to Azure&#8221; link<\/strong><\/p>\n<p>Many template will have a \u201cDeploy to Azure\u201d button that allows one-click deployment to Azure commercial.\u00a0 You can re-direct this to MAG by following these simple steps<\/p>\n<ol>\n<li>Right-click the button and select copy link<\/li>\n<li>Paste link into your browser but don\u2019t click enter yet<\/li>\n<li>Go to the beginning of the URL and change portal.azure.com to portal.azure.us.<\/li>\n<li>Click Enter<\/li>\n<\/ol>\n<p><strong>Powershell<\/strong><\/p>\n<p>Once you are <a href=\"https:\/\/blogs.msdn.microsoft.com\/azuregov\/2016\/06\/12\/managing-azure-government-subscriptions-with-powershell\/\">logged into MAG<\/a>, you can deploy templates using the commercial documentation.<\/p>\n<p><a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/resource-group-template-deploy\/\">https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/resource-group-template-deploy\/<\/a><\/p>\n<p><strong>Copy and Paste into Portal<\/strong><\/p>\n<p>Browse to MAG portal, <a href=\"https:\/\/portal.azure.us\/\">https:\/\/portal.azure.us<\/a> and follow the commercial documentation.<\/p>\n<p><a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/resource-group-template-deploy-portal\/\">https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/resource-group-template-deploy-portal\/<\/a><\/p>\n<p>We welcome your comments and suggestions to help us continually\u00a0improve your Azure Government experience. To stay up to date on all things Azure Government, be sure to subscribe to our <a href=\"https:\/\/blogs.msdn.microsoft.com\/azuregov\/feed\/\"><span>RSS feed<\/span><\/a> and to receive emails, click \u201cSubscribe by Email!\u201d on the <a href=\"https:\/\/blogs.msdn.microsoft.com\/azuregov\/\"><span>Azure Government Blog<\/span><\/a>. To experience the power of Azure Government for your organization, sign up for an <a href=\"https:\/\/azuregov.microsoft.com\/trial\/azuregovtrial\"><span>Azure Government Trial<\/span><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the release of Azure Resource Manager on Microsoft Azure Government (MAG), users are now able to provision and deploy applications using declarative templates.\u00a0 A full listing of publicly contributed templates can be found at https:\/\/azure.microsoft.com\/en-us\/documentation\/templates\/ . How to use QuickStart Templates in MAG Many of the contributed templates in our Github repo https:\/\/github.com\/Azure\/azure-quickstart-templates will [&hellip;]<\/p>\n","protected":false},"author":1773,"featured_media":20423,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[15,21,25],"tags":[59,75,95,115,547],"class_list":["post-4005","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-management","category-onboarding","category-portalpreview","tag-arm","tag-azure","tag-azure-government","tag-azure-resource-manager","tag-templates"],"acf":[],"blog_post_summary":"<p>With the release of Azure Resource Manager on Microsoft Azure Government (MAG), users are now able to provision and deploy applications using declarative templates.\u00a0 A full listing of publicly contributed templates can be found at https:\/\/azure.microsoft.com\/en-us\/documentation\/templates\/ . How to use QuickStart Templates in MAG Many of the contributed templates in our Github repo https:\/\/github.com\/Azure\/azure-quickstart-templates will [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/4005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/users\/1773"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/comments?post=4005"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/4005\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media\/20423"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media?parent=4005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/categories?post=4005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/tags?post=4005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}