Getting InvalidStorageAccountKey error while deploying ACI

Sergio Castañeda 0 Reputation points Microsoft Employee
2024-12-26T18:12:02.7333333+00:00

I'm trying to deploy an ACI with a mounted Azure File but keep getting an error that the storage account key is invalid. For context. I have successfully deployed other ACIs with volumes hosted on the same storage account and using the same key without an issue. I've used YAML files, but for simplicity and as a test I also used Azure CLI to retrieve the key and deploy the container to rule out any typos and below is the command I used:

STORAGE_KEY=$(az storage account keys list --resource-group $ACI_PERS_RESOURCE_GROUP --account-name $ACI_PERS_STORAGE_ACCOUNT_NAME --query "[0].value" --output tsv)

WARNING: [Warning] This output may compromise security by showing secrets. Learn more at: https://go.microsoft.com/fwlink/?linkid=2258669

az container create --resource-group $ACI_PERS_RESOURCE_GROUP --name test-server --image lscr.io/linuxserver/prowlarr:latest --dns-name-label saturnz-barrz --ports 9696 --azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME --azure-file-volume-account-key $STORAGE_KEY --azure-file-volume-share-name prowlarr-config --azure-file-volume-mount-path /config/

Here is the error I keep getting no matter the method I use to deploy:

{

"status": "Failed",

"error": {

    "code": "InvalidStorageAccountKey",

    "message": "The Azure storage account key in volume 'azurefile' is invalid."

}

}

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,330 questions
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
717 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,297 questions
{count} votes

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.