So I'm new on Azure and got some problems with the CLI on the portal. After creating an AKS service using the UI, I cannot find it in the CLI and get an error message as shown below. Am I missing an obscure setting that filters resources? I can't even find my resource group.
Checked the spelling multiple times, obv.
Also checked this Resource not found..., which is again for very obscure queries, whereas mine is extremely simple.
Any help would be appreciated!
(ResourceGroupNotFound) Resource group 'WebPlatformResource' could not be found.
Code: ResourceGroupNotFound
Message: Resource group 'WebPlatformResource' could not be found.
Thank you #Niels Uitterdijk , As discussed i am posting it as an answer to help other community members for the similar issue .
Message: Resource group 'yourresourcegroup' could not be found.
The above error occurs if we 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 "My Demos"
For more information please refer this MS DOC .
Related
I keep getting the following error while creating Event Subscription for my Azure Maps Account.
Error:
Creation of System Topic has failed with error: System topic's location must match with location of the source resource /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-a229d67dddf5/resourceGroups/rg-ets-new/providers/Microsoft.Maps/accounts/ets-maps-account. Event Subscription will not be created.
I get the same error if I add an Event Grid System Topic of Azure Maps Accounts Type in the same resource group the Maps Account is in. The resource group and the maps account both have the same region (West Centeral US) assigned to them.
What do you think is going wrong here? Any clues?
PS. The event subscriptions are working fine for other resources, Queues for example.
There seems to be an bug. We have reported it to Product teams. They are working on the fix. Meanwhile, there is an alternative to achieve the same.
We can successfully create an event grid topic with source events from an Azure Maps account by using Azure CLI, like in the below command. I have replaced any actual subscription details below with placeholders.
az eventgrid system-topic create --name topicName --location global --topic-type Microsoft.Maps.Accounts --source "/subscriptions/subscriptionName/resourceGroups/resourceGroupName/providers/Microsoft.Maps/accounts/mapAccountName" --resource-group "resourceGroupName"
I'm attempting to list all Databases from a CosmosDB instances using the AZ command line -
az account set --subscription $subscriptionId
az cosmosdb database list --name $cosmosName --resource-group $resourceGroup
The above command is resulting the following response -
Operation Failed: Resource Not Found
When adding the --debug argument I'm presented with the above error as well as the below detail -
Status code: 404
{"code":"NotFound","message":"Entity with the specified id does not exist in the system.\r\nActivityId: d5383919-7c23-4158-bded-2c623d55ab9b, Microsoft.Azure.Documents.Common/2.0.0.0"}
The CosmosDB that I am attempting to query absolutely does exist, derived by running the command az cosmosdb list, and I copied the SubscriptionId and ResourceGroup directly from the portal.
The MS docs and the command az cosmosdb database list --help both seem to suggest what I'm doing should work.
Can anyone suggest what I could do to fix the issue?
This error can happen if the PC where you are running Azure CLI doesn't have network connectivity to the CosmosDB account. To verify if this is the problem, please go to Portal.Azure.com > CosmosDB account > Firewall and Virtual Networks and if the firewall is enabled, add your current IP address.
I had same problem today, and I found firewall is the problem, adding client public IP will fix it, but there is another tricky part, it will take some time even after the firewall rule is updated in Azure portal ( for me I think it's 5~ 10 minutes ). I guess the rule need to be deployed to different location and it take longer time depending on which region you hit.
So you probably just need to be a bit more patient after updated firewall rule.
Also be aware, az allow three different options:
(1) resource group name and account name
(2) account name and key
(3) url-connection and key
I have found only 1 and 3 work, (2) will give me a error:
unsupported operand type(s) for +: 'NoneType' and 'str'
both "az cosmosdb database show" and "az cosmosdb database list" have same issue. the version I am using is azure-cli (2.0.45).
I want to see all the resource groups in my cluster(s). Is there a way to use az aks to get all the credentials of the cluster(s) without mentioning the names of the resource-group/cluster?
I tried az aks get-credentials, az aks show, az aks list but they all require the resource group name and I don't know it.
Any help is greatly appreciated.
Update:
I have found a way to list all resources in my azure subscription: az resource list.
I can see some resources here that when i try to find using `az
After alot of digging, you can find the list of resource groups using this command - az group list.
Note: its useful to go through the -h of for az to see what it has to offer :)
I am trying to create a VM out of a custom image in dev test lab using az lab vm create .. command.
I end up getting an error :
Message: Resource group '.....' could not be found.
I made sure that the resource group name I am passing in, is the same as the one which is listed under "Resource Group" in the lab's Overview tab.
What am I doing wrong?
In this case the az was setup to use another subscription, changing the subscription fixed the issue
I'm trying to setup Azure CLI. The first step is to create a storage for account files. I'm using my Developer Program Benefit subscription.
After I click "Create storage" I get an error:
Storage creation failed
Error:409
{"error":{"code":"MissingSubscriptionRegistration","message":"The subscription is not registered to use namespace 'Microsoft.Storage'. See https://aka.ms/rps-not-found for how to register subscriptions."}}
Can't create a storage account. Please try again.
How to resolve this issue?
The reason you're getting this error is because Microsoft.Storage resource provider which manages Storage Account related resources and activities is not registered with your Azure Subscription.
To fix this, please run the following command:
azure provider register --namespace "Microsoft.Storage" --subscription "<your subscription name or id>"
To get the subscription name/id, please run the following command:
azure account list
For more details on why you're getting this error, please see this: The subscription is not registered to use namespace 'Microsoft.DataFactory error
If you prefer GUI, then you can do it on the Azure portal too:
On the left pane click More services and then select Subscriptions
Select the subscription, in our case Developer Program Benefit
In the Settings area click Resource providers
Find Microsoft.Storage and click Register
This same error with detailed solutions are provided in this post:
How to fix Azure Cloud Shell error "MissingSubscriptionRegistration - The subscription is not registered to use namespace 'Microsoft.Storage'"