{"id":10972,"date":"2022-04-08T10:33:21","date_gmt":"2022-04-08T10:33:21","guid":{"rendered":"https:\/\/viewmyprojects.com\/winwirewp\/?p=10972"},"modified":"2023-11-29T08:01:01","modified_gmt":"2023-11-29T08:01:01","slug":"deploy-resources-with-custom-arm-templates-using-azure","status":"publish","type":"post","link":"https:\/\/viewmyprojects.com\/winwirewp\/blog\/deploy-resources-with-custom-arm-templates-using-azure\/","title":{"rendered":"Deploy Resources with Custom ARM Templates &#038; Azure portal"},"content":{"rendered":"\n<p>Deployment of environments can be simplified and kept consistent using the DevOps concept Infrastructure as a Code (IaC). This reduces the time to create environments on demand for testing, user acceptance and helps tracing deployment failures way before the production release of the application.<\/p>\n\n\n\n<p>Azure Resource Manager templates enables creation of resources like Virtual machines, web apps, databases, Virtual Networks, Search Services, Storage Accounts, and many other resources. It follows a simple JSON with 3 different sections described below:<\/p>\n\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li><strong>Parameters<\/strong>: Values that are provided when deployment is executed to customize resource deployment for different environments<\/li>\n\n\n\n<li><strong>Variables<\/strong>: Values that are used as JSON fragments in the template to simplify template language expressions. These could be constructed based on parameters. These could be re-used in the templates for different environments<\/li>\n<\/ul>\n\n\n\n<p><strong>Resources<\/strong>: Resources that needs to be deployed\/updated in a resource group<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-resource-manager\/templates\/outputs\" target=\"_blank\" rel=\"noopener\"><strong>Outputs<\/strong><\/a><strong>: <\/strong>Return values from the deployed resources<\/p>\n\n\n\n<p>In this article, we will learn how to:<\/p>\n\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li>Create a basic template<\/li>\n\n\n\n<li>Different resources that can be created using a template<\/li>\n\n\n\n<li>Deploy the template using the Custom Deployment from Azure portal<\/li>\n<\/ul>\n\n\n\n<p><strong>Pre-requisite:<\/strong> How to create a resource group in Azure portal<\/p>\n\n\n\n<p><strong>How to create a basic template:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\" style=\"list-style-type:1\">\n<li>Open any text editor where working with JSON is simple and easy<\/li>\n<\/ol>\n\n\n\n<p>            Example: Visual Studio Code, Notepad++<\/p>\n\n\n\n<p>    2. Create a new file, name it sample.json and use the below code to start with<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-1-9.webp\" alt=\"\" class=\"wp-image-10973\"\/><\/figure><\/div>\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li>Save the file. This would create the first template.<\/li>\n<\/ul>\n\n\n\n<p>The template size should be limited to 4MB. The 4-MB limit is on the final state of the template after it has been expanded with iterative resource definitions and values for variables and parameters.<\/p>\n\n\n\n<p>Below are some limits on the items in the template:<\/p>\n\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li>256 parameters<\/li>\n\n\n\n<li>256 variables<\/li>\n\n\n\n<li>800 resources (including copy count)<\/li>\n\n\n\n<li>64 output values<\/li>\n\n\n\n<li>24,576 characters in a template expression<\/li>\n<\/ul>\n\n\n\n<p>The template limits can be exceeded by using a nested template.<\/p>\n\n\n\n<p>Let\u2019s know the different resources that can be created.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Different resources that can be created using a template<\/strong><\/h3>\n\n\n\n<p>There can be different resources that can be added into the template.<\/p>\n\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li>Storage Account<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-2-9.webp\" alt=\"Azure Resource Manager\" class=\"wp-image-10974\"\/><\/figure>\n\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li>Web App<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"240\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/image-3-1024x240.png\" alt=\"Azure Resource Manager\" class=\"wp-image-10975\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/image-3-1024x240.png 1024w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/image-3-300x70.png 300w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/image-3-768x180.png 768w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/image-3.png 1091w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li>Redis Cache<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-4-9.webp\" alt=\"Azure Resource Manager\" class=\"wp-image-10976\"\/><\/figure>\n\n\n\n<ul class=\"blog-detail-list wp-block-list\">\n<li>Database<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-5-7.webp\" alt=\"Deploy Resources with Custom ARM Templates using Azure portal\" class=\"wp-image-10977\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Deploy the template using the Custom Deployment from Azure portal<\/strong><\/h3>\n\n\n\n<p>1. Login to Azure portal and search for the keyword \u2018deploy\u2019. Select the \u2018Deploy a custom template\u2019.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-6-6.webp\" alt=\"Deploy Resources with Custom ARM Templates using Azure portal\" class=\"wp-image-10978\"\/><\/figure>\n\n\n\n<p> 2. Click on the link \u2018Build your own template in editor\u2019<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-7-4.webp\" alt=\"Deploy Resources with Custom ARM Templates using Azure portal\" class=\"wp-image-10979\"\/><\/figure>\n\n\n\n<p>3. Use the \u2018Load file\u2019 option and upload the template file that is created in the initial step above. Click on \u2018Save\u2019 button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-8-1024x449-1.webp\" alt=\"Deploy Resources with Custom ARM Templates using Azure portal\" class=\"wp-image-10980\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-9-4.webp\" alt=\"Deploy template Azure portal\" class=\"wp-image-10981\"\/><\/figure>\n\n\n\n<p>4. Provide the required parameter values. Select the resource group where all the specified resources need to be created.<\/p>\n\n\n\n<p>Click on \u2018Review + Create\u2019 button as shown in the screenshot below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-10-3.webp\" alt=\"Deploy template Azure portal\" class=\"wp-image-10982\"\/><\/figure>\n\n\n\n<p>5. The template provided is validated and then displays the parameters provided.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-11-3.webp\" alt=\"Deploy template Azure portal\" class=\"wp-image-10983\"\/><\/figure>\n\n\n\n<p>6. Check the \u2018Basics\u2019 section displayed with the provided parameters and click on \u2018Create\u2019. This will start the deployment process in the portal.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-12-3.webp\" alt=\"azure resource manager and Azure portal\" class=\"wp-image-10984\"\/><\/figure>\n\n\n\n<p>7. The deployment will take a little while to create all the resources in the specified resource group.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/image-13-3.webp\" alt=\"azure resource manager and Azure portal\" class=\"wp-image-10985\"\/><\/figure>\n\n\n\n<p>Once the deployment is complete, all the resources will be created and will be available in the specified resource group.<\/p>\n\n\n\n<p><strong>Conclusion<\/strong><\/p>\n\n\n\n<p>Azure Resource Manager (ARM) templates provide a powerful way to define Azure resources and configurations, and it majorly helps the users with consistency and automation of resource deployment. Leveraging the Azure portal is one of the most accessible and most intuitive options for deployment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deployment of environments can be simplified and kept consistent using the DevOps concept Infrastructure as a Code (IaC). This reduces the time to create environments on demand for testing, user acceptance and helps tracing deployment failures way before the production release of the application. Azure Resource Manager templates enables creation of resources like Virtual machines,&hellip; <a class=\"more-link\" href=\"https:\/\/viewmyprojects.com\/winwirewp\/blog\/deploy-resources-with-custom-arm-templates-using-azure\/\">Continue reading <span class=\"screen-reader-text\">Deploy Resources with Custom ARM Templates &#038; Azure portal<\/span><\/a><\/p>\n","protected":false},"author":31,"featured_media":16356,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_eb_attr":"","_uag_custom_page_level_css":"","footnotes":""},"categories":[1,62,59],"tags":[],"class_list":["post-10972","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","category-cloud-blogs","category-blogs","entry"],"acf":[],"featured_image_src":"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal.webp","author_info":{"display_name":"Sree Navya","author_link":"https:\/\/viewmyprojects.com\/winwirewp\/author\/sreenavya\/"},"views":4827,"uagb_featured_image_src":{"full":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal.webp",800,440,false],"thumbnail":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal-150x150.webp",150,150,true],"medium":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal-300x165.webp",300,165,true],"medium_large":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal-768x422.webp",750,412,true],"large":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal.webp",750,413,false],"1536x1536":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal.webp",800,440,false],"2048x2048":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal.webp",800,440,false],"post-thumbnail":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/04\/Mar22_Blog_Azure-portal.webp",800,440,false]},"uagb_author_info":{"display_name":"Sree Navya","author_link":"https:\/\/viewmyprojects.com\/winwirewp\/author\/sreenavya\/"},"uagb_comment_info":0,"uagb_excerpt":"Deployment of environments can be simplified and kept consistent using the DevOps concept Infrastructure as a Code (IaC). This reduces the time to create environments on demand for testing, user acceptance and helps tracing deployment failures way before the production release of the application. Azure Resource Manager templates enables creation of resources like Virtual machines,&hellip;&hellip;","_links":{"self":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/10972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/comments?post=10972"}],"version-history":[{"count":2,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/10972\/revisions"}],"predecessor-version":[{"id":17879,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/10972\/revisions\/17879"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/media\/16356"}],"wp:attachment":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/media?parent=10972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/categories?post=10972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/tags?post=10972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}