Issue on connecting tenant id and subscription id

Varma 1,380 Reputation points
2024-02-25T05:35:10.35+00:00

error fetching tenantID and subscriptionID from Azure CLI (are you logged on using az login?): failed to open file (C:\Users\ADMIN.azure\azureProfile.json) while loading token: open C:\Users\ADMIN.azure\azureProfile.json: The system cannot find the path specified. ==> azure-arm.autogenerated_1: Running builder ... Build 'azure-arm.autogenerated_1' errored after 1 millisecond 575 microseconds: error fetching tenantID and subscriptionID from Azure CLI (are you logged on using az login?): failed to open file (C:\Users\ADMIN.azure\azureProfile.json) while loading token: open C:\Users\ADMIN.azure\azureProfile.json: The system cannot find the path specified. ==> Wait completed after 1 millisecond 575 microseconds ==> Some builds didn't complete successfully and had errors: --> azure-arm.autogenerated_1: error fetching tenantID and subscriptionID from Azure CLI (are you logged on using az login?): failed to open file (C:\Users\ADMIN.azure\azureProfile.json) while loading token: open C:\Users\ADMIN.azure\azureProfile.json: The system cannot find the path specified. I have already given log in details you can seee: User's image

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,906 questions
Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,594 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
892 questions
{count} votes

1 answer

Sort by: Most helpful
  1. dashanan13 930 Reputation points
    2024-03-01T09:36:46.94+00:00

    Hei @Varma ,

    Thank you for contacting Microsoft Q & A

    It feels like you have an authentication issue at hand.

    The easiest way to solve this is probably start from scratch, follow these steps and let me know if it works.

    Steps:

    1. Open terminal or command prompt or your favorite command line
    2. type the following commands:
      1. az logout
      2. az login
      3. (optional) az account get-access-token
    3. check the logged in subscription scope with : az account list
    4. get the details of the subscription: az account show --name <subscription name>

    Ideally this should log you in correct scope for your auth problems to go away.

    Please mark this as answer if it helped

    0 comments No comments

Your answer

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