Deploying Azure Resource Manager templates in PowerShell runbook?
This article will teach you how to use a PowerShell runbook to deploy Azure Resource Manager templates. Using an Azure Resource Management template, you may create an Azure Automation PowerShell runbook that installs an Azure resource. You may use Azure Automation and Azure Storage to automate the deployment of your Azure resources by using the template. You may keep your Resource Manager templates in Azure Storage, which is a central, safe place.
It’s not straightforward to create an ARM template from scratch, especially if you’re new to Azure deployment and unfamiliar with the JSON format. You may configure a resource, such as an Azure Storage account, using the Azure portal. You can save your settings as a template before deploying the resource. And, you may save and reuse the template in the future.
Prerequisites
- Firstly, get Azure subscription. If you don’t have one yet, you can activate your MSDN subscriber benefits or sign up for a free account.
- Secondly, Automation account to hold the runbook and authenticate to Azure resources. This account must have permission to start and stop the virtual machine.
- Subsequently, Azure Storage account in which to store the Resource Manager template
- Lastly, Azure PowerShell installed on a local machine. See Install the Azure PowerShell Module for information about how to get Azure PowerShell.
The Following steps are involved –
- Firstly, Creating the Resource Manager template
- Secondly, Save the Resource Manager templates in Azure Storage
- Thirdly, Creating the PowerShell runbook script
- Subsequently, Import and publish the runbook into your Azure Automation account
- Finally, Start the runbook and complete the process. and you are done!
The runbook obtains the Resource Manager template and deploys a new Azure Storage account using it.
Reference documentation – Deploy an Azure Resource Manager template in a PowerShell runbook