Skip to content

Commit 9b77c53

Browse files
committed
Rm key credential support
1 parent b950db6 commit 9b77c53

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/quartapp/chat.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import os
33

4-
from azure.core.credentials import AzureKeyCredential
54
from azure.identity.aio import AzureDeveloperCliCredential, ManagedIdentityCredential, get_bearer_token_provider
65
from openai import AsyncAzureOpenAI
76
from quart import (
@@ -18,11 +17,7 @@
1817

1918
@bp.before_app_serving
2019
async def configure_openai():
21-
if azure_openai_key := os.getenv("AZURE_OPENAI_API_KEY_FOR_APP"):
22-
# use key credential
23-
current_app.logger.info("Using Azure OpenAI with API key")
24-
bp.azure_credential = AzureKeyCredential(azure_openai_key)
25-
elif os.getenv("RUNNING_IN_PRODUCTION"):
20+
if os.getenv("RUNNING_IN_PRODUCTION"):
2621
client_id = os.environ["AZURE_CLIENT_ID"]
2722
current_app.logger.info("Using Azure OpenAI with managed identity credential for client ID: %s", client_id)
2823
bp.azure_credential = ManagedIdentityCredential(client_id=client_id)

0 commit comments

Comments
 (0)