Gettting Error for Blob storage authantication #30686
Labels
Azure CLI Team
The command of the issue is owned by Azure CLI team
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Describe the bug
Error downloading blob: This request is not authorized to perform this operation using this permission.
RequestId:7fd133fa-401e-0026-1935-6ce53f000000
Time:2025-01-21T18:48:12.0414663Z
ErrorCode:AuthorizationPermissionMismatch
Content:
AuthorizationPermissionMismatch
This request is not authorized to perform this operation using this permission.RequestId:7fd133fa-401e-0026-1935-6ce53f000000
Time:2025-01-21T18:48:12.0414663Z
Related command
Need solution
Errors
Error downloading blob: This request is not authorized to perform this operation using this permission.
RequestId:7fd133fa-401e-0026-1935-6ce53f000000
Time:2025-01-21T18:48:12.0414663Z
ErrorCode:AuthorizationPermissionMismatch
Content:
AuthorizationPermissionMismatch
This request is not authorized to perform this operation using this permission.RequestId:7fd133fa-401e-0026-1935-6ce53f000000
Time:2025-01-21T18:48:12.0414663Z
Issue script & Debug output
import os
from azure.identity import DefaultAzureCredential
from azure.storage.blob import BlobServiceClient
Replace with your actual storage account name
account_url = "https://.blob.core.windows.net"
credential = DefaultAzureCredential()
Create the BlobServiceClient object
blob_service_client = BlobServiceClient(account_url, credential=credential)
print(blob_service_client)
def download_blob_to_file(blob_service_client: BlobServiceClient, container_name: str, blob_name: str, download_file_path: str):
try:
# Get the blob client
blob_client = blob_service_client.get_blob_client(container=container_name, blob=blob_name)
Call the function
download_blob_to_file(blob_service_client, container_name="car", blob_name="RAV4.pdf", download_file_path=r"pdf/p1.pdf")
Expected behavior
Downloaded file from Blob Storage
Environment Summary
azure-cli 2.68.0
core 2.68.0
telemetry 1.1.0
Dependencies:
msal 1.31.1
azure-mgmt-resource 23.1.1
Python location '/opt/az/bin/python3'
Extensions directory '/home/raksha/.azure/cliextensions'
Python (Linux) 3.12.8 (main, Jan 8 2025, 03:38:17) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date
Additional context
No response
The text was updated successfully, but these errors were encountered: