

Otherwise you will not be able to find the principalId for a later step. It is important that you remember to use the -mi flag in the command. Now create the Media Services account with a Service Principal, otherwise known as a Managed Identity. Change chooseSKU to your preferred SKU.Īz storage account create -n -g -location -sku Ĭreate a Media Services account with a Service Principal (Managed Identity).Change chooseLocation to the region you want to work within.Change myStorageAccount to a unique name with a length of fewer than 24 characters.You can list storage accounts.Ĭhoose a SKU from the following list: Standard_LRS, Standard_GRS, Standard_RAGRS, Standard_ZRS, Premium_LRS, Premium_ZRS, Standard_GZRS, Standard_RAGZRS. You also need to choose a SKU for your storage account. To create a resource group, use the following command: az group create -n -location chooseLocation To list available locations, use the following command: az account list-locations To list available locations, use the following command: List available locations with the CLI To create a storage account, you must first create a resource group within a location. Use the following commands to create an Azure Storage account. Create an Azure Storage account with the CLI You'll use your-storage-account-name for subsequent steps.

Create the storage account for the Media Services account first. The Media Services account you'll create must have a storage account associated with it. az account list-locations -query "." -o tableĮach of the steps below is done in a particular order because one or more values from the JSON responses are used in the next step in the sequence.

Use this command to list the regions available for your account. If you're not sure of the actual region name to use, use this command to get a listing: Because of the inconsistency of naming resources in Azure services, don't use hyphens when you name your resources.Īlso, you don't create the region name. The hyphens above are only used to separate guidance words. You'll see these names referenced in the commands below. Use the same names for each step in this article. For example, "mediatest1rg" for your resource group name and "mediatest1stor" for your storage account name. Naming rules are different for many resource types so it's best to stick with all lower case. They should be easily identifiable as a set, especially if you are not planning to use them after you are done testing. az account set -subscription īefore you get started, decide on the names of the resources you'll create. In the following command, provide the Azure subscription ID that you want to use for the Media Services account.

Use this command to set the subscription that you want to work with. When you use this command, you will be prompted for the subscription you want to use. To use any of the commands in this article, you first have to be signed in to the subscription that you want to use. This tutorial uses the Media Services API. Follow the steps below to create a Managed Identity for the Media Services account and grant this identity access to your Key Vault using the Media Services CLI. If you'd like Media Services to encrypt data using a key from your Key Vault, the Media Services account must be granted access to the Key Vault. If you are using the v2 API and would like to use managed identities, please migrate from v2 to v3 Migrate from Media Services v2 to v3 introduction. Managed identities are only available for Media Services accounts created using the v3 API.
