Added .default scope to URI to get token using DefaultAzureCredential
Fixing issue encountered when using this in some contexts (like virtual environments in notebooks).
This commit is contained in:
committed by
GitHub
parent
e3395df981
commit
3c334e70dd
@ -58,7 +58,7 @@
|
||||
"from azure.identity import DefaultAzureCredential\n",
|
||||
"\n",
|
||||
"default_credential = DefaultAzureCredential()\n",
|
||||
"token = default_credential.get_token(\"https://cognitiveservices.azure.com\")\n",
|
||||
"token = default_credential.get_token(\"https://cognitiveservices.azure.com/.default\")\n",
|
||||
"\n",
|
||||
"openai.api_type = 'azure_ad'\n",
|
||||
"openai.api_key = token.token\n",
|
||||
|
Reference in New Issue
Block a user