Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IoT]IoT Hub SDK version update to 4.2.0 and fixed Get-AzIoTHub to work with DigiCert hubs #20938

Merged
merged 5 commits into from
Feb 17, 2023

Conversation

Elsie4ever
Copy link
Contributor

@Elsie4ever Elsie4ever commented Feb 15, 2023

…th DigiCert hubs

Description

This PR is mainly to unblock user from not able to use Get-AzIoTHub with DigiCert hubs:
IoT Hub SDK version update to 4.2.0 and fixed some minor type error introduced by the version update
Fixed Get-AzIoTHub to work with DigiCert hubs by adding RootCertificateV2 to PSCapabilities

Checklist

  • SHOULD select appropriate branch. Cmdlets from Autorest.PowerShell should go to generation branch.
  • SHOULD make the title of PR clear and informative, and in the present imperative tense.
  • SHOULD update ChangeLog.md file(s) appropriately
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense. Add changelog in description section if PR goes into generation branch.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD have approved design review for the changes in this repository (Microsoft internal only) with following situations
    • Create new module from scratch
    • Create new resource types which are not easy to conform to Azure PowerShell Design Guidelines
    • Create new resource type which name doesn't use module name as prefix
    • Have design question before implementation
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT introduce breaking changes in Az minor release except preview version.
  • SHOULD NOT adjust version of module manually in pull request

@Elsie4ever Elsie4ever changed the title IoT Hub SDK version update to 4.2.0 and fixed Get-AzIoTHub to work with DigiCert hubs [IoT]IoT Hub SDK version update to 4.2.0 and fixed Get-AzIoTHub to work with DigiCert hubs Feb 15, 2023

CertificateDescription certificateDescription;
certificateDescription = this.IotHubClient.Certificates.CreateOrUpdate(this.ResourceGroupName, this.Name, this.CertificateName, this.Etag, certificateBodyDescription.Certificate);
certificateDescription = this.IotHubClient.Certificates.CreateOrUpdate(this.ResourceGroupName, this.Name, this.CertificateName, this.Etag, certificateProperties);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to point to a copy rather than the original object here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed offline, since we are adding certificate, there is no original object, instead we would need to create a new object in order to use CreateOrUpdate. Also tested that only pass in the certificate is enough, the rest CertificateProperties properties can be figured out after the service call, this is the return after calling this command:

Id : /subscriptions/a386d5ea-ea90-441a-8263-d816368c84a1/resourceGroups/jiacjutest/providers/Microsoft.D
evices/IotHubs/newstate/certificates/certifitry
ResourceGroupName : jiacjutest
Name : newstate
CertificateName : certifitry
Subject : management
Thumbprint : 46BB6DAA9A62A4D256FC02A1F73AAB18F7724B72
Status : Unverified
Expiry : 9/27/2031 12:09
Created : 1/01/0001 00:01
Etag : IjhlMDI2ODQ1LTAwMDAtMDMwMC0wMDAwLTYzZWQ4YzZjMDAwMCI=

@Elsie4ever Elsie4ever marked this pull request as ready for review February 17, 2023 02:06
Copy link
Contributor

@BethanyZhou BethanyZhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BethanyZhou
Copy link
Contributor

/azp run azure-powershell - security-tools

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@BethanyZhou BethanyZhou merged commit 8322965 into Azure:main Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants