summary import { StorageAccountCreateParameters , StorageManagementClient } from "@msinternal/storage-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function storageAccountCreateUserAssignedEncryptionIdentityWithCmk ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "res9101" ; const accountName = "sto4445" ; const parameters = { encryption : { encryptionIdentity : { encryptionUserAssignedIdentity : "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}" } , keySource : "Microsoft.Keyvault" , keyVaultProperties : { keyName : "wrappingKey" , keyVaultUri : "https://myvault8569.vault.azure.net" , keyVersion : "" } , services : { blob : { enabled : true , keyType : "Account" } , file : { enabled : true , keyType : "Account" } } } , identity : { type : "UserAssigned" , userAssignedIdentities : { "/subscriptions/{subscriptionId}/resourceGroups/res9101/providers/MicrosoftManagedIdentity/userAssignedIdentities/{managedIdentityName}" : { } } } , kind : "Storage" , location : "eastus" , sku : { name : "Standard_LRS" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new StorageManagementClient ( credential , subscriptionId ) ; const result = await client . storageAccounts . beginCreateAndWait ( resourceGroupName , accountName , parameters ) ; console . log ( result ) ; } storageAccountCreateUserAssignedEncryptionIdentityWithCmk ( ) . catch ( console . error ) ;