Skip to content

Commit 111793d

Browse files
committed
Add parameter for enabling key access
1 parent f33af14 commit 111793d

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

docs/deploy_existing.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ You should set these values before running `azd up`. Once you've set them, retur
2525

2626
1. Run `azd env set AZURE_OPENAI_SERVICE {Name of existing OpenAI service}`
2727
1. Run `azd env set AZURE_OPENAI_RESOURCE_GROUP {Name of existing resource group that OpenAI service is provisioned to}`
28-
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT {Name of existing ChatGPT deployment}`. Only needed if your ChatGPT deployment is not the default 'chat'.
29-
1. Run `azd env set AZURE_OPENAI_EMB_DEPLOYMENT {Name of existing GPT embedding deployment}`. Only needed if your embeddings deployment is not the default 'embedding'.
28+
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT {Name of existing chat deployment}`. Only needed if your chat deployment is not the default 'chat'.
29+
1. Run `azd env set AZURE_OPENAI_CHATGPT_MODEL {Model name of existing chat deployment}`. Only needed if your chat model is not the default 'gpt-35-turbo'.
30+
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION {Version string for existing chat deployment}`. Only needed if your chat deployment model version is not the default '0613'. You definitely need to change this if you changed the model.
31+
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU {Name of SKU for existing chat deployment}`. Only needed if your chat deployment SKU is not the default 'Standard', like if it is 'GlobalStandard' instead.
32+
1. Run `azd env set AZURE_OPENAI_EMB_DEPLOYMENT {Name of existing embedding deployment}`. Only needed if your embeddings deployment is not the default 'embedding'.
33+
1. Run `azd env set AZURE_OPENAI_EMB_MODEL_NAME {Model name of existing embedding deployment}`. Only needed if your embeddings model is not the default 'text-embedding-ada-002'.
34+
1. Run `azd env set AZURE_OPENAI_EMB_DIMENSIONS {Dimensions for existing embedding deployment}`. Only needed if your embeddings model is not the default 'text-embedding-ada-002'.
35+
1. Run `azd env set AZURE_OPENAI_EMB_DEPLOYMENT_VERSION {Version string for existing embedding deployment}`. If your embeddings deployment is one of the 'text-embedding-3' models, set this to the number 1.
36+
1. This project does *not* use keys when authenticating to Azure OpenAI. However, if your Azure OpenAI service must have key access enabled for some reason (like for use by other projects), then run `azd env set AZURE_OPENAI_DISABLE_KEYS false`. The default value is `true` so you should only run the command if you need key access.
3037

3138
When you run `azd up` after and are prompted to select a value for `openAiResourceGroupLocation`, make sure to select the same location as the existing OpenAI resource group.
3239

infra/main.bicep

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ param azureOpenAiCustomUrl string = ''
5252
param azureOpenAiApiVersion string = ''
5353
@secure()
5454
param azureOpenAiApiKey string = ''
55+
param azureOpenAiDisableKeys bool = true
5556
param openAiServiceName string = ''
5657
param openAiResourceGroupName string = ''
5758

@@ -598,7 +599,7 @@ module openAi 'br/public:avm/res/cognitive-services/account:0.7.2' = if (isAzure
598599
}
599600
sku: openAiSkuName
600601
deployments: openAiDeployments
601-
disableLocalAuth: true
602+
disableLocalAuth: azureOpenAiDisableKeys
602603
}
603604
}
604605

infra/main.parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@
155155
"azureOpenAiApiKey":{
156156
"value": "${AZURE_OPENAI_API_KEY_OVERRIDE}"
157157
},
158+
"azureOpenAiDisableKeys": {
159+
"value": "${AZURE_OPENAI_DISABLE_KEYS=true}"
160+
},
158161
"openAiApiKey": {
159162
"value": "${OPENAI_API_KEY}"
160163
},

0 commit comments

Comments
 (0)