azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzureDeployment throws NullReference Error, missing thumbprintAlgorithm

Open imtiazh opened this issue 9 years ago • 8 comments

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

imtiazh avatar Sep 07 '17 15:09 imtiazh

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);
            }
        }

imtiazh avatar Sep 07 '17 15:09 imtiazh

Look to me that either the code should handle the case when thumbprintAlgorithm is null, or enforce that property when publishing a CloudService.

omerlh avatar Sep 07 '17 16:09 omerlh

@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.

cormacpayne avatar Sep 08 '17 18:09 cormacpayne

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.

imtiazh avatar Sep 08 '17 21:09 imtiazh

Same here, I am using it to get details about the production deployment of Cloud Service.

omerlh avatar Sep 10 '17 03:09 omerlh

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 . I also tried to append the "thumbprintAlgorithm="sha1" after the sourceLocation in cscfg file but the cmdlet still failed. Any idea how I can get it work?

vanbasten2323 avatar Sep 15 '17 19:09 vanbasten2323

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....

omerlh avatar Sep 17 '17 03:09 omerlh

@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.

markcowl avatar Feb 06 '18 23:02 markcowl