Synapse to Storage Account Using MI fails


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 import BlobServiceClient
credential = DefaultAzureCredential()
# Create a BlobServiceClient using the managed identity for authentication
service_client = BlobServiceClient(account_url=f"https://{storage_account_name}"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 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 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
I have followed all the steps mentioned here, like run notebook under managed identity etc. 
Appreciate any inputs!
0 Replies