Skip to content

Commit 4e83b96

Browse files
Merge pull request #176 from microsoft/dev
ci: Merging dev to main
2 parents 9ce7045 + 9394a93 commit 4e83b96

File tree

4 files changed

+130
-23
lines changed

4 files changed

+130
-23
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
export GPT_MIN_CAPACITY="50"
2525
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
2626
27-
chmod +x deploy/scripts/checkquota.sh
28-
if ! deploy/scripts/checkquota.sh; then
27+
chmod +x infra/scripts/checkquota.sh
28+
if ! infra/scripts/checkquota.sh; then
2929
# If quota check fails due to insufficient quota, set the flag
30-
if grep -q "No region with sufficient quota found" deploy/scripts/checkquota.sh; then
30+
if grep -q "No region with sufficient quota found" infra/scripts/checkquota.sh; then
3131
echo "QUOTA_FAILED=true" >> $GITHUB_ENV
3232
fi
3333
exit 1 # Fail the pipeline if any other failure occurs
@@ -100,7 +100,7 @@ jobs:
100100
set -e
101101
az deployment group create \
102102
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
103-
--template-file deploy/macae.bicep \
103+
--template-file infra/macae.bicep \
104104
--parameters azureOpenAILocation=${{env.AZURE_LOCATION }} cosmosLocation=${{env.AZURE_LOCATION }}
105105
106106
@@ -282,4 +282,4 @@ jobs:
282282
echo "Purged the openai resource: ${{ env.OPENAI_RESOURCE_NAME }}"
283283
fi
284284
285-
echo "Resource purging completed successfully"
285+
echo "Resource purging completed successfully"

azure.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
22
name: multi-agent-custom-automation-engine-solution-accelerator
3+
metadata:
4+
5+
services:
6+
backend:
7+
project: src/backend
8+
host: containerapp
9+
language: python
10+
docker:
11+
context: src/backend
12+
path: Dockerfile
13+
frontend:
14+
project: src/frontend
15+
host: containerapp
16+
language: python
17+
docker:
18+
context: src/frontend
19+
path: Dockerfile
320

infra/main.bicep

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ param azureOpenAILocation string = 'eastus2' // The location used for all deploy
3333
@minLength(3)
3434
@maxLength(20)
3535
@description('Prefix for all resources created by this template. This prefix will be used to create unique names for all resources. The prefix must be unique within the resource group.')
36-
param prefix string
36+
param prefix string = 'macae'
3737

3838
@description('Tags to apply to all deployed resources')
3939
param tags object = {}
@@ -120,6 +120,7 @@ resource aiServices 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' =
120120
apiProperties: {
121121
//statisticsEnabled: false
122122
}
123+
disableLocalAuth: true
123124
}
124125
}
125126

@@ -152,6 +153,10 @@ module kvault 'deploy_keyvault.bicep' = {
152153
scope: resourceGroup(resourceGroup().name)
153154
}
154155

156+
// First, add this section to store the AI Services key in Key Vault
157+
158+
159+
// Then modify the aifoundry module to reference the secret securely
155160
module aifoundry 'deploy_ai_foundry.bicep' = {
156161
name: 'deploy_ai_foundry'
157162
params: {
@@ -197,6 +202,7 @@ resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = {
197202
}
198203
]
199204
capabilities: [{ name: 'EnableServerless' }]
205+
disableLocalAuth: true
200206
}
201207

202208
resource contributorRoleDefinition 'sqlRoleDefinitions' existing = {

infra/main.json

Lines changed: 101 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,55 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.34.44.8038",
9-
"templateHash": "2906892014954666053"
9+
"templateHash": "7719893060553487435"
1010
}
1111
},
1212
"parameters": {
1313
"location": {
1414
"type": "string",
15-
"defaultValue": "EastUS2",
1615
"metadata": {
1716
"description": "Location for all resources."
1817
}
1918
},
2019
"azureOpenAILocation": {
2120
"type": "string",
22-
"defaultValue": "japaneast",
21+
"defaultValue": "eastus2",
22+
"allowedValues": [
23+
"australiaeast",
24+
"brazilsouth",
25+
"canadacentral",
26+
"canadaeast",
27+
"eastus",
28+
"eastus2",
29+
"francecentral",
30+
"germanywestcentral",
31+
"japaneast",
32+
"koreacentral",
33+
"northcentralus",
34+
"norwayeast",
35+
"polandcentral",
36+
"southafricanorth",
37+
"southcentralus",
38+
"southindia",
39+
"swedencentral",
40+
"switzerlandnorth",
41+
"uaenorth",
42+
"uksouth",
43+
"westeurope",
44+
"westus",
45+
"westus3"
46+
],
2347
"metadata": {
24-
"description": "Location for OpenAI resources."
48+
"description": "Location for all Ai services resources. This location can be different from the resource group location."
2549
}
2650
},
2751
"prefix": {
2852
"type": "string",
29-
"defaultValue": "macaeo",
53+
"defaultValue": "macae",
54+
"minLength": 3,
55+
"maxLength": 20,
3056
"metadata": {
31-
"description": "A prefix to add to the start of all resource names. Note: A \"unique\" suffix will also be added"
57+
"description": "Prefix for all resources created by this template. This prefix will be used to create unique names for all resources. The prefix must be unique within the resource group."
3258
}
3359
},
3460
"tags": {
@@ -77,21 +103,21 @@
77103
},
78104
"capacity": {
79105
"type": "int",
80-
"defaultValue": 1
106+
"defaultValue": 140
81107
}
82108
},
83109
"variables": {
84110
"modelVersion": "2024-08-06",
85111
"aiServicesName": "[format('{0}-aiservices', parameters('prefix'))]",
86112
"deploymentType": "GlobalStandard",
87113
"gptModelVersion": "gpt-4o",
88-
"appVersion": "latest",
114+
"appVersion": "fnd01",
89115
"resgistryName": "biabcontainerreg",
90116
"dockerRegistryUrl": "[format('https://{0}.azurecr.io', variables('resgistryName'))]",
91117
"backendDockerImageURL": "[format('{0}.azurecr.io/macaebackend:{1}', variables('resgistryName'), variables('appVersion'))]",
92118
"frontendDockerImageURL": "[format('{0}.azurecr.io/macaefrontend:{1}', variables('resgistryName'), variables('appVersion'))]",
93119
"uniqueNameFormat": "[format('{0}-{{0}}-{1}', parameters('prefix'), uniqueString(resourceGroup().id, parameters('prefix')))]",
94-
"aoaiApiVersion": "2024-08-01-preview",
120+
"aoaiApiVersion": "2025-01-01-preview",
95121
"aiModelDeployments": [
96122
{
97123
"name": "[variables('gptModelVersion')]",
@@ -198,9 +224,8 @@
198224
"kind": "AIServices",
199225
"properties": {
200226
"customSubDomainName": "[variables('aiServicesName')]",
201-
"apiProperties": {
202-
"statisticsEnabled": false
203-
}
227+
"apiProperties": {},
228+
"disableLocalAuth": true
204229
}
205230
},
206231
"aiServicesDeployments": {
@@ -268,7 +293,8 @@
268293
{
269294
"name": "EnableServerless"
270295
}
271-
]
296+
],
297+
"disableLocalAuth": true
272298
}
273299
},
274300
"pullIdentity": {
@@ -377,7 +403,11 @@
377403
},
378404
{
379405
"name": "AZURE_OPENAI_ENDPOINT",
380-
"value": "[reference('aiServices').endpoint]"
406+
"value": "[replace(reference('aiServices').endpoint, 'cognitiveservices.azure.com', 'openai.azure.com')]"
407+
},
408+
{
409+
"name": "AZURE_OPENAI_MODEL_NAME",
410+
"value": "[variables('gptModelVersion')]"
381411
},
382412
{
383413
"name": "AZURE_OPENAI_DEPLOYMENT_NAME",
@@ -388,19 +418,40 @@
388418
"value": "[variables('aoaiApiVersion')]"
389419
},
390420
{
391-
"name": "FRONTEND_SITE_NAME",
392-
"value": "[format('https://{0}.azurewebsites.net', format(variables('uniqueNameFormat'), 'frontend'))]"
421+
"name": "APPLICATIONINSIGHTS_INSTRUMENTATION_KEY",
422+
"value": "[reference('appInsights').InstrumentationKey]"
393423
},
394424
{
395425
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
396426
"value": "[reference('appInsights').ConnectionString]"
427+
},
428+
{
429+
"name": "AZURE_AI_AGENT_PROJECT_CONNECTION_STRING",
430+
"value": "[reference('aifoundry').outputs.projectConnectionString.value]"
431+
},
432+
{
433+
"name": "AZURE_AI_SUBSCRIPTION_ID",
434+
"value": "[subscription().subscriptionId]"
435+
},
436+
{
437+
"name": "AZURE_AI_RESOURCE_GROUP",
438+
"value": "[resourceGroup().name]"
439+
},
440+
{
441+
"name": "AZURE_AI_PROJECT_NAME",
442+
"value": "[reference('aifoundry').outputs.aiProjectName.value]"
443+
},
444+
{
445+
"name": "FRONTEND_SITE_NAME",
446+
"value": "[format('https://{0}.azurewebsites.net', format(variables('uniqueNameFormat'), 'frontend'))]"
397447
}
398448
]
399449
}
400450
]
401451
}
402452
},
403453
"dependsOn": [
454+
"aifoundry",
404455
"aiServices",
405456
"appInsights",
406457
"containerAppEnv",
@@ -457,6 +508,10 @@
457508
{
458509
"name": "BACKEND_API_URL",
459510
"value": "[format('https://{0}', reference('containerApp').configuration.ingress.fqdn)]"
511+
},
512+
{
513+
"name": "AUTH_ENABLED",
514+
"value": "false"
460515
}
461516
]
462517
}
@@ -473,6 +528,31 @@
473528
"pullIdentity"
474529
]
475530
},
531+
"aiHubProject": {
532+
"existing": true,
533+
"type": "Microsoft.MachineLearningServices/workspaces",
534+
"apiVersion": "2024-01-01-preview",
535+
"name": "[format('{0}-aiproject', parameters('prefix'))]"
536+
},
537+
"aiDeveloper": {
538+
"existing": true,
539+
"type": "Microsoft.Authorization/roleDefinitions",
540+
"apiVersion": "2022-04-01",
541+
"name": "64702f94-c441-49e6-a78b-ef80e0188fee"
542+
},
543+
"aiDeveloperAccessProj": {
544+
"type": "Microsoft.Authorization/roleAssignments",
545+
"apiVersion": "2022-04-01",
546+
"scope": "[format('Microsoft.MachineLearningServices/workspaces/{0}', format('{0}-aiproject', parameters('prefix')))]",
547+
"name": "[guid(format('{0}-backend', parameters('prefix')), resourceId('Microsoft.MachineLearningServices/workspaces', format('{0}-aiproject', parameters('prefix'))), resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee'))]",
548+
"properties": {
549+
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee')]",
550+
"principalId": "[reference('containerApp', '2024-03-01', 'full').identity.principalId]"
551+
},
552+
"dependsOn": [
553+
"containerApp"
554+
]
555+
},
476556
"kvault": {
477557
"type": "Microsoft.Resources/deployments",
478558
"apiVersion": "2022-09-01",
@@ -639,7 +719,7 @@
639719
"_generator": {
640720
"name": "bicep",
641721
"version": "0.34.44.8038",
642-
"templateHash": "12550713338937452696"
722+
"templateHash": "8087543237770345715"
643723
}
644724
},
645725
"parameters": {
@@ -988,6 +1068,10 @@
9881068
"storageAccountId": {
9891069
"type": "string",
9901070
"value": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageNameCleaned'))]"
1071+
},
1072+
"projectConnectionString": {
1073+
"type": "string",
1074+
"value": "[format('{0};{1};{2};{3}', split(reference(resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiProjectName')), '2024-01-01-preview').discoveryUrl, '/')[2], subscription().subscriptionId, resourceGroup().name, variables('aiProjectName'))]"
9911075
}
9921076
}
9931077
}

0 commit comments

Comments
 (0)