To create a Microsoft Azure storage profile for a managed disk, you make a POST request with a region ID and include disk properties to specify the managed disk type.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Automation Assembler Infrastructure as a Service (IaaS) service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that you have the cloud account ID for the new cloud account that you added. See Adding Cloud Accounts.
Procedure
Example: Create a Microsoft Azure storage profile
Assign the required variables including the cloud account ID for a
Microsoft Azure cloud account.
$ url='https://appliance.domain.com'
$ api_version='2021-07-15'
$ azure_cloud_account_id='c8c3c9bfdb449475-7f703c5265a63d87-5fa34c478df36b060e1ca3551254c4033013bf3283908e4661cd1c6fb2f8b9ae-ce5aad01092b47558644f6b6615d'
Look up region IDs associated with the cloud account and in the external region ID eastus
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/regions/?apiVersion=$api_version&"'$filter'"=externalRegionId%20eq%20'us-east-1'%20and%20cloudAccountId%20eq%20'"$azure_cloud_account_id"'" | jq "."
A snippet of the response shows the region ID.
...
"externalRegionId": "eastus",
"cloudAccountId": "c8c3c9bfdb449475-7f703c5265a63d87-5fa34c478df36b060e1ca3551254c4033013bf3283908e4661cd1c6fb2f8b9ae-ce5aad01092b47558644f6b6615d",
"id": "20d6c1abc4a8275586468873c721",
"updatedAt": "2022-04-02",
...
Assign the Azure region ID.
$ azure_region_id='20d6c1abc4a8275586468873c721'
Create a Microsoft Azure storage profile named azure-with-managed-disks-storage-profile.
$ curl -X POST \ $url/iaas/api/storage-profiles?apiVersion=$api_version \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "defaultItem": false, "supportsEncryption": false, "tags": [ { "key": "type", "value": "managed" } ], "diskProperties": { "azureManagedDiskType": "Standard_LRS", "azureOsDiskCaching": "ReadWrite", "azureDataDiskCaching": "ReadWrite" }, "regionId": "'$azure_region_id'", "name": "azure-with-managed-disks-storage-profile", "description": "Example Azure with managed disks storage profile" }' | jq "."
A snippet of the response shows the storage profile ID.
... "externalRegionId": "eastus", "name": "azure-with-managed-disks-storage-profile", "description": "Example Azure with managed disks storage profile", "id": "f83d0fd4-45de-4ca7-a699-c20bc121abcd", "createdAt": "2022-04-02", "updatedAt": "2022-04-022021-08-02", ...