While executing the below command if you encounter below mentioned errors then follow the appropriate solution provided.
Command: az account show –query “{subscriptionId:id, tenantId:tenantId}”
Error: The subscription of ” doesn’t exist in cloud ‘AzureCloud’.

Solution:

  1. If you encounter such issues related to subscription not found using azure cli then try to login using below command.
    Command: az login
    When you execute this command it will redirect you to microsoft azure login page, provide your credentials and authentication for azure cli. By doing this you can find your subscription on the azure cli.
  2. If still you encounter the same issue by following above solution then , please follow this solution that is run the below command which will help you to logout from azure account:
    Command: az logout
    Using this command , you will be logged out from the azure account.So, now you can run az login command again to login into azure account because sometimes if you are login but then also it shows error , so for that just logout from that account and re login to that account
  3. You may also encounter this issue if the administrator had deleted the subscription or you don’t have any subscription. When you login to azure CLI it will give you a message “No subscription found for user” if you don’t have any subscriptions for azure account.

command azlogin

We can access tenant without subscription using below command
Command: az login –allow-no-subscriptions

Support On Demand!

                                         
Cloud