Skip to content

Commit 0e9dad4

Browse files
Merge pull request #220 from microsoft/dev
feat: added the WAF support like other templates
2 parents c3654f3 + 4955540 commit 0e9dad4

4 files changed

Lines changed: 129 additions & 22 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
aiDeploymentsLocation="eastus" \
136136
useWafAlignedArchitecture=false \
137137
capacity=${{ env.GPT_MIN_CAPACITY }} \
138-
imageVersion="${IMAGE_TAG}" \
138+
imageVersion="${IMAGE_TAG}"\
139139
createdBy="Pipeline"
140140
- name: Assign Contributor role to Service Principal
141141
if: always()

docs/DeploymentGuide.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,18 @@ Check the [Azure Products by Region](https://azure.microsoft.com/en-us/explore/g
3333

3434
### Sandbox or WAF Aligned Deployment Options
3535

36-
The [`infra`](../infra) folder contains the [`main.bicep`](../infra/main.bicep) Bicep script, which defines all Azure infrastructure components for this solution.
36+
The [`infra`](../infra) folder of the Multi Agent Solution Accelerator contains the [`main.bicep`](../infra/main.bicep) Bicep script, which defines all Azure infrastructure components for this solution.
3737

38-
When running `azd up`, you’ll now be prompted to choose between a **WAF-aligned configuration** and a **sandbox configuration** using a simple selection:
38+
By default, the `azd up` command uses the [`main.parameters.json`](../infra/main.parameters.json) file to deploy the solution. This file is pre-configured for a **sandbox environment** — ideal for development and proof-of-concept scenarios, with minimal security and cost controls for rapid iteration.
3939

40-
- A **sandbox environment** — ideal for development and proof-of-concept scenarios, with minimal security and cost controls for rapid iteration.
41-
42-
- A **production deployments environment**, which applies a [Well-Architected Framework (WAF) aligned](https://learn.microsoft.com/en-us/azure/well-architected/) configuration. This option enables additional Azure best practices for reliability, security, cost optimization, operational excellence, and performance efficiency, such as:
43-
- Enhanced network security (e.g., Network protection with private endpoints)
44-
- Stricter access controls and managed identities
45-
- Logging, monitoring, and diagnostics enabled by default
46-
- Resource tagging and cost management recommendations
40+
For **production deployments**, the repository also provides [`main.waf.parameters.json`](../infra/main.waf.parameters.json), which applies a [Well-Architected Framework (WAF) aligned](https://learn.microsoft.com/en-us/azure/well-architected/) configuration. This option enables additional Azure best practices for reliability, security, cost optimization, operational excellence, and performance efficiency, such as:
4741

4842
**How to choose your deployment configuration:**
4943

50-
When prompted during `azd up`:
44+
* Use the default `main.parameters.json` file for a **sandbox/dev environment**
45+
* For a **WAF-aligned, production-ready deployment**, copy the contents of `main.waf.parameters.json` into `main.parameters.json` before running `azd up`
5146

52-
![useWAFAlignedArchitecture](images/macae_waf_prompt.png)
5347

54-
- Select **`true`** to deploy a **WAF-aligned, production-ready environment**
55-
- Select **`false`** to deploy a **lightweight sandbox/dev environment**
56-
5748
> [!TIP]
5849
> Always review and adjust parameter values (such as region, capacity, security settings and log analytics workspace configuration) to match your organization’s requirements before deploying. For production, ensure you have sufficient quota and follow the principle of least privilege for all identities and role assignments.
5950

infra/main.bicep

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ metadata name = 'Modernize Your Code Solution Accelerator'
22
metadata description = '''CSA CTO Gold Standard Solution Accelerator for Modernize Your Code.
33
'''
44

5-
@description('Set to true if you want to deploy WAF-aligned infrastructure.')
6-
param useWafAlignedArchitecture bool
75

86
@minLength(3)
97
@maxLength(16)
@@ -47,10 +45,10 @@ param aiDeploymentsLocation string
4745
param capacity int = 150
4846

4947
@description('Optional. Enable monitoring for the resources. This will enable Application Insights and Log Analytics. Defaults to false.')
50-
param enableMonitoring bool = useWafAlignedArchitecture? true : false
48+
param enableMonitoring bool = false
5149

5250
@description('Optional. Enable scaling for the container apps. Defaults to false.')
53-
param enableScaling bool = useWafAlignedArchitecture? true : false
51+
param enableScaling bool = false
5452

5553
@description('Optional. Enable redundancy for applicable resources. Defaults to false.')
5654
param enableRedundancy bool = false
@@ -59,7 +57,7 @@ param enableRedundancy bool = false
5957
param secondaryLocation string?
6058

6159
@description('Optional. Enable private networking for the resources. Set to true to enable private networking. Defaults to false.')
62-
param enablePrivateNetworking bool = useWafAlignedArchitecture? true : false
60+
param enablePrivateNetworking bool = false
6361

6462
@description('Optional. Size of the Jumpbox Virtual Machine when created. Set to custom value if enablePrivateNetworking is true.')
6563
param vmSize string?
@@ -134,8 +132,9 @@ var modelDeployment = {
134132

135133
var abbrs = loadJsonContent('./abbreviations.json')
136134

137-
@description('Optional created by user name')
138-
param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0]
135+
@description('Tag, Created by user name')
136+
param createdBy string = contains(deployer(), 'userPrincipalName')? split(deployer().userPrincipalName, '@')[0]: deployer().objectId
137+
139138

140139
// ========== Resource Group Tag ========== //
141140
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {

infra/main.waf.parameters.json

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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+
"deploymentType": {
12+
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
13+
},
14+
"llmModel": {
15+
"value": "${AZURE_ENV_MODEL_NAME}"
16+
},
17+
"capacity": {
18+
"value": "${AZURE_ENV_MODEL_CAPACITY}"
19+
},
20+
"gptModelVersion": {
21+
"value": "${AZURE_ENV_MODEL_VERSION}"
22+
},
23+
"imageVersion": {
24+
"value": "${AZURE_ENV_IMAGETAG=latest}"
25+
},
26+
"existingLogAnalyticsWorkspaceId": {
27+
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
28+
},
29+
"azureExistingAIProjectResourceId": {
30+
"value": "${AZURE_EXISTING_AI_PROJECT_RESOURCE_ID}"
31+
},
32+
"secondaryLocation": {
33+
"value": "${AZURE_ENV_COSMOS_SECONDARY_LOCATION}"
34+
},
35+
"vmSize": {
36+
"value": "${AZURE_ENV_JUMPBOX_SIZE}"
37+
},
38+
"vmAdminUsername": {
39+
"value": "${AZURE_ENV_JUMPBOX_ADMIN_USERNAME}"
40+
},
41+
"vmAdminPassword": {
42+
"value": "${AZURE_ENV_JUMPBOX_ADMIN_PASSWORD}"
43+
},
44+
"backendExists": {
45+
"value": "${SERVICE_BACKEND_RESOURCE_EXISTS=false}"
46+
},
47+
"enableMonitoring": {
48+
"value": true
49+
},
50+
"enablePrivateNetworking": {
51+
"value": true
52+
},
53+
"enableScaling": {
54+
"value": true
55+
},
56+
"backendDefinition": {
57+
"value": {
58+
"settings": [
59+
{
60+
"name": "",
61+
"value": "${VAR}",
62+
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
63+
"_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."
64+
},
65+
{
66+
"name": "",
67+
"value": "${VAR_S}",
68+
"secret": true,
69+
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
70+
"_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."
71+
}
72+
]
73+
}
74+
},
75+
"frontendExists": {
76+
"value": "${SERVICE_FRONTEND_RESOURCE_EXISTS=false}"
77+
},
78+
"frontendDefinition": {
79+
"value": {
80+
"settings": [
81+
{
82+
"name": "",
83+
"value": "${VAR}",
84+
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
85+
"_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."
86+
},
87+
{
88+
"name": "",
89+
"value": "${VAR_S}",
90+
"secret": true,
91+
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
92+
"_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."
93+
}
94+
]
95+
}
96+
},
97+
"principalId": {
98+
"value": "${AZURE_PRINCIPAL_ID}"
99+
},
100+
"aiModelDeployments": {
101+
"value": [
102+
{
103+
"name": "gpt-4o",
104+
"model": {
105+
"name": "gpt-4o",
106+
"version": "2024-08-06",
107+
"format": "OpenAI"
108+
},
109+
"sku": {
110+
"name": "GlobalStandard",
111+
"capacity": 50
112+
}
113+
}
114+
]
115+
}
116+
}
117+
}

0 commit comments

Comments
 (0)