0

I'm using this code to try to check successful connectivity to azure using python sdk

tgt_container_url = f'https://{storage_acct_name}.blob.core.windows.net/{container_name}'
sas_url = f"{tgt_container_url}?{sas_key}"
blob_client = BlobClient.from_blob_url(sas_url)
snapshot_blob = blob_client.create_snapshot()
print(snapshot_blob.get('snapshot'))

I receive the below error:

azure.core.exceptions.HttpResponseError:
Operation returned an invalid status 'Server failed to authenticate the request.
Make sure the value of Authorization header is formed correctly including the signature.'

Any suggestions would be great. thanks.

Markus
  • 5,976
  • 5
  • 6
  • 21
mnk
  • 1
  • Does this answer your question? [Authentication Failure when Accessing Azure Blob Storage through Connection String](https://stackoverflow.com/questions/64344806/authentication-failure-when-accessing-azure-blob-storage-through-connection-stri) – Ecstasy Aug 05 '22 at 08:28
  • [Azure Blob: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)](https://stackoverflow.com/questions/64678093/azure-blob-403-server-failed-to-authenticate-the-request-make-sure-the-value) and [Azure Blob Storage fails to authenticate: "Make sure the value of Authorization header is formed correctly including the signature"](https://learn.microsoft.com/en-us/answers/questions/334786/azure-blob-storage-fails-to-authenticate-34make-su.html) – Ecstasy Aug 05 '22 at 08:33
  • Thanks Markus and Deep. I was unable to get it working but having received the account access key, i hope it will be easier through the creation of connection string `f"DefaultEndpointsProtocol=https;AccountName={storage_acct_name};AccountKey={storage_acct_key}"` – mnk Aug 05 '22 at 09:37

0 Answers0