Use DefaultAzureCredential for managed identity in azure blob extention
Self Checks
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [X] Please do not modify this template :) and fill in all the required fields.
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I prefer not to save the key as an environment variable when using Dify on Azure. I would like to modify it so that when AZURE_BLOB_ACCOUNT_KEY is set to managedidentity, it uses DefaultAzureCredential to leverage the Managed Identity assigned to the resource.
2. Additional context or comments
No response
3. Can you help us with this feature?
- [X] I am interested in contributing to this feature.
This is a great feature. I have similar need, which is to use Service Principal or Managed Identity for authentication, depending on the actual situation of the deployment environment. Using DefaultAzureCredential is very correct and recommended by Azure, which can select different authentication methods in order according to different environments (environment variables). Therefore, using DefaultAzureCredential is not just for Managed Identity. I suggest adding an AZURE_BLOB_AUTH_MODE configuration item with sas and azure_default as options and set the default value to sas for backward compatibility. When azure_default is selected, DefaultAzureCredential is used. I am happy to help if needed. :)
Hi, @te-chan2. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.
Issue Summary
- The issue proposes enhancing the Azure Blob extension to use
DefaultAzureCredentialfor authentication. - The goal is to improve security by leveraging Managed Identity when
AZURE_BLOB_ACCOUNT_KEYis set tomanagedidentity. - @hzywind supports the feature and suggests a broader implementation with
Service PrincipalorManaged Identity. - A new configuration
AZURE_BLOB_AUTH_MODEis proposed, with optionssasandazure_default.
Next Steps
- Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting on the issue.
- If there is no further activity, the issue will be automatically closed in 15 days.
Thank you for your understanding and contribution!