Getting InvalidStorageAccountKey error while deploying ACI
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."
}
}