There was an error while loading. Please reload this page.
1 parent d478cd6 commit 6449318Copy full SHA for 6449318
1 file changed
src/mcp_server/services/image_service.py
@@ -8,6 +8,7 @@
8
9
import base64
10
import logging
11
+import os
12
import uuid
13
14
@@ -28,10 +29,11 @@
28
29
30
31
def _get_credential():
- """Return a credential, preferring user-assigned MI when a client id is set."""
32
- if config.azure_client_id:
33
- return ManagedIdentityCredential(client_id=config.azure_client_id)
34
- return DefaultAzureCredential()
+ """Return a credential based on environment (dev vs deployed)."""
+ app_env = os.environ.get("APP_ENV", "prod").lower()
+ if app_env == "dev":
35
+ return DefaultAzureCredential(require_envvar=True)
36
+ return ManagedIdentityCredential(client_id=config.azure_client_id)
37
38
39
def _ensure_container(blob_service: BlobServiceClient, container_name: str) -> None:
0 commit comments