Objectives
In this article, you will:
- 1: Review an ARM template for deployment of an Azure managed disk
- 2: Create an Azure managed disk by using an ARM template
- 3: Review the ARM template-based deployment of the managed disk
1: Review an ARM template for deployment of an Azure managed disk
we will create an Azure disk resource by using an Azure Resource Manager template.
Sign in to the https://portal.azure.com.
In the Azure portal, search for and select Resource groups.
In the list of resource groups, click az104-03a-rg1.
On the az104-03a-rg1 resource group blade, in the Settings section, click Deployments.
On the az104-03a-rg1 - Deployments blade, click the first entry in the list of deployments.
On the Microsoft.ManagedDisk-XXXXXXXXX | Overview blade, click Template.
Review the content of the template and note that you have the option to Download it to the local computer, Add to library, or Deploy it again.
Click Download and save the compressed file containing the template and parameters files to the Downloads folder on your lab computer.
On the Microsoft.ManagedDisk-XXXXXXXXX | Template blade, click Inputs.
Note the value of the location parameter. You will need it in the next task.
Extract the content of the downloaded file into the Downloads folder on your lab computer.
Close all File Explorer windows.
2: Create an Azure managed disk by using an ARM template
In the Azure portal, search for and select Deploy a custom template.
Click Template deployment (deploy using custom templates) found under the Marketplace group.
On the Custom deployment blade, click Build your own template in the editor.
On the Edit template blade, click Load file and upload the template.json file you downloaded in the previous task.
Within the editor pane, remove the following lines:
json"sourceResourceId": { "type": "String" }, "sourceUri": { "type": "String" }, "sourceImageVersionId": { "type": "String" }, "osType": { "type": "String" },
json"hyperVGeneration": { "defaultValue": "V1", "type": "String" },
json"osType": "[parameters('osType')]",
These parameters are removed since they are not applicable to the current deployment. In particular, sourceResourceId, sourceUri, osType, and hyperVGeneration parameters are applicable to creating an Azure disk from an existing VHD file.
Save the changes.
Back on the Custom deployment blade, click Edit parameters.
On the Edit parameters blade, click Load file and upload the parameters.json file you downloaded in the previous task, and Save the changes.
Back on the Custom deployment blade, specify the following settings:
Setting Value Subscription the name of the Azure subscription you are using in this lab Resource Group the name of a new resource group az104-03b-rg1 Region the name of any Azure region available in the subscription you are using in this lab Disk Name az104-03b-disk1 Location the value of the location parameter you noted in the previous task Sku Standard_LRS Disk Size Gb 32 Create Option empty Disk Encryption Set Type EncryptionAtRestWithPlatformKey Network Access Policy AllowAll Select Review + Create and then select Create.
Verify that the deployment completed successfully.
3: Review the ARM template-based deployment of the managed disk
In the Azure portal, search for and select Resource groups.
In the list of resource groups, click az104-03b-rg1.
On the az104-03b-rg1 resource group blade, in the Settings section, click Deployments.
From the az104-03b-rg1 - Deployments blade, click the first entry in the list of deployments and review the content of the Input and Template blades.
Subscribe by Email
Follow Updates Articles from This Blog via Email
No Comments