Skip to content

Commit 25279cf

Browse files
Merge pull request microsoft#416 from microsoft/infra-avm-waf
refactor: Merging the AVM Waf Standard changes to dev branch
2 parents 2263377 + ff8f26e commit 25279cf

39 files changed

+3598
-1315
lines changed

.github/workflows/deploy-waf.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ jobs:
109109
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
110110
--template-file infra/main.bicep \
111111
--parameters \
112-
environmentName=${{ env.SOLUTION_PREFIX }} \
113-
useWafAlignedArchitecture=true \
114-
aiDeploymentsLocation='${{ env.AZURE_LOCATION }}' \
112+
solutionName=${{ env.SOLUTION_PREFIX }} \
113+
location="${{ env.AZURE_LOCATION }}" \
114+
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
115115
gptModelCapacity=5 \
116-
virtualMachineConfiguration='{"adminUsername": "adminuser", "adminPassword": "P@ssw0rd1234"}' \
117-
logAnalyticsWorkspaceConfiguration='{"existingWorkspaceResourceId": ""}'
118-
116+
enableTelemetry=true \
117+
enableMonitoring=true \
118+
enablePrivateNetworking=true \
119+
enableScalability=true \
120+
119121
120122
- name: Send Notification on Failure
121123
if: failure()

.github/workflows/deploy.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,14 @@ jobs:
129129
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
130130
--template-file infra/main.bicep \
131131
--parameters \
132-
environmentName=${{ env.SOLUTION_PREFIX }} \
133-
solutionLocation="${{ env.AZURE_LOCATION }}" \
134-
modelDeploymentType="GlobalStandard" \
132+
solutionName=${{ env.SOLUTION_PREFIX }} \
133+
location="${{ env.AZURE_LOCATION }}" \
134+
gptModelDeploymentType="GlobalStandard" \
135135
gptModelName="gpt-4o" \
136136
gptModelVersion="2024-08-06" \
137137
imageTag="${IMAGE_TAG}" \
138-
useWafAlignedArchitecture=false \
139-
aiDeploymentsLocation='${{ env.AZURE_LOCATION }}' \
138+
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
140139
gptModelCapacity=150 \
141-
logAnalyticsWorkspaceConfiguration='{"dataRetentionInDays": 30, "existingWorkspaceResourceId": ""}' \
142-
applicationInsightsConfiguration='{"retentionInDays": 30}' \
143-
virtualNetworkConfiguration='{"enabled": false}' \
144-
webServerFarmConfiguration='{"skuCapacity": 1, "skuName": "B2"}' \
145140
--output json
146141
147142
- name: Extract Web App and API App URLs

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,3 +458,7 @@ __pycache__/
458458
*.whl
459459
.azure
460460
.github/copilot-instructions.md
461+
462+
# Bicep local files
463+
*.local*.bicepparam
464+
*.local*.parameters.json

infra/main.bicep

Lines changed: 961 additions & 1197 deletions
Large diffs are not rendered by default.

infra/main.parameters.json

Lines changed: 38 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,42 @@
11
{
2-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3-
"contentVersion": "1.0.0.0",
4-
"parameters": {
5-
"aiModelDeployments": {
6-
"value": [
7-
{
8-
"name": "gpt",
9-
"model": {
10-
"name": "gpt-4o",
11-
"version": "2024-08-06",
12-
"format": "OpenAI"
13-
},
14-
"sku": {
15-
"name": "GlobalStandard",
16-
"capacity": 140
17-
}
18-
}
19-
]
20-
},
21-
"environmentName": {
22-
"value": "${AZURE_ENV_NAME}"
23-
},
24-
"solutionLocation": {
25-
"value": "${AZURE_LOCATION}"
26-
},
27-
"aiDeploymentsLocation": {
28-
"value": "${AZURE_ENV_OPENAI_LOCATION}"
29-
},
30-
"modelDeploymentType": {
31-
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
32-
},
33-
"gptModelName": {
34-
"value": "${AZURE_ENV_MODEL_NAME}"
35-
},
36-
"gptModelVersion": {
37-
"value": "${AZURE_ENV_MODEL_VERSION}"
38-
},
39-
"gptModelCapacity": {
40-
"value": "${AZURE_ENV_MODEL_CAPACITY}"
41-
},
42-
"existingFoundryProjectResourceId": {
43-
"value": "${AZURE_ENV_FOUNDRY_PROJECT_ID}"
44-
},
45-
"imageTag": {
46-
"value": "${AZURE_ENV_IMAGE_TAG}"
47-
},
48-
"enableTelemetry": {
49-
"value": "${AZURE_ENV_ENABLE_TELEMETRY}"
50-
},
51-
"existingLogAnalyticsWorkspaceId": {
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"solutionName": {
6+
"value": "${AZURE_ENV_NAME}"
7+
},
8+
"location": {
9+
"value": "${AZURE_LOCATION}"
10+
},
11+
"azureAiServiceLocation": {
12+
"value": "${AZURE_ENV_OPENAI_LOCATION}"
13+
},
14+
"gptModelDeploymentType": {
15+
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
16+
},
17+
"gptModelName": {
18+
"value": "${AZURE_ENV_MODEL_NAME}"
19+
},
20+
"gptModelVersion": {
21+
"value": "${AZURE_ENV_MODEL_VERSION}"
22+
},
23+
"gptModelCapacity": {
24+
"value": "${AZURE_ENV_MODEL_CAPACITY}"
25+
},
26+
"backendContainerImageTag": {
27+
"value": "${AZURE_ENV_IMAGE_TAG}"
28+
},
29+
"frontendContainerImageTag": {
30+
"value": "${AZURE_ENV_IMAGE_TAG}"
31+
},
32+
"enableTelemetry": {
33+
"value": "${AZURE_ENV_ENABLE_TELEMETRY}"
34+
},
35+
"existingLogAnalyticsWorkspaceId": {
5236
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
53-
},
54-
"backendExists": {
55-
"value": "${SERVICE_BACKEND_RESOURCE_EXISTS=false}"
56-
},
57-
"backendDefinition": {
58-
"value": {
59-
"settings": [
60-
{
61-
"name": "",
62-
"value": "${VAR}",
63-
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
64-
"_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR} to use the value of 'VAR' from the current environment."
65-
},
66-
{
67-
"name": "",
68-
"value": "${VAR_S}",
69-
"secret": true,
70-
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
71-
"_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR_S} to use the value of 'VAR_S' from the current environment."
72-
}
73-
]
74-
}
75-
},
76-
"frontendExists": {
77-
"value": "${SERVICE_FRONTEND_RESOURCE_EXISTS=false}"
78-
},
79-
"frontendDefinition": {
80-
"value": {
81-
"settings": [
82-
{
83-
"name": "",
84-
"value": "${VAR}",
85-
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
86-
"_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR} to use the value of 'VAR' from the current environment."
87-
},
88-
{
89-
"name": "",
90-
"value": "${VAR_S}",
91-
"secret": true,
92-
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
93-
"_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR_S} to use the value of 'VAR_S' from the current environment."
94-
}
95-
]
96-
}
97-
},
98-
"principalId": {
99-
"value": "${AZURE_PRINCIPAL_ID}"
100-
}
37+
},
38+
"existingAiFoundryAiProjectResourceId": {
39+
"value": "${AZURE_ENV_FOUNDRY_PROJECT_ID}"
10140
}
41+
}
10242
}

infra/main.waf.parameters.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"solutionName": {
6+
"value": "${AZURE_ENV_NAME}"
7+
},
8+
"location": {
9+
"value": "${AZURE_LOCATION}"
10+
},
11+
"azureAiServiceLocation": {
12+
"value": "${AZURE_ENV_OPENAI_LOCATION}"
13+
},
14+
"gptModelDeploymentType": {
15+
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
16+
},
17+
"gptModelName": {
18+
"value": "${AZURE_ENV_MODEL_NAME}"
19+
},
20+
"gptModelVersion": {
21+
"value": "${AZURE_ENV_MODEL_VERSION}"
22+
},
23+
"gptModelCapacity": {
24+
"value": "${AZURE_ENV_MODEL_CAPACITY}"
25+
},
26+
"backendContainerImageTag": {
27+
"value": "${AZURE_ENV_IMAGE_TAG}"
28+
},
29+
"frontendContainerImageTag": {
30+
"value": "${AZURE_ENV_IMAGE_TAG}"
31+
},
32+
"enableTelemetry": {
33+
"value": "${AZURE_ENV_ENABLE_TELEMETRY}"
34+
},
35+
"enableMonitoring": {
36+
"value": true
37+
},
38+
"enablePrivateNetworking": {
39+
"value": true
40+
},
41+
"enableScalability": {
42+
"value": true
43+
},
44+
"virtualMachineAdminUsername": {
45+
"value": "${AZURE_ENV_VM_ADMIN_USERNAME}"
46+
},
47+
"virtualMachineAdminPassword": {
48+
"value": "${AZURE_ENV_VM_ADMIN_PASSWORD}"
49+
},
50+
"existingLogAnalyticsWorkspaceId": {
51+
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
52+
},
53+
"existingAiFoundryAiProjectResourceId": {
54+
"value": "${AZURE_ENV_FOUNDRY_PROJECT_ID}"
55+
}
56+
}
57+
}

infra/modules/ai-project.bicep

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@description('Required. Name of the AI Services project.')
2+
param name string
3+
4+
@description('Required. The location of the Project resource.')
5+
param location string = resourceGroup().location
6+
7+
@description('Optional. The description of the AI Foundry project to create. Defaults to the project name.')
8+
param desc string = name
9+
10+
@description('Required. Name of the existing Cognitive Services resource to create the AI Foundry project in.')
11+
param aiServicesName string
12+
13+
@description('Optional. Tags to be applied to the resources.')
14+
param tags object = {}
15+
16+
// Reference to cognitive service in current resource group for new projects
17+
resource cogServiceReference 'Microsoft.CognitiveServices/accounts@2025-06-01' existing = {
18+
name: aiServicesName
19+
}
20+
21+
resource aiProject 'Microsoft.CognitiveServices/accounts/projects@2025-06-01' = {
22+
parent: cogServiceReference
23+
name: name
24+
tags: tags
25+
location: location
26+
identity: {
27+
type: 'SystemAssigned'
28+
}
29+
properties: {
30+
description: desc
31+
displayName: name
32+
}
33+
}
34+
35+
@description('Required. Name of the AI project.')
36+
output name string = aiProject.name
37+
38+
@description('Required. Resource ID of the AI project.')
39+
output resourceId string = aiProject.id
40+
41+
@description('Required. API endpoint for the AI project.')
42+
output apiEndpoint string = aiProject!.properties.endpoints['AI Foundry API']

0 commit comments

Comments
 (0)