File tree Expand file tree Collapse file tree 5 files changed +1260
-1180
lines changed
SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubTests Expand file tree Collapse file tree 5 files changed +1260
-1180
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ function Test-AzureRmIotHubLifecycle
29
29
$Location = Get-Location " Microsoft.Devices" " IotHub"
30
30
$IotHubName = getAssetName
31
31
$ResourceGroupName = getAssetName
32
+ $SubscriptionId = ' 91d12660-3dec-467a-be2a-213b5544ddc0'
32
33
$Sku = " B1"
33
34
$namespaceName = getAssetName ' eventHub'
34
35
$eventHubName = getAssetName
@@ -97,6 +98,8 @@ function Test-AzureRmIotHubLifecycle
97
98
98
99
Assert-True { $allIotHubsInResourceGroup.Count -eq 1 }
99
100
Assert-True { $iotHub.Name -eq $IotHubName }
101
+ Assert-True { $iotHub.Resourcegroup -eq $ResourceGroupName }
102
+ Assert-True { $iotHub.Subscriptionid -eq $SubscriptionId }
100
103
Assert-True { $iotHub.Properties.Routing.Routes.Count -eq 1 }
101
104
Assert-True { $iotHub.Properties.Routing.Routes [0 ].Name -eq " route" }
102
105
Assert-True { $iotHub.Properties.Routing.Endpoints.EventHubs [0 ].Name -eq " eh1" }
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 19
19
-->
20
20
## Upcoming Release
21
21
* Add new routing source: DigitalTwinChangeEvents
22
+ * Minor bug fix: Get-AzIothub not returning subscriptionId
22
23
23
24
## Version 1.3.0
24
25
* Add support to invoke failover for an IotHub to the geo-paired disaster recovery region.
Original file line number Diff line number Diff line change @@ -299,6 +299,14 @@ public static string GetResourceGroupName(string Id)
299
299
return m . Success ? m . Groups [ "rgname" ] . Value : null ;
300
300
}
301
301
302
+ public static string GetSubscriptionId ( string Id )
303
+ {
304
+ if ( string . IsNullOrEmpty ( Id ) ) return null ;
305
+ Regex r = new Regex ( @"(.*?)/subscriptions/(?<subscriptionid>\S+)/resourcegroups/(.*?)" , RegexOptions . IgnoreCase ) ;
306
+ Match m = r . Match ( Id ) ;
307
+ return m . Success ? m . Groups [ "subscriptionid" ] . Value : null ;
308
+ }
309
+
302
310
public static string GetIotHubName ( string Id )
303
311
{
304
312
if ( string . IsNullOrEmpty ( Id ) ) return null ;
Original file line number Diff line number Diff line change @@ -54,7 +54,14 @@ public class PSIotHub
54
54
/// The subscription identifier.
55
55
/// </summary>
56
56
[ JsonProperty ( PropertyName = "subscriptionid" ) ]
57
- public string Subscriptionid { get ; set ; }
57
+ public string Subscriptionid
58
+ {
59
+ get
60
+ {
61
+ return IotHubUtils . GetSubscriptionId ( Id ) ;
62
+ }
63
+ set { }
64
+ }
58
65
59
66
/// <summary>
60
67
/// The resource group name uniquely identifies the resource group
You can’t perform that action at this time.
0 commit comments