To create a Microsoft Azure storage profile, you make a POST request with a region ID. The request body includes a Microsoft Azure fabric storage account ID.

As an alternative to using the storage-profiles API call to create a Microsoft Azure storage profile, you can also use the storage-profiles-azure API call. Optional procedure steps show how to use the storage-profiles-azure API call. The example only includes the steps required to create a Microsoft Azure storage profile using the storage-profiles API call.

Prerequisites

  • Verify that all general prerequisites and prerequisites for the Cloud Assembly 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

  1. Assign the cloud account ID variable.
    azure_cloud_account_id='<your_cloud_account_id>'
  2. Look up region IDs associated with the cloud account.
    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'"$zaure_cloud_account_id"'"  | jq "."
  3. Examine the response to find the ID for the region that you want.
  4. Assign the region ID variable.
    azure_region_id='<your_region_id>'
  5. List all Azure fabric storage accounts.
    curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/fabric-azure-storage-accounts/?apiVersion=$api_version" | jq "."
  6. To select a storage account ID, examine the response.
  7. Create a storage profile for the selected region.
    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": "env", "value": "dev" } ], 
        "diskProperties": { 
        "azureOsDiskCaching": "None", 
        "azureDataDiskCaching": "None" 
      }, 
      "diskTargetProperties": { "storageAccountId": "<storage_account_id_from_response>" }, 
      "regionId": "'$azure_region_id'", 
      "name": "<your-azure-storage-profile>", 
      "description": "Example Azure storage profile" 
    }' | jq "."
  8. (Optional) Create a storage profile for the selected region using the storage-profiles-azure API call.
    curl -X POST \ 
      $url/iaas/api/storage-profiles-azure?apiVersion=$api_version \ 
      -H 'Content-Type: application/json' \ 
      -H "Authorization: Bearer $access_token" \ 
      -d '{ 
        "defaultItem": false, 
        "supportsEncryption": false, 
        "osDiskCaching": "None", 
        "dataDiskCaching": "None", 
        "storageAccountId": "<storage_account_id_from_response>", 
        "regionId": "'$azure_region_id'", 
        "name": "<your-azure-storage-profile>", 
        "description": "Example Azure storage profile" 
        "tags": [ { "key": "env", "value": "dev" } ] 
    }' | jq "."
  9. To obtain the storage profile ID, examine the response.
  10. Assign the storage profile ID variable.
    azure_storage_profile_id='<your_storage_profile_id>'
  11. (Optional) Look up the storage profile you created with your storage profile ID.
    curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" $url/iaas/api/storage-profiles/$azure_storage_profile_id?apiVersion=$api_version | jq "."
    The response shows the name and ID for the storage profile you created.
    Note: Using the external region ID and the cloud account ID, you can also filter for the storage profile with a query that does not require the storage profile ID. See Filtering Resources by Region ID.
  12. (Optional) List all Azure storage profiles using the storage-profiles-azure API call.
    curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" $url/iaas/api/storage-profiles-azure?apiVersion=$api_version | jq "."
  13. (Optional) Delete a Microsoft Azure storage profile. Alternatively, you can use the storage-profiles-azure API call.
    curl -X DELETE -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" $url/iaas/api/storage-profiles/$azure_storage_profile_id?apiVersion=$api_version | jq "."

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 us-east-1

$ 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": "us-east-1",
      "cloudAccountId": "c8c3c9bfdb449475-7f703c5265a63d87-5fa34c478df36b060e1ca3551254c4033013bf3283908e4661cd1c6fb2f8b9ae-ce5aad01092b47558644f6b6615d",
      "id": "37d6c1acf4a8275586468873c739",
      "updatedAt": "2022-04-02",
...

Assign the Azure region ID.

$ azure_region_id='37d6c1acf4a8275586468873c739'

List all fabric storage accounts.

$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/fabric-azure-storage-accounts/?apiVersion=$api_version" | jq "."

A snippet of the response shows the storage accounts.

...      
      "externalId": "/subscriptions/b8ef63a7-a5e3-44fa-8745-1ead33fa1f25/resourceGroups/default-rg/providers/Microsoft.Storage/storageAccounts/azbasicsa80370",
      "name": "azbasicsa80370",   
      "id": "f81c26bf-51b1-49cc-865c-de2ab3821c1d",
...

Select storage account ID and create an Azure storage profile named azure-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": "env", "value": "dev" } ], 
    "diskProperties": { 
    "azureOsDiskCaching": "None", 
    "azureDataDiskCaching": "None" 
  }, 
  "diskTargetProperties": { "storageAccountId": "f81c26bf-51b1-49cc-865c-de2ab3821c1d" }, 
  "regionId": "'$azure_region_id'", 
  "name": "azure-storage-profile", 
  "description": "Example Azure storage profile" 
}' | jq "."

A snippet of the response shows the storage profile ID.

...
  "externalRegionId": "us-east-1",
  "name": "azure-storage-profile",
  "description": "Example Azure storage profile",
  "id": "f83d0fd4-45de-4ca7-a699-c98bc141ecaa",
  "createdAt": "2022-04-02",
  "updatedAt": "2022-04-02",
...