Skip to content

Commit 7fe5bcb

Browse files
Merge pull request #152 from microsoft/gaiye-avm-waf
refactor: bring the visibility of vmSize to main.bicep
2 parents 8916a7b + ca1e785 commit 7fe5bcb

5 files changed

Lines changed: 23 additions & 3 deletions

File tree

docs/CustomizingAzdParameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ By default this template will use the environment name as the prefix to prevent
1717
| `AZURE_ENV_MODEL_CAPACITY` | integer | `200` | Set the Model Capacity (choose a number based on available GPT model capacity in your subscription). |
1818
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | `<Existing Workspace Id>` | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. |
1919
| `AZURE_ENV_IMAGETAG` | string | `latest` | Set the Image tag Like (allowed values: latest, dev, hotfix) |
20-
20+
| `AZURE_ENV_JUMPBOX_SIZE` | string | `Standard_DS2_v2` | Specifies the size of the Jumpbox Virtual Machine. Set a custom value if `enablePrivateNetworking` is `true`. |
2121
---
2222

2323
## How to Set a Parameter

infra/main.bicep

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ param secondaryLocation string?
6161
@description('Optional. Enable private networking for the resources. Set to true to enable private networking. Defaults to false.')
6262
param enablePrivateNetworking bool = useWafAlignedArchitecture? true : false
6363

64+
@description('Optional. Size of the Jumpbox Virtual Machine when created. Set to custom value if enablePrivateNetworking is true.')
65+
param vmSize string?
66+
6467
@description('Optional. Admin username for the Jumpbox Virtual Machine. Set to custom value if enablePrivateNetworking is true.')
6568
@secure()
6669
//param vmAdminUsername string = take(newGuid(), 20)
@@ -200,13 +203,15 @@ module applicationInsights 'br/public:avm/res/insights/component:0.6.0' = if (en
200203
}
201204
}
202205

206+
203207
module network 'modules/network.bicep' = if (enablePrivateNetworking) {
204208
name: take('network-${resourcesName}-deployment', 64)
205209
params: {
206210
resourcesName: resourcesName
207211
logAnalyticsWorkSpaceResourceId: logAnalyticsWorkspaceResourceId
208212
vmAdminUsername: vmAdminUsername ?? 'JumpboxAdminUser'
209213
vmAdminPassword: vmAdminPassword ?? 'JumpboxAdminP@ssw0rd1234!'
214+
vmSize: vmSize ?? 'Standard_DS2_v2' // Default VM size
210215
location: location
211216
tags: allTags
212217
enableTelemetry: enableTelemetry

infra/main.parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
"secondaryLocation": {
3030
"value": "${AZURE_ENV_COSMOS_SECONDARY_LOCATION}"
3131
},
32+
"vmSize": {
33+
"value": "${AZURE_ENV_JUMPBOX_SIZE}"
34+
},
3235
"vmAdminUsername": {
3336
"value": "${AZURE_ENV_JUMPBOX_ADMIN_USERNAME}"
3437
},

infra/modules/ai-foundry/ai-services.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ resource cognitiveService 'Microsoft.CognitiveServices/accounts@2025-04-01-previ
296296
]
297297
: null
298298
// true is not supported today
299-
encryption: null // Customer managed key encryption is used, but the property is required.
299+
encryption: null // Customer managed key encryption is not used, but the property is required.
300300
migrationToken: migrationToken
301301
restore: restore
302302
restrictOutboundNetworkAccess: restrictOutboundNetworkAccess

infra/modules/network.bicep

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ param vmAdminUsername string
2222
@secure()
2323
param vmAdminPassword string
2424

25+
@description('Required. VM size for the Jumpbox VM.')
26+
param vmSize string
27+
28+
29+
// VM Size Notes:
30+
// 1 B-series VMs (like Standard_B2ms) do not support accelerated networking.
31+
// 2 Pick a VM size that does support accelerated networking (the usual jump-box candidates):
32+
// Standard_DS2_v2 (2 vCPU, 7 GiB RAM, Premium SSD) // The most broadly available (it’s a legacy SKU supported in virtually every region).
33+
// Standard_D2s_v3 (2 vCPU, 8 GiB RAM, Premium SSD) // next most common
34+
// Standard_D2s_v4 (2 vCPU, 8 GiB RAM, Premium SSD) // Newest, so fewer regions availabl
35+
36+
2537
// Subnet Classless Inter-Doman Routing (CIDR) Sizing Reference Table (Best Practices)
2638
// | CIDR | # of Addresses | # of /24s | Notes |
2739
// |-----------|---------------|-----------|----------------------------------------|
@@ -124,7 +136,7 @@ module network 'network/main.bicep' = {
124136
}
125137
jumpboxConfiguration: {
126138
name: 'vm-jumpbox-${resourcesName}'
127-
size: 'Standard_D2s_v3'
139+
size: vmSize
128140
username: vmAdminUsername
129141
password: vmAdminPassword
130142
subnet: {

0 commit comments

Comments
 (0)