(ResourceGroupNotFound) Resource group '????' could not be found when creating an azure media services account

RadarBug picture RadarBug · Nov 21, 2018 · Viewed 17.2k times · Source

I'm trying to create a Service Principal account using the instructions here

https://docs.microsoft.com/en-us/azure/media-services/latest/stream-files-tutorial-with-api#examine-the-code-that-uploads-encodes-and-streams

However when I run the command

az ams account sp create --account-name *media_service_account_name* --resource-group *resource_group_name*

Where media_service_account_name is the name shown for the media service I have created and resource_group_name the name of the resource group shown on the same page.

The problem is I get the message ResourceGroupNotFound:

Resource group 'resource_group_name' could not be found.

I just can't see what I am doing wrong. Any help appreciated.

Answer

Swapnil Pandit picture Swapnil Pandit · Nov 28, 2019

If you have multiple subscriptions, set your subscription first and then try:

  • To list all subscriptions - az account list --output table
  • To set your subscription - az account set --subscription <subscription-id>