Skip to content

Commit 9c8071b

Browse files
fix: remove hardcoded VM admin password and update credential docs
- Remove hardcoded default password from vmAdminPassword parameter in main.bicepparam to prevent known credentials from being deployed unintentionally. The parameter now defaults to an empty string, requiring users to set VM_ADMIN_PASSWORD via azd env set. - Update deployment guide to remove guidance that encouraged committing VM credentials to source control. Replaced with security warning recommending azd env set, secrets manager, or pipeline secret variables. - Aligned with VM credential patterns used by other Microsoft solution accelerators (Content Generation, Code Modernization, DKM, Container Migration) which use pure environment variable substitution with no hardcoded password defaults. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ab864e0 commit 9c8071b

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

docs/deploymentguide.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,10 @@ For network-isolated deployments, set the VM credentials before running `azd up`
209209

210210
```powershell
211211
azd env set VM_ADMIN_USERNAME "youradminuser"
212-
azd env set VM_ADMIN_PASSWORD "Use-A-Strong-Password-Here!"
212+
azd env set VM_ADMIN_PASSWORD "<your-strong-password>"
213213
```
214214

215-
If you prefer source-controlled defaults, set them in [infra/main.bicepparam](../infra/main.bicepparam) instead:
216-
217-
```bicep
218-
param vmUserName = 'youradminuser'
219-
param vmAdminPassword = 'Use-A-Strong-Password-Here!'
220-
```
215+
> ⚠️ **Security Warning:** Do **not** commit VM passwords to source control. Always use `azd env set`, a secrets manager, or pipeline secret variables for sensitive credentials. The `infra/main.bicepparam` file reads the password from the `VM_ADMIN_PASSWORD` environment variable at deployment time — no default is provided intentionally, so deployment will prompt or fail if the variable is unset.
221216
222217
</details>
223218

infra/main.bicepparam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ param containerAppsList = [
205205
]
206206

207207
param vmUserName = readEnvironmentVariable('VM_ADMIN_USERNAME', 'testvmuser')
208-
param vmAdminPassword = readEnvironmentVariable('VM_ADMIN_PASSWORD', 'JumpboxAdminP@ssw0rd1234!')
208+
param vmAdminPassword = readEnvironmentVariable('VM_ADMIN_PASSWORD', '')
209209
param vmSize = 'Standard_D2s_v4'
210210

211211
// ========================================

0 commit comments

Comments
 (0)