diff --git a/.azdo/pipelines/azure-dev.yml b/.azdo/pipelines/azure-dev.yml index 8c61d4acaf..742724384c 100644 --- a/.azdo/pipelines/azure-dev.yml +++ b/.azdo/pipelines/azure-dev.yml @@ -78,6 +78,7 @@ steps: AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY: $(AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY) AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION: $(AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION) AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU: $(AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU) + AZURE_OPENAI_DISABLE_KEYS: $(AZURE_OPENAI_DISABLE_KEYS) OPENAI_HOST: $(OPENAI_HOST) OPENAI_API_KEY: $(OPENAI_API_KEY) OPENAI_ORGANIZATION: $(OPENAI_ORGANIZATION) diff --git a/.github/workflows/azure-dev.yml b/.github/workflows/azure-dev.yml index a00597828b..a5c4247183 100644 --- a/.github/workflows/azure-dev.yml +++ b/.github/workflows/azure-dev.yml @@ -68,6 +68,7 @@ jobs: AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY }} AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION }} AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU: ${{ vars.AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU }} + AZURE_OPENAI_DISABLE_KEYS: ${{ vars.AZURE_OPENAI_DISABLE_KEYS }} OPENAI_HOST: ${{ vars.OPENAI_HOST }} OPENAI_API_KEY: ${{ vars.OPENAI_API_KEY }} OPENAI_ORGANIZATION: ${{ vars.OPENAI_ORGANIZATION }} diff --git a/azure.yaml b/azure.yaml index d72dc2ff13..d37a0cf27e 100644 --- a/azure.yaml +++ b/azure.yaml @@ -77,6 +77,7 @@ pipeline: - AZURE_OPENAI_GPT4V_DEPLOYMENT_CAPACITY - AZURE_OPENAI_GPT4V_DEPLOYMENT_VERSION - AZURE_OPENAI_GPT4V_DEPLOYMENT_SKU + - AZURE_OPENAI_DISABLE_KEYS - OPENAI_HOST - OPENAI_API_KEY - OPENAI_ORGANIZATION diff --git a/docs/deploy_existing.md b/docs/deploy_existing.md index b43208a69b..0c84e04fbd 100644 --- a/docs/deploy_existing.md +++ b/docs/deploy_existing.md @@ -25,8 +25,15 @@ You should set these values before running `azd up`. Once you've set them, retur 1. Run `azd env set AZURE_OPENAI_SERVICE {Name of existing OpenAI service}` 1. Run `azd env set AZURE_OPENAI_RESOURCE_GROUP {Name of existing resource group that OpenAI service is provisioned to}` -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'. -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'. +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'. +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'. +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. +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. +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'. +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'. +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'. +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. +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. 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. diff --git a/infra/main.bicep b/infra/main.bicep index 5c181cd525..db33d26825 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -52,6 +52,7 @@ param azureOpenAiCustomUrl string = '' param azureOpenAiApiVersion string = '' @secure() param azureOpenAiApiKey string = '' +param azureOpenAiDisableKeys bool = true param openAiServiceName string = '' param openAiResourceGroupName string = '' @@ -598,7 +599,7 @@ module openAi 'br/public:avm/res/cognitive-services/account:0.7.2' = if (isAzure } sku: openAiSkuName deployments: openAiDeployments - disableLocalAuth: true + disableLocalAuth: azureOpenAiDisableKeys } } diff --git a/infra/main.parameters.json b/infra/main.parameters.json index 54541ca8a6..e1444fcec1 100644 --- a/infra/main.parameters.json +++ b/infra/main.parameters.json @@ -155,6 +155,9 @@ "azureOpenAiApiKey":{ "value": "${AZURE_OPENAI_API_KEY_OVERRIDE}" }, + "azureOpenAiDisableKeys": { + "value": "${AZURE_OPENAI_DISABLE_KEYS=true}" + }, "openAiApiKey": { "value": "${OPENAI_API_KEY}" },