Synapse to Storage Account Using MI fails

Microsoft
Hi,
 

I am facing some issue in connectivity to synapse workspace to Storage Account using system Assigned Managed identity through pyspark notebook. 

I am able to connect using Linked service (using Managed Identity Authentication). However when trying to connect same storage account using notebook it fails.

 

test code using:

from azure.identity import DefaultAzureCredential

from azure.storage.blob import BlobServiceClient
credential = DefaultAzureCredential()
# Create a BlobServiceClient using the managed identity for authentication
service_client = BlobServiceClient(account_url=f"https://{storage_account_name}.blob.core.windows.net"credential=credential)
 
Error it gives:
DefaultAzureCredential failed to retrieve a token from the included credentials. Attempted credentials: EnvironmentCredential: EnvironmentCredential authentication unavailable. Environment variables are not fully configured. Visit
https://aka.ms/azsdk/python/identity/environmentcredential/troubleshoot to troubleshoot this issue. ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint. SharedTokenCacheCredential: SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache. AzureCliCredential: Azure CLI not found on path AzurePowerShellCredential: PowerShell is not installed AzureDeveloperCliCredential: Azure Developer CLI could not be found. Please visit https://aka.ms/azure-dev for installation instructions and then,once installed, authenticate to your Azure account using 'azd auth login'. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot.
 
I have followed all the steps mentioned here, like run notebook under managed identity etc. 
 
Appreciate any inputs!
 
Thanks
0 Replies