I am trying to leverage https://learn.microsoft.com/en-us/powershell/module/az.keyvault/set-azkeyvaultmanagedstoragesasdefinition?view=azps-9.2.0 to create a managed sas definition.
The SAS token I use as a template does work, and I am able to validate by querying my blob storage account via the following:
https://myaccount.blob.core.windows.net/lockedcontainer/checkmark.png?{sas-token}
When trying to do the same with the SAS token stored in the secret (which is retrieved via the following)
Get-AzKeyVaultSecret -VaultName {myvault} -Name {myStorageAccount}-SecretName -AsPlainText
I receive a Signature did not match error, which from some googling/research seems to be fairly generic.
The secret SAS token was generated to be active for 30 days +, and no key rotation has happened since the secret was generated.
Am I misusing the generated secret sas token?
I tried to reproduce the same in my environment and got the same error like below:
I generated the managed SAS definition by using below script:
I retrieved the SAS Token stored in the Key Vault by using the below command:
I used the above SAS token, and I am able to access the Blob successfully like below:
The error usually occurs if the SAS Token is not matching the resource while requesting on Azure Storage.
Check whether your Azure key Vault is assigned
Storage Account Key Operator Service Role
like below:If still the persists, regenerate the SAS Token and check.