For anyone still having the issue, we have done the below and manually installed the needed certificates. We found our proxy had an issue with the https inspection and resolved this afterwards. but if you need to manually do this, please see the steps below as per a SR to microsoft:
- Check if communication to IMDS is possible
Please confirm that communication with IMDS is possible by executing the following commands.
Command (Please execute one line at a time):
$Proxy=New-object System.Net.WebProxy
$WebSession=new-object Microsoft.PowerShell.Commands.WebRequestSession
$WebSession.Proxy=$Proxy
Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri "http://169.254.169.254/metadata/instance?api-version=2021-02-01" -WebSession $WebSession
If the last Invoke-RestMethod command is successfully executed, the following results will be displayed in PowerShell.
|<Example of Execution Result> ---- compute ------- @{azEnvironment=AzurePublicCloud; customData=; evictionPolicy=; isHostCompatibilityLayerVm=false; licenseType=; locat... ---- |
If the above command fails, the Firewall or security software on your OS may be blocking communication to IMDS.
If the above command outputs the result as expected, please proceed to step 2.
2.Verifying the Verifiability of IMDS Server Certificates
2.1 Verification of IMDS server certificate
Please check if the IMDS certificate can be verified by using the following command.
$Proxy=New-object System.Net.WebProxy
$WebSession=new-object Microsoft.PowerShell.Commands.WebRequestSession
$WebSession.Proxy=$Proxy
$attestedDoc = Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri http://169.254.169.254/metadata/attested/document?api-version=2020-09-01 -WebSession $WebSession
$signature = [System.Convert]::FromBase64String($attestedDoc.signature)
$cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]($signature)
$chain = New-Object -TypeName System.Security.Cryptography.X509Certificates.X509Chain
$chain.Build($cert)
If the certificate fails to validate, you will see False after the last $chain.Build($cert) command is executed,
Please proceed to 2.2 or later.
If the output is True, please report this to our support.
2.2 Checking the certificate used in IMDS
The following commands are used to obtain information on certificates used in IMDS.
Command (Please execute one line at a time):
$Proxy=New-object System.Net.WebProxy
$WebSession=new-object Microsoft.PowerShell.Commands.WebRequestSession
$WebSession.Proxy=$Proxy
$attestedDoc = Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri http://169.254.169.254/metadata/attested/document?api-version=2020-09-01 -WebSession $WebSession
$signature = [System.Convert]::FromBase64String($attestedDoc.signature)
$cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]($signature)
[System.IO.File]::WriteAllBytes("C:\IMDS.cer", $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert))
If all commands are executed successfully, a file named IMDS.cer will be created directly under the C drive.
Open IMDS.cer and check the CN name corresponding to "Issuer" in the "Details" tab.
After confirming the CN name, download the certificate corresponding to the CN name from the following page.
Reference: Azure Certificate Authority details | Microsoft Learn
2.3 Import the downloaded certificate
- Double-click the downloaded certificate file on the server and select "Install Certificate
- Select "Install Certificate".
- Select "Local Computer" and select Next.
- Select "Place all certificates in the following store", select "Intermediate Certificate Authority" from "Browse", click OK, and then select "Next".
5.Finally, click "Finish.
2.4 Perform OS reactivation
Open a command prompt with administrator privileges and execute the following command
Command:
schtasks /RUN /TN "\Microsoft\Windows\Clip\LicenseImdsIntegration"
2.5 Checking the activation
Open "Settings" in the Windows menu and go to "Update and Security" to check the "License Activation" menu.
On the Activation screen, under "Activation," the message "Windows has been activated using your organization's license activation service. "