Skip to content

Commit 591ecd4

Browse files
authored
Merge pull request #201835 from MicrosoftGuyJFlo/VMSignInMissingAppFix
[Azure AD] Devices - GitHub Issue 92138 + 92139
2 parents c193159 + fbca16e commit 591ecd4

File tree

2 files changed

+57
-15
lines changed

2 files changed

+57
-15
lines changed

articles/active-directory/devices/howto-vm-sign-in-azure-ad-linux.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: active-directory
66
ms.service: active-directory
77
ms.subservice: devices
88
ms.topic: how-to
9-
ms.date: 11/22/2021
9+
ms.date: 06/16/2022
1010

1111
ms.author: joflore
1212
author: MicrosoftGuyJFlo
@@ -99,17 +99,17 @@ Ensure your VM is configured with the following functionality:
9999

100100
Ensure your client meets the following requirements:
101101

102-
- SSH client must support OpenSSH based certificates for authentication. You can use Az CLI (2.21.1 or higher) with OpenSSH (included in Windows 10 version 1803 or higher) or Azure Cloud Shell to meet this requirement.
103-
- SSH extension for Az CLI. You can install this using `az extension add --name ssh`. You don’t need to install this extension when using Azure Cloud Shell as it comes pre-installed.
104-
- If you’re using any other SSH client other than Az CLI or Azure Cloud Shell that supports OpenSSH certificates, you’ll still need to use Az CLI with SSH extension to retrieve ephemeral SSH cert and optionally a config file and then use the config file with your SSH client.
102+
- SSH client must support OpenSSH based certificates for authentication. You can use Azure CLI (2.21.1 or higher) with OpenSSH (included in Windows 10 version 1803 or higher) or Azure Cloud Shell to meet this requirement.
103+
- SSH extension for Azure CLI. You can install this using `az extension add --name ssh`. You don’t need to install this extension when using Azure Cloud Shell as it comes pre-installed.
104+
- If you’re using any other SSH client other than Azure CLI or Azure Cloud Shell that supports OpenSSH certificates, you’ll still need to use Azure CLI with SSH extension to retrieve ephemeral SSH cert and optionally a config file and then use the config file with your SSH client.
105105
- TCP connectivity from the client to either the public or private IP of the VM (ProxyCommand or SSH forwarding to a machine with connectivity also works).
106106

107107
> [!IMPORTANT]
108108
> SSH clients based on PuTTy do not support openSSH certificates and cannot be used to login with Azure AD openSSH certificate-based authentication.
109109
110110
## Enabling Azure AD login in for Linux VM in Azure
111111

112-
To use Azure AD login in for Linux VM in Azure, you need to first enable Azure AD login option for your Linux VM, configure Azure role assignments for users who are authorized to login in to the VM and then use SSH client that supports OpensSSH such as Az CLI or Az Cloud Shell to SSH to your Linux VM. There are multiple ways you can enable Azure AD login for your Linux VM, as an example you can use:
112+
To use Azure AD login in for Linux VM in Azure, you need to first enable Azure AD login option for your Linux VM, configure Azure role assignments for users who are authorized to login in to the VM and then use SSH client that supports OpensSSH such as Azure CLI or Az Cloud Shell to SSH to your Linux VM. There are multiple ways you can enable Azure AD login for your Linux VM, as an example you can use:
113113

114114
- Azure portal experience when creating a Linux VM
115115
- Azure Cloud Shell experience when creating a Windows VM or for an existing Linux VM
@@ -224,11 +224,11 @@ az role assignment create \
224224
225225
For more information on how to use Azure RBAC to manage access to your Azure subscription resources, see the article [Steps to assign an Azure role](../../role-based-access-control/role-assignments-steps.md).
226226

227-
## Install SSH extension for Az CLI
227+
## Install SSH extension for Azure CLI
228228

229-
If you’re using Azure Cloud Shell, then no other setup is needed as both the minimum required version of Az CLI and SSH extension for Az CLI are already included in the Cloud Shell environment.
229+
If you’re using Azure Cloud Shell, then no other setup is needed as both the minimum required version of Azure CLI and SSH extension for Azure CLI are already included in the Cloud Shell environment.
230230

231-
Run the following command to add SSH extension for Az CLI
231+
Run the following command to add SSH extension for Azure CLI
232232

233233
```azurecli
234234
az extension add --name ssh
@@ -245,11 +245,11 @@ az extension show --name ssh
245245
You can enforce Conditional Access policies such as require multi-factor authentication, require compliant or hybrid Azure AD joined device for the device running SSH client, and checking for risk before authorizing access to Linux VMs in Azure that are enabled with Azure AD login in. The application that appears in Conditional Access policy is called "Azure Linux VM Sign-In".
246246

247247
> [!NOTE]
248-
> Conditional Access policy enforcement requiring device compliance or Hybrid Azure AD join on the client device running SSH client only works with Az CLI running on Windows and macOS. It is not supported when using Az CLI on Linux or Azure Cloud Shell.
248+
> Conditional Access policy enforcement requiring device compliance or Hybrid Azure AD join on the client device running SSH client only works with Azure CLI running on Windows and macOS. It is not supported when using Azure CLI on Linux or Azure Cloud Shell.
249249
250250
## Login using Azure AD user account to SSH into the Linux VM
251251

252-
### Using Az CLI
252+
### Using Azure CLI
253253

254254
First do az login and then az ssh vm.
255255

@@ -265,7 +265,7 @@ The following example automatically resolves the appropriate IP address for the
265265
az ssh vm -n myVM -g AzureADLinuxVM
266266
```
267267

268-
If prompted, enter your Azure AD login credentials at the login page, perform an MFA, and/or satisfy device checks. You’ll only be prompted if your az CLI session doesn’t already meet any required Conditional Access criteria. Close the browser window, return to the SSH prompt, and you’ll be automatically connected to the VM.
268+
If prompted, enter your Azure AD login credentials at the login page, perform an MFA, and/or satisfy device checks. You’ll only be prompted if your Azure CLI session doesn’t already meet any required Conditional Access criteria. Close the browser window, return to the SSH prompt, and you’ll be automatically connected to the VM.
269269

270270
You’re now signed in to the Azure Linux virtual machine with the role permissions as assigned, such as VM User or VM Administrator. If your user account is assigned the Virtual Machine Administrator Login role, you can use sudo to run commands that require root privileges.
271271

@@ -308,7 +308,7 @@ Use the following example to authenticate to Azure CLI using the service princip
308308
az login --service-principal -u <sp-app-id> -p <password-or-cert> --tenant <tenant-id>
309309
```
310310

311-
Once authentication with a service principal is complete, use the normal Az CLI SSH commands to connect to the VM.
311+
Once authentication with a service principal is complete, use the normal Azure CLI SSH commands to connect to the VM.
312312

313313
```azurecli
314314
az ssh vm -n myVM -g AzureADLinuxVM
@@ -389,12 +389,33 @@ For customers who are using previous version of Azure AD login for Linux that wa
389389
390390
## Using Azure Policy to ensure standards and assess compliance
391391
392-
Use Azure Policy to ensure Azure AD login is enabled for your new and existing Linux virtual machines and assess compliance of your environment at scale on your Azure Policy compliance dashboard. With this capability, you can use many levels of enforcement: you can flag new and existing Linux VMs within your environment that don’t have Azure AD login enabled. You can also use Azure Policy to deploy the Azure AD extension on new Linux VMs that don’t have Azure AD login enabled, as well as remediate existing Linux VMs to the same standard. In addition to these capabilities, you can also use Azure Policy to detect and flag Linux VMs that have non-approved local accounts created on their machines. To learn more, review [Azure Policy](../../governance/policy/overview.md).
392+
Use Azure Policy to ensure Azure AD login is enabled for your new and existing Linux virtual machines and assess compliance of your environment at scale on your Azure Policy compliance dashboard. With this capability, you can use many levels of enforcement: you can flag new and existing Linux VMs within your environment that don’t have Azure AD login enabled. You can also use Azure Policy to deploy the Azure AD extension on new Linux VMs that don’t have Azure AD login enabled, and remediate existing Linux VMs to the same standard. In addition to these capabilities, you can also use Azure Policy to detect and flag Linux VMs that have non-approved local accounts created on their machines. To learn more, review [Azure Policy](../../governance/policy/overview.md).
393393
394394
## Troubleshoot sign-in issues
395395
396396
Some common errors when you try to SSH with Azure AD credentials include no Azure roles assigned, and repeated prompts to sign in. Use the following sections to correct these issues.
397397
398+
### Missing application
399+
400+
If the Azure Linux VM Sign-in application is missing from Conditional Access, use the following steps to remediate the issue:
401+
402+
1. Check to make sure the application isn't in the tenant by:
403+
1. Sign in to the **Azure portal**.
404+
1. Browse to **Azure Active Directory** > **Enterprise applications**
405+
1. Remove the filters to see all applications, and search for "VM". If you don't see Azure Linux VM Sign-in as a result, the service principal is missing from the tenant.
406+
407+
Another way to verify it is via Graph PowerShell:
408+
409+
1. [Install the Graph PowerShell SDK](/powershell/microsoftgraph/installation) if you haven't already done so.
410+
1. `Connect-MgGraph -Scopes "ServicePrincipalEndpoint.ReadWrite.All","Application.ReadWrite.All"`
411+
1. Sign-in with a Global Admin account
412+
1. Consent to permission prompt
413+
1. `Get-MgServicePrincipal -ConsistencyLevel eventual -Search '"DisplayName:Azure Linux VM"'`
414+
1. If this command results in no output and returns you to the PowerShell prompt, you can create the Service Principal with the following Graph PowerShell command:
415+
1. `New-MgServicePrincipal -AppId ce6ff14a-7fdc-4685-bbe0-f6afdfcfa8e0`
416+
1. Successful output will show that the AppID and the Application Name Azure Linux VM Sign-in was created.
417+
1. Sign out of Graph PowerShell when complete with the following command: `Disconnect-MgGraph`
418+
398419
### Couldn’t retrieve token from local cache
399420
400421
You must run az login again and go through an interactive sign in flow. Review the section [Using Az Cloud Shell](#using-az-cloud-shell).
@@ -468,7 +489,7 @@ Virtual machine scale set VM connections may fail if the virtual machine scale s
468489
469490
### AllowGroups / DenyGroups statements in sshd_config cause first login to fail for Azure AD users
470491
471-
Cause 1: If sshd_config contains either AllowGroups or DenyGroups statements, the very first login fails for Azure AD users. If the statement was added after a user already has a successful login, they can log in.
492+
Cause 1: If sshd_config contains either AllowGroups or DenyGroups statements, the first login fails for Azure AD users. If the statement was added after a user already has a successful login, they can log in.
472493
473494
Solution 1: Remove AllowGroups and DenyGroups statements from sshd_config.
474495

articles/active-directory/devices/howto-vm-sign-in-azure-ad-windows.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: active-directory
66
ms.service: active-directory
77
ms.subservice: devices
88
ms.topic: how-to
9-
ms.date: 04/01/2022
9+
ms.date: 06/16/2022
1010

1111
ms.author: joflore
1212
author: MicrosoftGuyJFlo
@@ -426,6 +426,27 @@ If you haven't deployed Windows Hello for Business and if that isn't an option f
426426
427427
Share your feedback about this feature or report issues using it on the [Azure AD feedback forum](https://feedback.azure.com/d365community/forum/22920db1-ad25-ec11-b6e6-000d3a4f0789).
428428

429+
### Missing application
430+
431+
If the Azure Windows VM Sign-In application is missing from Conditional Access, use the following steps to remediate the issue:
432+
433+
1. Check to make sure the application isn't in the tenant by:
434+
1. Sign in to the **Azure portal**.
435+
1. Browse to **Azure Active Directory** > **Enterprise applications**
436+
1. Remove the filters to see all applications, and search for "VM". If you don't see Azure Windows VM Sign-In as a result, the service principal is missing from the tenant.
437+
438+
Another way to verify it is via Graph PowerShell:
439+
440+
1. [Install the Graph PowerShell SDK](/powershell/microsoftgraph/installation) if you haven't already done so.
441+
1. `Connect-MgGraph -Scopes "ServicePrincipalEndpoint.ReadWrite.All","Application.ReadWrite.All"`
442+
1. Sign-in with a Global Admin account
443+
1. Consent to permission prompt
444+
1. `Get-MgServicePrincipal -ConsistencyLevel eventual -Search '"DisplayName:Azure Windows VM Sign-In"'`
445+
1. If this command results in no output and returns you to the PowerShell prompt, you can create the Service Principal with the following Graph PowerShell command:
446+
1. `New-MgServicePrincipal -AppId 372140e0-b3b7-4226-8ef9-d57986796201`
447+
1. Successful output will show that the AppID and the Application Name Azure Windows VM Sign-In was created.
448+
1. Sign out of Graph PowerShell when complete with the following command: `Disconnect-MgGraph`
449+
429450
## Next steps
430451

431452
For more information on Azure Active Directory, see [What is Azure Active Directory](../fundamentals/active-directory-whatis.md).

0 commit comments

Comments
 (0)