You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need to add resource group for AOAI service to avoid deployment errors.
For existing Azure OpenAI service, it may not be in the newly created resource group, needs to add AOAI_RESOURCE_GROUP in deploy.parameters.json and update the deploy.sh in a couple of places.
deployAzureResources () {
echo "Deploying Azure resources..."
local SSH_PUBLICKEY=$(jq -r .publicKey <<< $SSHKEY_DETAILS)
exitIfValueEmpty "$SSH_PUBLICKEY" "Unable to read ssh publickey, exiting..."
local aoaiName=$(az cognitiveservices account list -g $AOAI_RESOURCE_GROUP --query "[?contains(properties.endpoint, '$GRAPHRAG_API_BASE')] | [0].name" -o tsv)
exitIfValueEmpty "$aoaiName" "Unable to retrieve AOAI name from GRAPHRAG_API_BASE, exiting..."
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 -g $AOAI_RESOURCE_GROUP --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"
--scope "$scope" > /dev/null 2>&1
exitIfCommandFailed $? "Error assigning role to service principal, exiting..."
printf "Done.\n"
}
The text was updated successfully, but these errors were encountered:
cynthiajiangatl
changed the title
[FEATURE] Need to add AOAI resource group to use existing AOAI service
[FEATURE] Add AOAI resource group to use existing AOAI service
Aug 9, 2024
For me all works fine, BUT: why do the azure open ai resource (and its models) have to be created (deployed) in advance? Why are they not part of the general deployment code (i.e. main.bicep and deploy.sh). I am just asking to get a better understanding here ...
Need to add resource group for AOAI service to avoid deployment errors.
For existing Azure OpenAI service, it may not be in the newly created resource group, needs to add AOAI_RESOURCE_GROUP in deploy.parameters.json and update the deploy.sh in a couple of places.
requiredParams=(
LOCATION
GRAPHRAG_API_BASE
GRAPHRAG_API_VERSION
GRAPHRAG_LLM_MODEL
GRAPHRAG_LLM_DEPLOYMENT_NAME
GRAPHRAG_EMBEDDING_MODEL
GRAPHRAG_EMBEDDING_DEPLOYMENT_NAME
RESOURCE_GROUP
AOAI_RESOURCE_GROUP
)
deployAzureResources () {
echo "Deploying Azure resources..."
local SSH_PUBLICKEY=$(jq -r .publicKey <<< $SSHKEY_DETAILS)
exitIfValueEmpty "$SSH_PUBLICKEY" "Unable to read ssh publickey, exiting..."
local aoaiName=$(az cognitiveservices account list -g $AOAI_RESOURCE_GROUP --query "[?contains(properties.endpoint, '$GRAPHRAG_API_BASE')] | [0].name" -o tsv)
exitIfValueEmpty "$aoaiName" "Unable to retrieve AOAI name from GRAPHRAG_API_BASE, exiting..."
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 -g $AOAI_RESOURCE_GROUP --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"
--scope "$scope" > /dev/null 2>&1
exitIfCommandFailed $? "Error assigning role to service principal, exiting..."
printf "Done.\n"
}
The text was updated successfully, but these errors were encountered: