microsoft / azure_arc

Automated Azure Arc, Edge, and Platform environments
https://aka.ms/ArcJumpstart
Creative Commons Attribution 4.0 International
742 stars 549 forks source link

DeviceManagement Extension Installation Failed - HCI Jumpbox #2705

Closed pmadusud closed 1 month ago

pmadusud commented 1 month ago

I am having an issue with the DeviceManagement Extension during the setup of HCI Jumpbox, as the installation fails with the below error.

(HCRP400) Extension returned non-zero exit code for Install: 1. Extension error output: std error: .  Extension Message: Failed to install the Device Management Extension probably because the Resource Provider (Microsoft.AzureStackHCI) is not yet registered in the subscription. Error Details = {"status":"Failed","error":{"code":"InternalHttpClientError","message":"Could not make the dp call with inner error = ","target":"https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview","details":[{"code":"InternalServerError","message":"Endpoint not found for put edge devices call, endpoint = https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview with details = "}]}}
Extension Error:
Status   Name               DisplayName
------   ----               -----------
Stopped  DeviceManagemen... DeviceManagementService
2024-09-10 15:31:59Z : INFO : Install-Extension.ps1 : Failed to install the Device Management Extension probably because the RP is not yet registered
2024-09-10 15:31:59Z : INFO : ReportStatus.ps1: Name: Install-Extension, Operation: Failed to install the Device Management Extension probably because the Resource Provider (Microsoft.AzureStackHCI) is not yet registered in the subscription, Status: error, Code: 500, Message: Failed to install the Device Management Extension probably because the Resource Provider (Microsoft.AzureStackHCI) is not yet registered in the subscription. Error Details = {"status":"Failed","error":{"code":"InternalHttpClientError","message":"Could not make the dp call with inner error = ","target":"https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview","details":[{"code":"InternalServerError","message":"Endpoint not found for put edge devices call, endpoint = https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview with details = "}]}}
2024-09-10 15:31:59Z : INFO : ReportStatus.ps1 : Attempt #1 : Writing to status file at C:\Packages\Plugins\Microsoft.Edge.DeviceManagementExtension\1.2408.0.3024\status\0.status

Code: HCRP400
Message: Extension returned non-zero exit code for Install: 1. Extension error output: std error: .  Extension Message: Failed to install the Device Management Extension probably because the Resource Provider (Microsoft.AzureStackHCI) is not yet registered in the subscription. Error Details = {"status":"Failed","error":{"code":"InternalHttpClientError","message":"Could not make the dp call with inner error = ","target":"https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview","details":[{"code":"InternalServerError","message":"Endpoint not found for put edge devices call, endpoint = https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview with details = "}]}}
Extension Error:
Status   Name               DisplayName
------   ----               -----------
Stopped  DeviceManagemen... DeviceManagementService
2024-09-10 15:31:59Z : INFO : Install-Extension.ps1 : Failed to install the Device Management Extension probably because the RP is not yet registered
2024-09-10 15:31:59Z : INFO : ReportStatus.ps1: Name: Install-Extension, Operation: Failed to install the Device Management Extension probably because the Resource Provider (Microsoft.AzureStackHCI) is not yet registered in the subscription, Status: error, Code: 500, Message: Failed to install the Device Management Extension probably because the Resource Provider (Microsoft.AzureStackHCI) is not yet registered in the subscription. Error Details = {"status":"Failed","error":{"code":"InternalHttpClientError","message":"Could not make the dp call with inner error = ","target":"https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview","details":[{"code":"InternalServerError","message":"Endpoint not found for put edge devices call, endpoint = https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview with details = "}]}}
2024-09-10 15:31:59Z : INFO : ReportStatus.ps1 : Attempt #1 : Writing to status file at C:\Packages\Plugins\Microsoft.Edge.DeviceManagementExtension\1.2408.0.3024\status\0.status

The error says that the RP Microsoft.AzureStackHCI might not be registered, however the RP is registered properly. I have also tried re-registering as well as unregister and register of the RP. Even after doing the same, I get the same error mentioned above.

I have also tried to install the extension through Azure CLI, again the result is the same.

Am I missing something which is causing the issue mentioned above. Any pointers would be great.

dkirby-ms commented 1 month ago

Normally that would mean the RP is not actually registered. From the HCIBox-Client VM, can you check to confirm that the subscription being used by the cli matches the one you are targeting?

To do this you should be able to go into the client vm, open a shell, and run 'az account show' (the shell should already have an az cli session active)

AzureJedi commented 1 month ago

I have the same error and after investigating i can confirm the right sub is in context and the RP is registered... Do we know if the EP for the call is valid for EastUS2? Installation notes HCIBox can be deployed in East US, Australia East, and West Europe. Deploying in other regions will result in unexpected behavior or failures. But using Azure Dev CLI there are 5 regions....

Error Details = {"status":"Failed","error":{"code":"InternalHttpClientError","message":"Could not make the dp call with inner error = " ,"target":"https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview","details":[{"code":"Intern alServerError","message":"Endpoint not found for put edge devices call, endpoint = https://dp.stackhci.azure.com/eastus2/edgeDevices?api-version=2024-02-15-preview with details = "}]}}

dkirby-ms commented 1 month ago

Eastus2 certainly used to work. Could be a regression in the RP if this region is no longer supported.

pmadusud commented 1 month ago

I have managed to resolve the above issue. The problem I think is because as part of the deployment of DeviceManagement extension, it trying to use the REST API end point for the particular version i.e. 2024-02-15-preview. It seems that for my subscription, the end point for that REST API version is not available in eastus2.

I used the below CLI command to identify the regions for each of the REST API versions. az provider show --namespace microsoft.azurestackhci

Based on this, I have moved my deployment to a different region and it resolved this specific problem.

Hope this helps for others as well.

dkirby-ms commented 1 month ago

Thanks for the detail on resolution @pmadusud.