Skip to content

Commit 9c2983c

Browse files
Merge pull request microsoft#421 from microsoft/infra-avm-waf
fix: update README and align Data Collection Rule location with workspace
2 parents 9e7cd5a + b3c771f commit 9c2983c

File tree

5 files changed

+51
-20
lines changed

5 files changed

+51
-20
lines changed

docs/CustomizingAzdParameters.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ By default this template will use the environment name as the prefix to prevent
1919
| `AZURE_ENV_IMAGETAG` | string | `latest` | Docker image tag used for container deployments. |
2020
| `AZURE_ENV_ENABLE_TELEMETRY` | bool | `true` | Enables telemetry for monitoring and diagnostics. |
2121
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | Guide to get your [Existing Workspace ID](/docs/re-use-log-analytics.md) | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. |
22+
| `AZURE_ENV_VM_ADMIN_USERNAME` | string | `take(newGuid(), 20)` | The administrator username for the virtual machine. |
23+
| `AZURE_ENV_VM_ADMIN_PASSWORD` | string | `newGuid()` | The administrator password for the virtual machine. |
2224
---
2325

2426
## How to Set a Parameter

docs/DeploymentGuide.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,42 +26,68 @@ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
2626

2727
This will allow the scripts to run for the current session without permanently changing your system's policy.
2828

29+
### **Azure Developer CLI (azd) Requirement**
30+
31+
Ensure that you are using the latest version of the [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/overview).
32+
The `azd` version must be **1.18.0 or higher**.
33+
34+
Upgrade commands by OS:
35+
36+
* **Windows (using winget):**
37+
38+
```bash
39+
winget install microsoft.azd
40+
```
41+
42+
* **Linux (using apt):**
43+
44+
```bash
45+
curl -fsSL https://aka.ms/install-azd.sh | bash
46+
```
47+
48+
* **macOS (using Homebrew):**
49+
50+
```bash
51+
brew update && brew tap azure/azd && brew install azd
52+
```
53+
2954
## Deployment Options & Steps
3055

3156
### Sandbox or WAF Aligned Deployment Options
3257

3358
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.
3459

35-
When running `azd up`, you’ll now be prompted to choose between a **WAF-aligned configuration** and a **sandbox configuration** using a simple selection:
60+
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.
3661

37-
- A **sandbox environment** — ideal for development and proof-of-concept scenarios, with minimal security and cost controls for rapid iteration.
62+
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:
3863

39-
- 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:
4064
- Enhanced network security (e.g., Network protection with private endpoints)
4165
- Stricter access controls and managed identities
4266
- Logging, monitoring, and diagnostics enabled by default
4367
- Resource tagging and cost management recommendations
4468

4569
**How to choose your deployment configuration:**
4670

47-
When prompted during `azd up`:
71+
* Use the default `main.parameters.json` file for a **sandbox/dev environment**
72+
* For a **WAF-aligned, production-ready deployment**, copy the contents of `main.waf.parameters.json` into `main.parameters.json` before running `azd up`
73+
74+
---
4875

49-
![useWAFAlignedArchitecture](images/macae_waf_prompt.png)
76+
### VM Credentials Configuration
5077

51-
- Select **`true`** to deploy a **WAF-aligned, production-ready environment**
52-
- Select **`false`** to deploy a **lightweight sandbox/dev environment**
78+
By default, the solution sets the VM administrator username and password from environment variables.
79+
If you do not configure these values, a randomly generated GUID will be used for both the username and password.
80+
81+
To set your own VM credentials before deployment, use:
82+
83+
```sh
84+
azd env set AZURE_ENV_VM_ADMIN_USERNAME <your-username>
85+
azd env set AZURE_ENV_VM_ADMIN_PASSWORD <your-password>
86+
```
5387

5488
> [!TIP]
5589
> 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.
5690
57-
> To reuse an existing Log Analytics workspace, update the existingWorkspaceResourceId field under the logAnalyticsWorkspaceConfiguration parameter in the .bicep file with the resource ID of your existing workspace.
58-
For example:
59-
```
60-
param logAnalyticsWorkspaceConfiguration = {
61-
dataRetentionInDays: 30
62-
existingWorkspaceResourceId: '/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.OperationalInsights/workspaces/<workspace-name>'
63-
}
64-
```
6591

6692
> [!IMPORTANT]
6793
> The WAF-aligned configuration is under active development. More Azure Well-Architected recommendations will be added in future updates.

infra/main.bicep

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,13 +709,16 @@ module maintenanceConfiguration 'br/public:avm/res/maintenance/maintenance-confi
709709
}
710710

711711
var dataCollectionRulesResourceName = 'dcr-${solutionSuffix}'
712+
var dataCollectionRulesLocation = useExistingLogAnalytics
713+
? existingLogAnalyticsWorkspace!.location
714+
: logAnalyticsWorkspace!.outputs.location
712715
module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-rule:0.6.1' = if (enablePrivateNetworking && enableMonitoring) {
713716
name: take('avm.res.insights.data-collection-rule.${dataCollectionRulesResourceName}', 64)
714717
params: {
715718
name: dataCollectionRulesResourceName
716719
tags: tags
717720
enableTelemetry: enableTelemetry
718-
location: location
721+
location: dataCollectionRulesLocation
719722
dataCollectionRuleProperties: {
720723
kind: 'Windows'
721724
dataSources: {

infra/main.parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"value": "${AZURE_ENV_MODEL_CAPACITY}"
2525
},
2626
"backendContainerImageTag": {
27-
"value": "${AZURE_ENV_IMAGE_TAG}"
27+
"value": "${AZURE_ENV_IMAGE_TAG=latest}"
2828
},
2929
"frontendContainerImageTag": {
30-
"value": "${AZURE_ENV_IMAGE_TAG}"
30+
"value": "${AZURE_ENV_IMAGE_TAG=latest}"
3131
},
3232
"enableTelemetry": {
3333
"value": "${AZURE_ENV_ENABLE_TELEMETRY}"

infra/main.waf.parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"value": "${AZURE_ENV_MODEL_CAPACITY}"
2525
},
2626
"backendContainerImageTag": {
27-
"value": "${AZURE_ENV_IMAGE_TAG}"
27+
"value": "${AZURE_ENV_IMAGE_TAG=latest}"
2828
},
2929
"frontendContainerImageTag": {
30-
"value": "${AZURE_ENV_IMAGE_TAG}"
30+
"value": "${AZURE_ENV_IMAGE_TAG=latest}"
3131
},
3232
"enableTelemetry": {
3333
"value": "${AZURE_ENV_ENABLE_TELEMETRY}"

0 commit comments

Comments
 (0)