Get-AzureDeployment throws NullReference Error, missing thumbprintAlgorithm
Cmdlet(s)
PowerShell Version
Instructions: to get PowerShell version, type $PSVersionTable and look for the value associated with PSVersion
Module Version
OS Version
Instructions: to get OS version, type $PSversionTable and look for value associated with BuildVersion
Description
Debug Output
Instructions: to get Debug Output, set $DebugPreference="Continue" and then execute the cmdlet or script causing the issue
Script/Steps for Reproduction
Get-AzureDeployment : Object reference not set to an instance of an object. At line:1 char:1
- Get-AzureDeployment -servicename
-
+ CategoryInfo : CloseError: (:) [Get-AzureDeployment], NullReferenceException + FullyQualifiedErrorId :
Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand I believe the error is coming from below where the certificates’ thumbprint and thumbprintAlgorithm are being read. https://github.com/Azure/azure-powershell/blob/preview/src/ServiceManagement/Compute/Commands.ServiceManagement/Model/RoleConfiguration.cs
if (data.Element(this.ns + "Certificates") != null) { foreach (var setting in data.Element(this.ns + "Certificates").Descendants()) { var certificate = new CertificateConfiguration { Thumbprint = setting.Attribute("thumbprint").Value, ThumbprintAlgorithm = setting.Attribute("thumbprintAlgorithm").Value };
this.Certificates.Add(setting.Attribute("name").Value, certificate);
}
}
Look to me that either the code should handle the case when thumbprintAlgorithm is null, or enforce that property when publishing a CloudService.
@imtiazh @omerlh are either of you able to use the ARM cmdlets in the AzureRM.Websites module to perform the same actions? If not, we can look into adding this functionality in the ARM cmdlets.
We are using this cmdlet to deploy Classic PaaS cloud Services, not sure how we can use the ARM cmdlets in the AzureRM.Websites module. If there is an example for this, it will be helpful.
Same here, I am using it to get details about the production deployment of Cloud Service.
We have the same problem. After using the "-debug", we can see all the role instances' status. So it looks like the cmdlet successfully got the deployment info but failed to parse the output. In our cscfg, we have
Not sure I follow, but we are talking about an issue that is related to the certificate part of the cscfg:
<Certificates>
<Certificate name="<>" thumbprint="<>" thumbprintAlgorithm="sha1" />
</Certificates>
Please notice the thumbprintAlgorithm attribute, that was the issue in my case....
@imtiazh @omerlh Unfortunately, we are not accepting new features in RDFE cmdlets, so we cannot accept this issue. Please raise an issue for any missing functionality that you require in the ARM cmdlets.