question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az storage container create fails and returns incorrect error message

See original GitHub issue

Describe the bug

az storage container create fails after creating a storage account.

Command Name az storage container create

Errors:

The request may be blocked by network rules of storage account. Please check network rule set using 'az storage account show -n accountname --query networkRuleSet'.
If you want to change the default action to apply when no rule matches, please use 'az storage account update'.

If I run the command suggested in the error message, az storage account show -n accountname --query networkRuleSet, I get the output below, showing that there are no network rules blocking the creation of a storage container:

{
  "bypass": "AzureServices",
  "defaultAction": "Allow",
  "ipRules": [],
  "virtualNetworkRules": []
}

To Reproduce:

The BASH script below reproduces the issue:

#!/bin/bash

location="eastus"
resourceGroupName="rg-repro"
storageAccountName="sarepro"
storageContainerName="ctrepro"

az group create --location $location --name $resourceGroupName

az storage account create \
    --name $storageAccountName \
    --resource-group $resourceGroupName \
    --location $location 

az storage container create \
    --name $storageContainerName \
    --account-name $storageAccountName \
    --resource-group $resourceGroupName \
    --auth-mode login 

Expected Behavior

The az storage container create command should succeed, or there should be an error message describing why the command failed.

Environment Summary

Linux-4.19.104-microsoft-standard-x86_64-with-debian-bullseye-sid
Python 3.6.10
Installer: DEB

azure-cli 2.10.1

Additional Context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Juliehzlcommented, Jul 16, 2021

az storage container-rm is supported now without additional data related roles. It will use login AD credential directly to ARM.

1reaction
Juliehzlcommented, Sep 2, 2020

It is because they are using your management login information with some control plane API but CLI is using data plane API for container operations. We are working on support same behavior with portal for container operations now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve errors for storage account names - Azure
Describes how to resolve errors for Azure storage account names ... An invalid storage account name causes an error code during deployment.
Read more >
Azure CLI cannot find blob in storage container when using CLI
You'll notice the error I got was, "Authentication failure. This may be caused by either invalid account key, connection string or sas token ......
Read more >
Error from az storage blob upload-batch command in Azure ...
When trying to run this command from an Azure Devops release task. The task is a Azure CLI (Preview) V2 with Powershell core...
Read more >
Troubleshooting mount issues - Amazon Elastic File System
A file system mount on an Amazon EC2 instance on Microsoft Windows fails. ... with "incorrect mount option" error message; Mounting with access...
Read more >
You are not authorized to perform this operation - ShareGate
Your Azure storage container is expired. This can occur with containers provided by Microsoft. The migration tool uses these containers by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found