Я пытаюсь использовать Расширение виртуальной машины для входа в Azure AD для включения ADD логинов на виртуальной машине Azure (Windows Server 2019 Datacenter). ВМ была создана с использованием портала после руководство по расширению. Развертывание завершилось неудачно на последнем этапе установки расширения.
Следующее, что я попробовал, - это вручную развернуть расширение, которое заявляет об успехе.
$ az vm extension set --publisher Microsoft.Azure.ActiveDirectory \
--name AADLoginForWindows \
--resource-group my-rg \
--vm-name myvm
{
"autoUpgradeMinorVersion": true,
"forceUpdateTag": null,
"id": "/subscriptions/12345/resourceGroups/my-rg/providers/Microsoft.Compute/virtualMachines/myvm/extensions/AADLoginForWindows",
"instanceView": null,
"location": "westeurope",
"name": "AADLoginForWindows",
"protectedSettings": null,
"provisioningState": "Succeeded",
"publisher": "Microsoft.Azure.ActiveDirectory",
"resourceGroup": "my-rg",
"settings": null,
"tags": null,
"type": "Microsoft.Compute/virtualMachines/extensions",
"typeHandlerVersion": "1.0",
"virtualMachineExtensionType": "AADLoginForWindows"
}
Однако логины AAD не работают. Следуя руководству по устранению неполадок, я нашел журналы в C:\WindowsAzure\Logs\Plugins\Microsoft.Azure.ActiveDirectory.AADLoginForWindows\1.0.0.0
заявив, что соединение не удалось
2020-07-05T21:15:48.5404132Z [Information]: Azure resource Id:/subscriptions/12345/resourceGroups/my-rg/providers/Microsoft.Compute/virtualMachines/myvm
2020-07-05T21:15:48.5504309Z [Information]: Getting Tenant ID from MSI.
2020-07-05T21:15:48.5604145Z [Information]: Targeting host name:123.456.789.1, url path: /metadata/identity/info?api-version=2018-02-01
2020-07-05T21:15:48.5654244Z [Information]: DsrCmdAzureHelper::GetMetadataRestResponse: HTTP Status Code: 200
2020-07-05T21:15:48.5754143Z [Information]: dwDownloaded:51, dwCombinedSize:51
2020-07-05T21:15:48.5804154Z [Information]: dwDownloaded:0, dwCombinedSize:51
2020-07-05T21:15:48.5904154Z [Information]: Received Content (size 51):
2020-07-05T21:15:48.6004144Z [Information]: {"tenantId":"lorem-ipsum"}
2020-07-05T21:15:48.6104159Z [Information]: Discover tenant info with Tenant ID lorem-ipsum.
2020-07-05T21:15:48.6154174Z [Information]: Getting MSI token for app urn:ms-drs:enterpriseregistration.windows.net.
2020-07-05T21:15:48.6254194Z [Information]: Targeting host name:123.456.789.1, url path: /metadata/identity/oauth2/token?resource=urn:ms-drs:enterpriseregistration.windows.net&api-version=2018-02-01
2020-07-05T21:15:48.6304201Z [Information]: DsrCmdAzureHelper::GetMetadataRestResponse: HTTP Status Code: 200
2020-07-05T21:15:48.6454137Z [Information]: dwDownloaded:1487, dwCombinedSize:1487
2020-07-05T21:15:48.6504289Z [Information]: dwDownloaded:0, dwCombinedSize:1487
2020-07-05T21:15:48.6604138Z [Information]: Received Content (size 1487):
2020-07-05T21:15:48.6704228Z [Information]: {"access_token":"dolor-sit-amet ... oken_type":"Bearer"}
2020-07-05T21:15:48.6754146Z [Information]: Start join process with MSI credential.
2020-07-05T21:15:48.6854141Z [Information]: Join request ID: 7af50505-9648-4db2-8c55-51a26d1ab496
2020-07-05T21:15:48.6954236Z [Information]: Join response time: 07-05-2020 21:15:48Z
2020-07-05T21:15:48.7004143Z [Information]: Join HTTP status: 400
2020-07-05T21:15:48.7104143Z [Information]: Join error code: InvalidParameter
2020-07-05T21:15:48.7154141Z [Information]: Join message: The resource id parameter (/subscriptions/12345/resourceGroups/my-rg/providers/Microsoft.Compute/virtualMachines/myvm) is invalid.
2020-07-05T21:15:48.7254184Z [Information]: AzureSecureVMEnroll failed with 0x801c0001
2020-07-05T21:15:48.7304195Z [Information]: AzureSecureVMJoinOperation: DeviceEnroller::AzureSecureVMEnroll failed 0x801c0001.
2020-07-05T21:15:48.7404210Z [Error]: AAD Join failed with status code -2145648639.
Я обнаружил несколько подсказок, что пользовательская область MDM должна быть установлена на NONE
. Однако мы не используем Azure AD Premium, поэтому автоматическая регистрация в MDM недоступна.
Наконец, я удалил расширение и повторно развернул его, используя приведенную выше командную строку с тем же результатом.
dsregcmd
отчеты
$ dsregcmd /status
+----------------------------------------------------------------------+
| Device State |
+----------------------------------------------------------------------+
AzureAdJoined : NO
EnterpriseJoined : NO
DomainJoined : NO
+----------------------------------------------------------------------+
| User State |
+----------------------------------------------------------------------+
NgcSet : NO
WorkplaceJoined : NO
WamDefaultSet : NO
+----------------------------------------------------------------------+
| SSO State |
+----------------------------------------------------------------------+
AzureAdPrt : NO
AzureAdPrtAuthority : NO
EnterprisePrt : NO
EnterprisePrtAuthority : NO
+----------------------------------------------------------------------+
| Ngc Prerequisite Check |
+----------------------------------------------------------------------+
IsDeviceJoined : NO
IsUserAzureAD : NO
PolicyEnabled : NO
PostLogonEnabled : YES
DeviceEligible : YES
SessionIsNotRemote : NO
CertEnrollment : none
PreReqResult : WillNotProvision