Skip to content

Commit d6748e4

Browse files
committed
Updated IoT Central DotNet package to 4.0.0 with support for Managed Identities
Updated IoT Central Management Plane .Net package to 4.0.0. This version supports Managed Identities, removes support for S1 SKU, and supports only regional locations (not geographic). Related: .NET SDK update PR: Azure/azure-sdk-for-net#24992 Swagger update PR: Azure/azure-rest-api-specs#16139
1 parent d1f7ed5 commit d6748e4

File tree

19 files changed

+510
-431
lines changed

19 files changed

+510
-431
lines changed

src/IotCentral/IotCentral.Test/IotCentral.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.IotCentral" Version="3.1.0" />
14+
<PackageReference Include="Microsoft.Azure.Management.IotCentral" Version="4.0.0" />
1515
</ItemGroup>
1616

1717
</Project>

src/IotCentral/IotCentral.Test/ScenarioTests/IotCentralController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void RunPsTestWorkflow(
7979
};
8080
var providersToIgnore = new Dictionary<string, string>
8181
{
82-
{"Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01"},
82+
{"Microsoft.Azure.Management.Resources.ResourceManagementClient", "2021_04_01"},
8383
{"Microsoft.Azure.Management.ResourceManager.ResourceManagementClient", "2017-05-10"},
8484
{"Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient", "2016-09-01"}
8585
};

src/IotCentral/IotCentral.Test/ScenarioTests/IotCentralTests.ps1

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ function Test-IotCentralAppLifecycleManagement{
3535
$tagKey = "key1"
3636
$tagValue = "value1"
3737
$tags = @{ $tagKey = $tagValue }
38-
38+
$identity = "SystemAssigned"
39+
3940
try
4041
{
4142
# Test
4243

4344
# Create Resource Group
4445
New-AzResourceGroup -Name $rgname -Location $location
4546

46-
# Create App
47-
$created = New-AzIotCentralApp -ResourceGroupName $rgname -Name $rname -Subdomain $subdomain -Sku $st2Sku -DisplayName $displayName -Tag $tags
47+
# Create and Validate App with System-Assigned Managed Identity
48+
$created = New-AzIotCentralApp -ResourceGroupName $rgname -Name $rname -Subdomain $subdomain -Sku $st2Sku -DisplayName $displayName -Tag $tags -Identity $identity
4849
$actual = Get-AzIotCentralApp -ResourceGroupName $rgname -Name $rname
49-
5050
$list = Get-AzIotCentralApp -ResourceGroupName $rgname
5151

5252
# Assert
@@ -57,11 +57,15 @@ function Test-IotCentralAppLifecycleManagement{
5757
Assert-AreEqual 1 @($list).Count
5858
Assert-AreEqual $actual.Name $list[0].Name
5959
Assert-AreEqual $actual.Sku.Name $st2Sku
60+
Assert-NotNull $actual.Identity
61+
Assert-NotNull $actual.Identity.Type
62+
Assert-AreEqual $actual.Identity.Type "SystemAssigned"
6063

6164
# Get App
6265
$rname1 = $rname
6366
$rname2 = ($rname1) + "-2"
6467

68+
# Create another app without Managed Identity and validate Get responses.
6569
New-AzIotCentralApp $rgname $rname2 $rname2
6670
$list = Get-AzIotCentralApp -ResourceGroupName $rgname
6771
$app1 = $list | where {$_.Name -eq $rname1} | Select-Object -First 1
@@ -75,6 +79,8 @@ function Test-IotCentralAppLifecycleManagement{
7579
Assert-AreEqual $rname2 $app2.Subdomain
7680
Assert-AreEqual $resourceType $app1.Type
7781
Assert-AreEqual $resourceType $app2.Type
82+
Assert-AreEqual $app1.Identity.Type "SystemAssigned"
83+
Assert-AreEqual $app2.Identity.Type "None"
7884

7985
# Test getting from empty group
8086
$emptyrg = ($rgname) + "empty"

src/IotCentral/IotCentral.Test/SessionRecords/Microsoft.Azure.Commands.IotCentral.Test.ScenarioTests.IotCentralTests/TestIotCentralAppLifecycleManagement.json

Lines changed: 395 additions & 405 deletions
Large diffs are not rendered by default.

src/IotCentral/IotCentral/Az.IotCentral.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.9.0'
15+
ModuleVersion = '1.0.0'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -110,7 +110,7 @@ PrivateData = @{
110110
# IconUri = ''
111111

112112
# ReleaseNotes of this module
113-
ReleaseNotes = '* Update our Azure PowerShell command to use our latest released .NET package with the version of 3.1.0.'
113+
ReleaseNotes = '* Update our Azure PowerShell command to use our latest released .NET package with the version of 4.0.0.'
114114

115115
# Prerelease string of this module
116116
# Prerelease = ''

src/IotCentral/IotCentral/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
-->
2020
## Upcoming Release
2121

22+
## Version 1.0.0
23+
* Stable release version, updated to IoT Central .NET Management Plane SDK version 4.0.0.
24+
* This change introduces support for System-Assigned Managed Identities, adds support for regional locations like 'eastus' (while removing support for geographic locations like 'unitedstates'), and removes support for legacy S1 sku.
25+
2226
## Version 0.9.0
2327
* Update our Azure PowerShell command to use our latest released .NET package with the version of 3.1.0.
2428

src/IotCentral/IotCentral/Common/IotCentralUtils.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414

1515
using Microsoft.Azure.Commands.IotCentral.Models;
1616
using Microsoft.Azure.Management.IotCentral.Models;
17-
using Newtonsoft.Json;
1817
using System.Collections.Generic;
1918
using System.Linq;
20-
using System.Management.Automation;
2119

2220
namespace Microsoft.Azure.Commands.IotCentral.Common
2321
{
@@ -35,13 +33,13 @@ public static IEnumerable<PSIotCentralApp> ToPSIotCentralApps(IEnumerable<App> i
3533

3634
public static AppPatch CreateAppPatch(App iotCentralApp)
3735
{
38-
var copiedIotCenralApp = new AppPatch()
36+
var copiedIotCentralApp = new AppPatch()
3937
{
4038
DisplayName = iotCentralApp.DisplayName,
4139
Tags = iotCentralApp.Tags,
4240
Subdomain = iotCentralApp.Subdomain
4341
};
44-
return copiedIotCenralApp;
42+
return copiedIotCentralApp;
4543
}
4644
}
4745
}

src/IotCentral/IotCentral/IotCentral.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.Azure.Management.IotCentral" Version="3.1.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.IotCentral" Version="4.0.0" />
1616
</ItemGroup>
1717

1818
</Project>

src/IotCentral/IotCentral/IotCentral.generated.format.ps1xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<Alignment>Left</Alignment>
3737
<Label>Sku Name</Label>
3838
</TableColumnHeader>
39+
<TableColumnHeader>
40+
<Alignment>Left</Alignment>
41+
<Label>Identity</Label>
42+
</TableColumnHeader>
3943
<TableColumnHeader>
4044
<Alignment>Left</Alignment>
4145
<Label>Resource Group Name</Label>

src/IotCentral/IotCentral/IotCentral/GetAzureRmIotCentralApp.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using Microsoft.Azure.Management.IotCentral;
2020
using Microsoft.Azure.Management.IotCentral.Models;
2121
using System.Collections.Generic;
22-
using System.Linq;
2322
using System.Management.Automation;
2423

2524
namespace Microsoft.Azure.Commands.Management.IotCentral

0 commit comments

Comments
 (0)