The following tenants don't contain accessible subscriptions. Use 'az login --allow-no-subscriptions' to have tenant level access.

Siegfried Heintze 1,906 Reputation points
2021-11-17T04:17:08.423+00:00

When I log in using "az.cmd login" I get this error message

az.cmd login  
You have logged in. Now let us find all the subscriptions to which you have access...  
The following tenants don't contain accessible subscriptions. Use 'az login --allow-no-subscriptions' to have tenant level access.  
  
...  
several guids here  
...  

So what does this mean? I see that one of the GUIDs is a AAD tenant that I want to use (that was working last time I tried it last spring).

When I use the portal it looks fine: I can switch directories and see my applications in this AADB2C tenant.

I suspect I need to (re)connect my tenant to my subscription? How do I do that?

Could this be related to this other issue : aadsts7000222-the-provided-client-secret-keys-are.html?

Thanks

Siegfried

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

Answer accepted by question author
AmanpreetSingh-MSFT 56,971 Reputation points Moderator
2021-11-17T07:30:11.823+00:00

Hi @Siegfried Heintze • Thank you for reaching out.

I am suspecting that the user account you are trying to sign in with, has access to multiple tenants, where the account is added as a guest. When you are trying to sign in by running az login command, it is connecting to a tenant where this user doesn't have access to the subscription.

Please try below steps:

  1. login to Azure Portal and switch to the directory you want to access by using Az Login cmd.
  2. Navigate to the subscription blade and make sure the user has at least read permission to the subscription.
  3. Run az login --tenant your_tenant.onmicrosoft.com command and you should no longer encounter The following tenants don't contain accessible subscriptions. Use 'az login --allow-no-subscriptions' to have tenant level access. message.

Note: The above steps are for standard Azure AD tenant and not for B2C tenant, because in case of B2C tenant, subscription is linked to the B2C service and not to the tenant. In B2C tenant, you must use --allow-no-subscriptions switch.

It doesn't seem to be related to aadsts7000222-the-provided-client-secret-keys-are.html

-----------------------------------------------------------------------------------------------------------

Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

Was this answer helpful?

3 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.