0
votes

I'm trying to create a file share in Azure CLI command:

az storage share create --account-name storeactjan --name filesharejan --account-key key1

but having below error:

The server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

ErrorCode: AuthenticationFailed AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:42b399c2-701a-006f-4630-1d9aad000000 Time:2020-04-28T07:39:27.0899771ZThe MAC signature found in the HTTP request 'QVn0bi79ZIhaO+LS3w/VzaiI5cAMfJiVRav6RbgfbtA=' is not the same as any computed signature. Server used following string to sign: 'PUT'

2
From where you're running the code? Two things you should check: 1) Account key you're using is correct and 2) Clock on the machine from where you're running the code is correctly set.Gaurav Mantri

2 Answers

0
votes

You haven't the right format for the account-key argument. Here is what you have to do according to the microsoft documentation ( https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-create-file-share?tabs=azure-cli ). For your information, I use CLI in PowerShell.

1) Retrieve the key with the right format

$key1 = az storage account keys list --account-name storeactjan --query "[0].value" | tr -d '"'

2) Create your file share

az storage share create --account-name storeactjan --name filesharejan --account-key $key1

Hope it will help you.

0
votes

I will say, you can create arm template for the same and can call it.

PFB the link -

https://github.com/Azure/azure-quickstart-templates/tree/master/101-storage-file-share