question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for managed identity in azure.storage.fileshare

See original GitHub issue

Running the following:

from azure.storage.fileshare import ShareFileClient
from azure.identity import DefaultAzureCredential

file_client = ShareFileClient(
                        account_url=f"https://{storage_account}.file.core.windows.net/",
                        file_path=file_path,
                        credential=DefaultAzureCredential(),
                        share_name=share_name
                     )

Leads to the following error:

ValueError("Token credentials not supported by the File service.")

Default credentials in my case would be managed identity. It’s not explicitly mentioned in the documentation (as far as I can see), but is managed identity not supported by this library? Will it be supported, and if so, when?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jalauzon-msftcommented, Sep 21, 2022

Hi all, apologies for the long delay with no update but we’ve essentially been waiting for the service to add support for AAD auth to the Files service. I’m happy to report the service team is finally working on adding this support and we should soon be able to support this in the SDK. I don’t have yet have a concrete timeline but hopefully it will be coming within the next couple of releases.

Thanks for your patience. I will update here once the feature has been added.

1reaction
jvschoencommented, Mar 2, 2022

Any update on this? what is the best approach to connecting to file service through python SDK?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can we use Managed identity to connect to Azure fileshare ...
Hello, as @grmacjon-msft points out you can not user managed identity to access Azure file shares, however you might try using them to...
Read more >
Overview - Azure Files identity-based authentication
Azure Files supports identity-based authentication over SMB (Server Message Block) with Active Directory Domain Services (AD DS), ...
Read more >
Is it possible to mount Azure file share using managed identity ...
Managed Identity cannot be used for mounting Azure File Shares. Only options available are Shared Access Signature, Storage Account Name/Key ...
Read more >
Is it possible to connect Azure File share (Storage account ...
I was trying to upload a file to Azure file share using my C# code using the Managed identity. The code will be...
Read more >
Tutorial`:` Use a managed identity to access Azure Storage
Managed identities for Azure resources, can be used to authenticate to resources that support Azure AD authentication. Grant access by assigning ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found