Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

https://learn.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.

like image 224
RadarBug Avatar asked Nov 21 '18 18:11

RadarBug


4 Answers

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>
like image 167
Swapnil Pandit Avatar answered Nov 18 '22 18:11

Swapnil Pandit


You may have multiple subscriptions. Set the subscription to default which you want to use in CLI.

Reference: https://learn.microsoft.com/en-us/cli/azure/manage-azure-subscriptions-azure-cli?view=azure-cli-latest

like image 38
user11678229 Avatar answered Nov 18 '22 16:11

user11678229


I had the same issue and verified the subscription with az account show, but what I was missing is that I was working in powershell and needed to set the correct subscription in powershell. Verify context: Get-Azcontext Set context: Set-Azcontext <subscription_id>

like image 8
ddmh Avatar answered Nov 18 '22 16:11

ddmh


Kindly follow these steps to get over an above error:

  1. az login It will ask you to provide credentials

  2. az account list --o table // Will list all subscription

Set your subscription on which you want to execute query 3. az account set --subscription "VS Subscription"

Hope it will help

like image 7
Sachin Kalia Avatar answered Nov 18 '22 17:11

Sachin Kalia