Skip to content

Commit fcb5815

Browse files
committed
main.bicep now has params: vmAdminUsername and vmAdminPassword
1 parent 1386275 commit fcb5815

4 files changed

Lines changed: 37 additions & 4 deletions

File tree

infra/main.bicep

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ param secondaryLocation string?
5757
@description('Optional. Enable private networking for the resources. Set to true to enable private networking. Defaults to false.')
5858
param enablePrivateNetworking bool = false
5959

60+
@description('Optional. Admin username for the Jumpbox Virtual Machine. Set to custom value if enablePrivateNetworking is true.')
61+
@secure()
62+
param vmAdminUsername string
63+
64+
@description('Optional. Admin password for the Jumpbox Virtual Machine. Set to custom value if enablePrivateNetworking is true.')
65+
@secure()
66+
param vmAdminPassword string
67+
6068
@description('Optional. Specifies the resource tags for all the resources. Tag "azd-env-name" is automatically added to all resources.')
6169
param tags object = {}
6270

@@ -133,6 +141,8 @@ module network 'modules/network.bicep' = if (enablePrivateNetworking) {
133141
params: {
134142
resourcesName: resourcesName
135143
logAnalyticsWorkSpaceResourceId: logAnalyticsWorkspace.outputs.resourceId
144+
vmAdminUsername: vmAdminUsername
145+
vmAdminPassword: vmAdminPassword
136146
location: location
137147
tags: allTags
138148
enableTelemetry: enableTelemetry

infra/main.bicepparam

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ param enableScaling = true
1212
param enableRedundancy = true
1313
//param secondaryLocation = 'uksouth' // TODO - test this
1414
param enablePrivateNetworking = true
15+
param vmAdminUsername = 'JumpboxAdminUser'
16+
param vmAdminPassword = 'JumpboxAdminP@ssw0rd1234!'

infra/modules/network.bicep

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ param tags object = {}
1414
@description('Optional. Enable/Disable usage telemetry for module.')
1515
param enableTelemetry bool = true
1616

17+
@description('Admin username for the VM.')
18+
@secure()
19+
param vmAdminUsername string
20+
21+
@description('Admin password for the VM.')
22+
@secure()
23+
param vmAdminPassword string
24+
25+
26+
27+
28+
1729
// Subnet Classless Inter-Doman Routing (CIDR) Sizing Reference Table (Best Practices)
1830
// | CIDR | # of Addresses | # of /24s | Notes |
1931
// |-----------|---------------|-----------|----------------------------------------|
@@ -91,8 +103,8 @@ module network 'network/main.bicep' = {
91103
jumpboxConfiguration: {
92104
name: 'vm-jumpbox-${resourcesName}'
93105
size: 'Standard_D2s_v3'
94-
username: 'JumpboxAdminUser'
95-
password: 'JumpboxAdminP@ssw0rd1234!'
106+
username: vmAdminUsername
107+
password: vmAdminPassword
96108
subnet: {
97109
name: 'jumpbox'
98110
addressPrefixes: ['10.0.12.0/23'] // /23 (10.0.12.0 - 10.0.13.255), 512 addresses

infra/samples/network-subnet-design.bicep

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ param enableTelemetry bool = true
3030
@description('Optional. Tags to be applied to the resources.')
3131
param tags object = {}
3232

33+
@description('Admin username for the VM.')
34+
@secure()
35+
param vmAdminUsername string = 'JumpboxAdminUser'
36+
37+
@description('Admin password for the VM.')
38+
@secure()
39+
param vmAdminPassword string = 'JumpboxAdminP@ssw0rd1234!'
40+
41+
3342
import { bastionHostConfigurationType } from '../modules/network/bastionHost.bicep'
3443
@description('Optional. Configuration for the Azure Bastion Host. Leave null to omit Bastion creation.')
3544
param bastionConfiguration bastionHostConfigurationType = {
@@ -42,8 +51,8 @@ import { jumpBoxConfigurationType } from '../modules/network/jumpbox.bicep'
4251
param jumpboxConfiguration jumpBoxConfigurationType = {
4352
name: 'vm-jumpbox-${resourcesName}'
4453
size: 'Standard_D2s_v3' // Default size, can be overridden
45-
username: 'JumpboxAdminUser'
46-
password: 'JumpboxAdminP@ssw0rd1234!'
54+
username: vmAdminUsername
55+
password: vmAdminPassword
4756
subnet: {
4857
name: 'jumpbox-subnet'
4958
addressPrefixes: ['10.0.12.0/23'] // /23 (10.0.12.0 - 10.0.13.255), 512 addresses

0 commit comments

Comments
 (0)