简体   繁体   中英

Azure Blob Storage Not found

Per this tutorial: How to use Blob storage from iOS , I am supposed to use the Azure Command-Line Interface (Azure CLI) command:

$ azure storage account connectionstring show "mystorage"

to show the connection string of my storage account, but I am getting this error:

info: Executing command storage account connectionstring show + Getting storage account keys error: The storage account 'mystorage' was not found. info:
Error information has been recorded to /Users/user/.azure/azure.err error: storage account connectionstring show command failed

My storage is created using the new azure portal. I have noticed that if I create the storage using the classic portal (the old one), that command will run just fine and give me back the connection string.

Here is another strange behavior that may relate to this. The storage I create using the new portal is not showing up in the classic portal, but the storage I create in the class is showing up in the new portal. What's going on? How can I make that command run for my storage!?

Adding to Neil's answer: by default Azure CLI tools have Azure Service Management (ASM) mode set. What you would need to do is switch the mode to Azure Resource Manager (ARM) . Here's how you can do it.

First, use azure login to connect to your Azure Subscription.

After you're connected, simply type the following command to switch to ARM mode:

azure config mode arm

Once you do that, you should be able to list the storage account connection string for the storage account you created in the new portal (you will need to specify resource group name as well in your command).

azure storage account connectionstring show "[account-name]" -g "[resource-group-name]"

You are encountering an issue with the two control planes in Azure: the Azure Service Management (ASM) or classic; and the new Azure Resource Manager. The CLI has different modes for the two control planes. You are working in the ASM mode so are able to see ASM resources, such as the storage account created in the old portal. However, you are not able to see ARM resources such as those created in the production portal - to do that you would need to shift mode using "azure config mode arm"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM