-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Add AOAI resource group to use existing AOAI service #132
Comments
Hi @cynthiajiangatl - I've never run into any deployment errors when deploying with my AOAI resource in a different RG. The I'm not sure this is needed? |
@cynthiajiangatl |
I was deploying it from an AML compute instance. Yes, it is Linux. |
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: