From b39d2ff8152d89e16e43a8f5f3123d42661a6860 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Tue, 7 Jan 2025 12:28:29 +0200 Subject: [PATCH] Add OpenAI subscription parameter to deployment configuration --- infra/deploy.parameters.json | 3 ++- infra/deploy.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/infra/deploy.parameters.json b/infra/deploy.parameters.json index f2409b87..9f6372aa 100644 --- a/infra/deploy.parameters.json +++ b/infra/deploy.parameters.json @@ -1,4 +1,5 @@ { + "GRAPHRAG_OPENAI_SUBSCRIPTION": "__GRAPHRAG_OPENAI_SUBSCRIPTION__", "GRAPHRAG_API_BASE": "__GRAPHRAG_API_BASE__", "GRAPHRAG_API_VERSION": "__GRAPHRAG_API_VERSION__", "GRAPHRAG_EMBEDDING_DEPLOYMENT_NAME": "__GRAPHRAG_EMBEDDING_DEPLOYMENT_NAME__", @@ -7,4 +8,4 @@ "GRAPHRAG_LLM_MODEL": "__GRAPHRAG_LLM_MODEL__", "LOCATION": "__LOCATION__", "RESOURCE_GROUP": "__RESOURCE_GROUP__" -} \ No newline at end of file +} diff --git a/infra/deploy.sh b/infra/deploy.sh index 888c7589..72bc14e4 100755 --- a/infra/deploy.sh +++ b/infra/deploy.sh @@ -419,7 +419,7 @@ assignAOAIRoleToManagedIdentity() { printf "Assigning 'Cognitive Services OpenAI Contributor' role to managed identity... " local servicePrincipalId=$(jq -r .azure_workload_identity_principal_id.value <<< $AZURE_OUTPUTS) exitIfValueEmpty "$servicePrincipalId" "Unable to parse service principal id from azure outputs, exiting..." - local scope=$(az cognitiveservices account list --query "[?contains(properties.endpoint, '$GRAPHRAG_API_BASE')] | [0].id" -o tsv) + local scope=$(az cognitiveservices account list --subscription $GRAPHRAG_OPENAI_SUBSCRIPTION --query "[?contains(properties.endpoint, '$GRAPHRAG_API_BASE')] | [0].id" -o tsv) az role assignment create --only-show-errors \ --role "Cognitive Services OpenAI Contributor" \ --assignee "$servicePrincipalId" \