Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.0" />
<PackageReference Include="Microsoft.Azure.Management.DeviceProvisioningServices" Version="0.10.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="4.2.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/IotHub/IotHub.Test/IotHub.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.0" />
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="5.0.0" />
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="4.2.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="25.0.0" />
</ItemGroup>

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/IotHub/IotHub/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release
* Updated IoT Hub Management SDK to version 4.2.0 (api-version 2021-07-02)
* Fixed `Get-AzIoTHub` to work with DigiCert hubs

## Version 2.7.4
* Updated IoT Hub Management SDK to version 4.1.0 (api-version 2021-07-10)
Expand Down
2 changes: 1 addition & 1 deletion src/IotHub/IotHub/IotHub.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.0" />
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.27.0" />
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="4.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" />
</ItemGroup>

Expand Down
4 changes: 3 additions & 1 deletion src/IotHub/IotHub/IotHub/AddAzureRmIotHubCertificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ public override void ExecuteCmdlet()

CertificateBodyDescription certificateBodyDescription = new CertificateBodyDescription();
certificateBodyDescription.Certificate = certificate;
CertificateProperties certificateProperties = new CertificateProperties();
certificateProperties.Certificate = certificateBodyDescription.Certificate;

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=



this.WriteObject(IotHubUtils.ToPSCertificateDescription(certificateDescription));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public class AddAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
Mandatory = true,
HelpMessage = "Name of the EventHub ConsumerGroup")]
[ValidateNotNullOrEmpty]
public string EventHubConsumerGroupName { get; set; }
public EventHubConsumerGroupName EventHubConsumerGroupName { get; set; }

public override void ExecuteCmdlet()
{
string eventsEndpointName = "events";
if (ShouldProcess(EventHubConsumerGroupName, Properties.Resources.AddEventHubConsumerGroup))
if (ShouldProcess(EventHubConsumerGroupName.Name, Properties.Resources.AddEventHubConsumerGroup))
{
this.IotHubClient.IotHubResource.CreateEventHubConsumerGroup(this.ResourceGroupName, this.Name, eventsEndpointName, this.EventHubConsumerGroupName);
this.IotHubClient.IotHubResource.CreateEventHubConsumerGroup(this.ResourceGroupName, this.Name, eventsEndpointName, this.EventHubConsumerGroupName.Name, this.EventHubConsumerGroupName);
IEnumerable<EventHubConsumerGroupInfo> iotHubEHConsumerGroups = this.IotHubClient.IotHubResource.ListEventHubConsumerGroups(this.ResourceGroupName, this.Name, eventsEndpointName);
this.WriteObject(IotHubUtils.ToPSEventHubConsumerGroupInfo(iotHubEHConsumerGroups), true);
}
Expand Down
3 changes: 2 additions & 1 deletion src/IotHub/IotHub/Models/PSCapabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public enum PSCapabilities
{
None = 0,
DeviceManagement = 1,
GWV2 = 2
GWV2 = 2,
RootCertificateV2 = 3
}
}