skip to Main Content

I am following (previous and) this tutorial: https://learn.microsoft.com/en-us/training/modules/connect-an-app-to-azure-storage/9-initialize-the-storage-account-model?pivots=javascript to connect an application to the Azure Storage account.

At step 8, when I verify the creation of the container by running the given Azure CLI command and replacing with my storage account:

az storage container list 
--account-name <name>

I get the following output:

There are no credentials provided in your command and environment, we will query for account key for your storage account.
It is recommended to provide --connection-string, --account-key or --sas-token in your command as credentials.

You also can add `--auth-mode login` in your command to use Azure Active Directory (Azure AD) for authorization if your login account is assigned required RBAC roles.
For more information about RBAC roles in storage, visit https://learn.microsoft.com/azure/storage/common/storage-auth-aad-rbac-cli.

In addition, setting the corresponding environment variables can avoid inputting credentials in your command. Please use --help to get more information about environment variable usage.
[]

which I am not sure whether the container is listed as [] at the end of the above output.

Comments and suggestions are welcome. Thanks!

2

Answers


    • This error you are getting is because of an auth issue.

    • So, there are three solution one is that you run the following command before the running the az storage container list

    az login
    
    • The other way would be to use the --auth-mode option in the az storage container list this is written in the error prompt itself which you have given.

    command:

    az storage container list --account-name <name> --auth-mode login
    

    this will prompt you for login credentials once provided the output should look like this

    enter image description here

    • Lastly you can use the same option as above but with key
    az storage container list --account-name <name> --auth-mode key <key>
    

    you can get your key from the portal under access keys

    enter image description here

    The output of the command should look like this here I have two containers name photos and test.

    enter image description here

    Login or Signup to reply.
  1. I tried to reproduce in my environment and I got same error:

    enter image description here

    There are no credentials provided in your command and environment,
    we will query for account key for your storage account. It is
    recommended to provide –connection-string, –account-key or
    –sas-token in your command as credentials.

    You also can add --auth-mode login in your command to use Azure
    Active Directory (Azure AD) for authorization if your login account is
    assigned required RBAC roles. For more information about RBAC roles in
    storage, visit
    https://learn.microsoft.com/azure/storage/common/storage-auth-aad-rbac-cli.

    In addition, setting the corresponding environment variables can avoid
    inputting credentials in your command. Please use –help to get more
    information about environment variable usage. []

    The above error show that in your storage account you didn’t create any containers and files.

    I have created one container and add files.

    enter image description here

    enter image description here

    I tried the same command now i got an output successfully.

    enter image description here

    If you need to remove warnings you can use this command--only-show-errors

    enter image description here

    Reference:
    az storage container | Microsoft Learn

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search