Skip to content

fix: Enable Microsoft Entra ID authentication for the jumpbox VM through Azure Bastion#163

Open
Saswato-Microsoft wants to merge 1 commit into
microsoft:devfrom
Saswato-Microsoft:psl-vm-authfix
Open

fix: Enable Microsoft Entra ID authentication for the jumpbox VM through Azure Bastion#163
Saswato-Microsoft wants to merge 1 commit into
microsoft:devfrom
Saswato-Microsoft:psl-vm-authfix

Conversation

@Saswato-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request updates the deployment to enable Microsoft Entra ID (formerly Azure Active Directory) authentication for the jumpbox VM through Azure Bastion, removing the need to manage local admin credentials for RDP access. Documentation and infrastructure scripts are updated to reflect this new authentication flow, making access more secure and user-friendly. Local admin credentials are now auto-generated and not used for sign-in, and guidance for troubleshooting Entra ID-based access is provided.

Infrastructure changes: Microsoft Entra ID authentication for Jump VM

  • infra/main.bicep: Installs the AADLoginForWindows extension on the jumpbox VM and assigns the deploying principal the "Virtual Machine Administrator Login" role, enabling Entra ID sign-in via Bastion.
  • infra/main.bicepparam: Removes environment-based admin credentials; now sets a default username and generates a deterministic password that is not used for sign-in.

Documentation updates: Sign-in flow and troubleshooting

  • docs/ACCESSING_PRIVATE_RESOURCES.md: Updates instructions to show how to connect to the jump VM using Entra ID credentials, removes references to local usernames/passwords, and adds troubleshooting steps for Entra ID authentication. [1] [2]
  • docs/deploymentguide.md: Removes references to setting VM admin credentials and clarifies that Bastion uses Entra ID authentication.
  • docs/deploy_app_from_foundry.md, docs/post_deployment_steps.md: Updates Bastion connection instructions to use Entra ID authentication, removes local credential references, and adds links to relevant documentation. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

@Saswato-Microsoft Saswato-Microsoft marked this pull request as ready for review May 27, 2026 13:58
Copilot AI review requested due to automatic review settings May 27, 2026 13:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Microsoft Entra ID authentication for the network-isolated jumpbox VM via Azure Bastion, removing reliance on manually managed local VM credentials.

Changes:

  • Generate a non-checked-in jumpbox local admin password and stop reading VM credential env vars in top-layer params.
  • Post-configure the existing jumpbox VM to support Entra ID sign-in (AADLoginForWindows extension + RBAC assignment).
  • Update docs to reflect Entra ID sign-in flow via Bastion.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
infra/main.bicepparam Removes VM credential env var inputs; introduces deterministic generated password and updated comments.
infra/main.bicep Adds resources to enable Entra ID login on the deployed jump VM (extension + role assignment).
docs/post_deployment_steps.md Updates Bastion connection instructions to Entra ID authentication and updates screenshot reference.
docs/deploymentguide.md Removes VM credential configuration guidance; points to Entra ID-based access docs.
docs/deploy_app_from_foundry.md Updates jump VM access steps to use Entra ID auth via Bastion.
docs/ACCESSING_PRIVATE_RESOURCES.md Rewrites access/troubleshooting sections to align with Entra ID sign-in and RBAC-based access control.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infra/main.bicepparam

param vmUserName = readEnvironmentVariable('VM_ADMIN_USERNAME', 'testvmuser')
param vmAdminPassword = readEnvironmentVariable('VM_ADMIN_PASSWORD', 'JumpboxAdminP@ssw0rd1234!')
// Jumpbox sign-in is performed via Microsoft Entra ID through Azure Bastion (Basic SKU).
Comment thread infra/main.bicepparam
// deterministically per azd environment so nothing weak/known is committed to source.
// Ref: https://learn.microsoft.com/azure/bastion/bastion-entra-id-authentication
param vmUserName = 'testvmuser'
param vmAdminPassword = 'Jb!${uniqueString(readEnvironmentVariable('AZURE_ENV_NAME', 'default'), readEnvironmentVariable('AZURE_SUBSCRIPTION_ID', 'sub'))}${guid(readEnvironmentVariable('AZURE_ENV_NAME', 'default'), 'vm-admin-password')}'
Comment thread infra/main.bicep

// Mirror the submodule's VM name computation (see submodules/ai-landing-zone/main.bicep:
// _vmBaseName = !empty(vmName) ? vmName : 'testvm${resourceToken}', then substring(..., 0, 15)).
var jumpVmEntraIdEnabled = networkIsolation && deployVM && !empty(principalId)
Comment thread infra/main.bicep
name: jumpVmName
}

resource jumpVmAadLoginExtension 'Microsoft.Compute/virtualMachines/extensions@2024-07-01' = if (jumpVmEntraIdEnabled) {
Comment thread infra/main.bicep
}
}

resource jumpVmAdminLoginRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (jumpVmEntraIdEnabled) {
Comment on lines +15 to 19
The jumpbox VM is provisioned with the **AAD Login for Windows** extension and the deploying
principal is automatically granted the **Virtual Machine Administrator Login** role on the VM.
Azure Bastion is deployed using the **Standard** SKU (which supports Microsoft Entra ID
authentication for Azure portal RDP/SSH sessions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants