Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
Use DefaultAzureCredential for managed identity in azure blob extention (#11559)
te-chanfac83e14bc65
diff --git a/api/extensions/storage/azure_blob_storage.py b/api/extensions/storage/azure_blob_storage.pyindex 2f8532f4f8f..eff7743cc29 100644--- a/api/extensions/storage/azure_blob_storage.py+++ b/api/extensions/storage/azure_blob_storage.py@@ -1,6 +1,7 @@from collections.abc import Generatorfrom datetime import UTC, datetime, timedelta+from azure.identity import DefaultAzureCredentialfrom azure.storage.blob import AccountSasPermissions, BlobServiceClient, ResourceTypes, generate_account_sasfrom configs import dify_config@@ -18,6 +19,11 @@ class AzureBlobStorage(BaseStorage):self.account_name = dify_config.AZURE_BLOB_ACCOUNT_NAMEself.account_key = dify_config.AZURE_BLOB_ACCOUNT_KEY+ if self.account_key == "managedidentity":+ self.credential = DefaultAzureCredential()+ else:+ self.credential = None+def save(self, filename, data):client = self._sync_client()blob_container = client.get_container_client(container=self.bucket_name)@@ -57,6 +63,9 @@ class AzureBlobStorage(BaseStorage):blob_container.delete_blob(filename)def _sync_client(self):+ if self.account_key == "managedidentity":+ return BlobServiceClient(account_url=self.account_url, credential=self.credential)+cache_key = "azure_blob_sas_token_{}_{}".format(self.account_name, self.account_key)cache_result = redis_client.get(cache_key)if cache_result is not None: