From dd75697f0a630c8ea6f1c7cafab22c2057c8be8a Mon Sep 17 00:00:00 2001 From: Sapan Saxena <31940305+anusapan@users.noreply.github.com> Date: Wed, 8 Apr 2020 23:31:14 -0700 Subject: [PATCH] Manage IoT automatic device management configuration (#11516) --- .../IotHubDPConfigurationTests.cs | 40 + .../IotHubDPConfigurationTests.ps1 | 81 + ...TestAzureIotHubConfigurationLifecycle.json | 1381 +++++++++++++++++ src/IotHub/IotHub/Az.IotHub.psd1 | 4 +- src/IotHub/IotHub/ChangeLog.md | 5 + .../IotHub/Common/IotHubDataPlaneUtils.cs | 15 + src/IotHub/IotHub/IotHub.format.ps1xml | 111 ++ .../Configuration/AddAzIotHubConfiguration.cs | 139 ++ .../Configuration/GetAzIotHubConfiguration.cs | 92 ++ .../RemoveAzIotHubConfiguration.cs | 119 ++ .../Configuration/SetAzIotHubConfiguration.cs | 130 ++ .../DataPlane/Models/PSConfiguration.cs | 101 ++ .../Models/PSConfigurationContent.cs | 38 + .../Models/PSConfigurationMetrics.cs | 38 + .../IotHub/Properties/Resources.Designer.cs | 27 + src/IotHub/IotHub/Properties/Resources.resx | 9 + .../IotHub/help/Add-AzIotHubConfiguration.md | 304 ++++ src/IotHub/IotHub/help/Az.IotHub.md | 12 + .../IotHub/help/Get-AzIotHubConfiguration.md | 162 ++ .../help/Remove-AzIotHubConfiguration.md | 199 +++ .../IotHub/help/Set-AzIotHubConfiguration.md | 263 ++++ tools/SecurityTools/CredScanSuppressions.json | 4 + 22 files changed, 3273 insertions(+), 1 deletion(-) create mode 100644 src/IotHub/IotHub.Test/ScenarioTests/IotHubDPConfigurationTests.cs create mode 100644 src/IotHub/IotHub.Test/ScenarioTests/IotHubDPConfigurationTests.ps1 create mode 100644 src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPConfigurationTests/TestAzureIotHubConfigurationLifecycle.json create mode 100644 src/IotHub/IotHub/IotHub/DataPlane/Configuration/AddAzIotHubConfiguration.cs create mode 100644 src/IotHub/IotHub/IotHub/DataPlane/Configuration/GetAzIotHubConfiguration.cs create mode 100644 src/IotHub/IotHub/IotHub/DataPlane/Configuration/RemoveAzIotHubConfiguration.cs create mode 100644 src/IotHub/IotHub/IotHub/DataPlane/Configuration/SetAzIotHubConfiguration.cs create mode 100644 src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfiguration.cs create mode 100644 src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfigurationContent.cs create mode 100644 src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfigurationMetrics.cs create mode 100644 src/IotHub/IotHub/help/Add-AzIotHubConfiguration.md create mode 100644 src/IotHub/IotHub/help/Get-AzIotHubConfiguration.md create mode 100644 src/IotHub/IotHub/help/Remove-AzIotHubConfiguration.md create mode 100644 src/IotHub/IotHub/help/Set-AzIotHubConfiguration.md diff --git a/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPConfigurationTests.cs b/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPConfigurationTests.cs new file mode 100644 index 000000000000..d105b4c5ab80 --- /dev/null +++ b/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPConfigurationTests.cs @@ -0,0 +1,40 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.ServiceManagement.Common.Models; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.Azure.Commands.IotHub.Test.ScenarioTests +{ + public class IotHubDPConfigurationTests : RMTestBase + { + public XunitTracingInterceptor _logger; + + public IotHubDPConfigurationTests(ITestOutputHelper output) + { + _logger = new XunitTracingInterceptor(output); + XunitTracingInterceptor.AddToContext(_logger); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.LiveOnly)] + public void TestAzureIotHubConfigurationLifecycle() + { + IotHubController.NewInstance.RunPsTest(_logger, "Test-AzureRmIotHubConfigurationLifecycle"); + } + } +} diff --git a/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPConfigurationTests.ps1 b/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPConfigurationTests.ps1 new file mode 100644 index 000000000000..d1fecc3bb1ff --- /dev/null +++ b/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPConfigurationTests.ps1 @@ -0,0 +1,81 @@ +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + + +#################################### +## IotHub Configuration Cmdlets ## +#################################### + +<# +.SYNOPSIS +Test all iothub configuration cmdlets +#> +function Test-AzureRmIotHubConfigurationLifecycle +{ + $Location = Get-Location "Microsoft.Devices" "IotHubs" + $IotHubName = getAssetName + $ResourceGroupName = getAssetName + $Sku = "S1" + $device1 = getAssetName + $config1 = getAssetName + $config2 = getAssetName + + # Create Resource Group + $resourceGroup = New-AzResourceGroup -Name $ResourceGroupName -Location $Location + + # Create Iot Hub + $iothub = New-AzIotHub -Name $IotHubName -ResourceGroupName $ResourceGroupName -Location $Location -SkuName $Sku -Units 1 + + # Add iot device + $newDevice1 = Add-AzIotHubDevice -ResourceGroupName $ResourceGroupName -IotHubName $IotHubName -DeviceId $device1 -AuthMethod 'shared_private_key' + Assert-True { $newDevice1.Id -eq $device1 } + Assert-False { $newDevice1.Capabilities.IotEdge } + + # Assign device configuration parameters + $labels = @{} + $labels.add("key0","value0") + $metrics = @{} + $metrics.add("query1", "select deviceId from devices where tags.location='US'") + $prop = @{} + $prop.add("Location", "US") + $content = @{} + $content.add("properties.desired.Region", $prop) + $condition = "tags.location ='US'" + $priority = 10 + $updatedPriority = 8 + + # Add device configuration + $newConfiguration = Add-AzIotHubConfiguration -ResourceGroupName $ResourceGroupName -IotHubName $IotHubName -Name $config1 -Priority $priority -TargetCondition $condition -Label $labels -Metric $metrics -DeviceContent $content + Assert-True { $newConfiguration.Id -eq $config1} + + # Get device configuration details + $configuration = Get-AzIotHubConfiguration -ResourceGroupName $ResourceGroupName -IotHubName $IotHubName -Name $config1 + Assert-True { $configuration.Id -eq $config1} + Assert-True { $configuration.TargetCondition -eq $condition} + Assert-True { $configuration.Priority -eq $priority} + Assert-True { $configuration.Labels.Count -eq 1} + Assert-True { $configuration.Metrics.Count -eq 1} + + # Set device configuration + $updatedConfiguration = Set-AzIotHubConfiguration -ResourceGroupName $ResourceGroupName -IotHubName $IotHubName -Name $config1 -Priority $updatedPriority + Assert-True { $updatedConfiguration.Id -eq $config1} + Assert-True { $updatedConfiguration.Priority -eq $updatedPriority} + + # Delete all configuration + $result = Remove-AzIotHubConfiguration -ResourceGroupName $ResourceGroupName -IotHubName $IotHubName -Passthru + Assert-True { $result } + + # Remove IotHub + Remove-AzIotHub -ResourceGroupName $ResourceGroupName -Name $IotHubName +} \ No newline at end of file diff --git a/src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPConfigurationTests/TestAzureIotHubConfigurationLifecycle.json b/src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPConfigurationTests/TestAzureIotHubConfigurationLifecycle.json new file mode 100644 index 000000000000..f05f396bded8 --- /dev/null +++ b/src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPConfigurationTests/TestAzureIotHubConfigurationLifecycle.json @@ -0,0 +1,1381 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "32b6921c-aca3-4d43-9437-66a7191874ea" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.11" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "fbacd33a-a58c-4c4e-aed8-3e10cf556ce4" + ], + "x-ms-correlation-request-id": [ + "fbacd33a-a58c-4c4e-aed8-3e10cf556ce4" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034225Z:fbacd33a-a58c-4c4e-aed8-3e10cf556ce4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:42:25 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "5727" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices\",\r\n \"namespace\": \"Microsoft.Devices\",\r\n \"authorizations\": [\r\n {\r\n \"applicationId\": \"0cd79364-7a90-4354-9984-6e36c841418d\",\r\n \"roleDefinitionId\": \"C121DF10-FE58-4BC4-97F9-8296879F7BBB\"\r\n },\r\n {\r\n \"applicationId\": \"29f411f1-b2cf-4043-8ac8-2185d7316811\"\r\n },\r\n {\r\n \"applicationId\": \"89d10474-74af-4874-99a7-c23c2f643083\",\r\n \"roleDefinitionId\": \"7df22794-26e3-4f94-9d50-a4f0f6e1cb41\"\r\n }\r\n ],\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"checkNameAvailability\",\r\n \"locations\": [\r\n \"Central US EUAP\",\r\n \"East US 2 EUAP\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"East US\",\r\n \"South Central US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01\",\r\n \"2018-04-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"checkProvisioningServiceNameAvailability\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2018-01-22\",\r\n \"2017-11-15\",\r\n \"2017-08-21-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"usages\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-03-01\",\r\n \"2019-11-04\",\r\n \"2019-07-01-preview\",\r\n \"2019-03-22-preview\",\r\n \"2019-03-22\",\r\n \"2018-12-01-preview\",\r\n \"2018-04-01\",\r\n \"2018-01-22\",\r\n \"2017-07-01\",\r\n \"2017-01-19\",\r\n \"2016-02-03\",\r\n \"2015-08-15-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-03-01\",\r\n \"2019-11-04\",\r\n \"2019-07-01-preview\",\r\n \"2019-03-22-preview\",\r\n \"2019-03-22\",\r\n \"2018-12-01-preview\",\r\n \"2018-04-01\",\r\n \"2018-01-22\",\r\n \"2017-07-01\",\r\n \"2017-01-19\",\r\n \"2016-02-03\",\r\n \"2015-08-15-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operationResults\",\r\n \"locations\": [\r\n \"Central US EUAP\",\r\n \"East US 2 EUAP\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"East US\",\r\n \"South Central US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01\",\r\n \"2018-04-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"IotHubs\",\r\n \"locations\": [\r\n \"West US\",\r\n \"North Europe\",\r\n \"East Asia\",\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"South India\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"Brazil South\",\r\n \"South Central US\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"North Central US\",\r\n \"Central US EUAP\",\r\n \"East US 2 EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01\",\r\n \"2020-01-01\",\r\n \"2019-11-04\",\r\n \"2019-07-01-preview\",\r\n \"2019-03-22-preview\",\r\n \"2019-03-22\",\r\n \"2018-12-01-preview\",\r\n \"2018-04-01\",\r\n \"2018-01-22\",\r\n \"2017-07-01\",\r\n \"2017-01-19\",\r\n \"2016-02-03\",\r\n \"2015-08-15-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity\"\r\n },\r\n {\r\n \"resourceType\": \"IotHubs/eventGridFilters\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"South India\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"Brazil South\",\r\n \"South Central US\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"North Central US\",\r\n \"Central US EUAP\",\r\n \"East US 2 EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2018-07-31\",\r\n \"2018-01-15-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"ProvisioningServices\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West US\",\r\n \"West Europe\",\r\n \"North Europe\",\r\n \"Southeast Asia\",\r\n \"East Asia\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Japan East\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-01-01\",\r\n \"2018-01-22\",\r\n \"2017-11-15\",\r\n \"2017-08-21-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity\"\r\n },\r\n {\r\n \"resourceType\": \"ElasticPools\",\r\n \"locations\": [\r\n \"Central US EUAP\",\r\n \"East US 2 EUAP\",\r\n \"West US\",\r\n \"North Europe\",\r\n \"East Asia\",\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"South India\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"Brazil South\",\r\n \"South Central US\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"North Central US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2019-07-01-preview\",\r\n \"2019-03-22-preview\",\r\n \"2018-01-22-preview\",\r\n \"2017-09-25-preview\",\r\n \"2017-07-01\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"ElasticPools/IotHubTenants\",\r\n \"locations\": [\r\n \"Central US EUAP\",\r\n \"East US 2 EUAP\",\r\n \"West US\",\r\n \"North Europe\",\r\n \"East Asia\",\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"South India\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"Brazil South\",\r\n \"South Central US\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"North Central US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2019-07-01-preview\",\r\n \"2019-03-22-preview\",\r\n \"2018-01-22-preview\",\r\n \"2017-09-25-preview\",\r\n \"2017-07-01\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"IotHubs/securitySettings\",\r\n \"locations\": [\r\n \"Central US EUAP\",\r\n \"East US 2 EUAP\",\r\n \"West US\",\r\n \"North Europe\",\r\n \"East Asia\",\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"South India\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"Brazil South\",\r\n \"South Central US\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"North Central US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2019-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"ElasticPools/IotHubTenants/securitySettings\",\r\n \"locations\": [\r\n \"Central US EUAP\",\r\n \"East US 2 EUAP\",\r\n \"West US\",\r\n \"North Europe\",\r\n \"East Asia\",\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"West US 2\",\r\n \"West Central US\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"South India\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"Brazil South\",\r\n \"South Central US\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"North Central US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2019-09-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourcegroups/ps4604?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlZ3JvdXBzL3BzNDYwND9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5ff2d2b3-c9ae-42e3-aaa6-8f0fdaaa0211" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.11" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "29" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "3820ab32-e050-47a3-8a94-8d5e60ebeb1e" + ], + "x-ms-correlation-request-id": [ + "3820ab32-e050-47a3-8a94-8d5e60ebeb1e" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034226Z:3820ab32-e050-47a3-8a94-8d5e60ebeb1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:42:26 GMT" + ], + "Content-Length": [ + "165" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604\",\r\n \"name\": \"ps4604\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"capacity\": 1\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "97248025-1e97-4013-b8a0-927c5b84060e" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "85" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfZmIxY2UxN2QtNzI4MC00ZmU3LWI3MGYtZDdiMzJkMTNjZGQx?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "4999" + ], + "x-ms-request-id": [ + "fb75a9cd-a9d8-42d2-8874-fbf21af56e67" + ], + "x-ms-correlation-request-id": [ + "fb75a9cd-a9d8-42d2-8874-fbf21af56e67" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034246Z:fb75a9cd-a9d8-42d2-8874-fbf21af56e67" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:42:45 GMT" + ], + "Content-Length": [ + "619" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527\",\r\n \"name\": \"ps8527\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps4604\",\r\n \"properties\": {\r\n \"state\": \"Activating\",\r\n \"provisioningState\": \"Accepted\",\r\n \"enableFileUploadNotifications\": false,\r\n \"cloudToDevice\": {\r\n \"maxDeliveryCount\": 10,\r\n \"defaultTtlAsIso8601\": \"PT1H\",\r\n \"feedback\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"features\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfZmIxY2UxN2QtNzI4MC00ZmU3LWI3MGYtZDdiMzJkMTNjZGQx?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmWm1JeFkyVXhOMlF0TnpJNE1DMDBabVUzTFdJM01HWXRaRGRpTXpKa01UTmpaR1F4P2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWgmYXN5bmNpbmZv", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "20ceb1e6-ed4d-4b23-92ba-fc75d1b98ed7" + ], + "x-ms-correlation-request-id": [ + "20ceb1e6-ed4d-4b23-92ba-fc75d1b98ed7" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034316Z:20ceb1e6-ed4d-4b23-92ba-fc75d1b98ed7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:43:16 GMT" + ], + "Content-Length": [ + "20" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Running\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfZmIxY2UxN2QtNzI4MC00ZmU3LWI3MGYtZDdiMzJkMTNjZGQx?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmWm1JeFkyVXhOMlF0TnpJNE1DMDBabVUzTFdJM01HWXRaRGRpTXpKa01UTmpaR1F4P2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWgmYXN5bmNpbmZv", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-request-id": [ + "881e4b2f-73f1-4877-9c01-20bf6dce9986" + ], + "x-ms-correlation-request-id": [ + "881e4b2f-73f1-4877-9c01-20bf6dce9986" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034347Z:881e4b2f-73f1-4877-9c01-20bf6dce9986" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:43:47 GMT" + ], + "Content-Length": [ + "20" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Running\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfZmIxY2UxN2QtNzI4MC00ZmU3LWI3MGYtZDdiMzJkMTNjZGQx?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmWm1JeFkyVXhOMlF0TnpJNE1DMDBabVUzTFdJM01HWXRaRGRpTXpKa01UTmpaR1F4P2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWgmYXN5bmNpbmZv", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-request-id": [ + "9ae8d6ee-ef8c-410f-8af7-cf7a700d4ce6" + ], + "x-ms-correlation-request-id": [ + "9ae8d6ee-ef8c-410f-8af7-cf7a700d4ce6" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034417Z:9ae8d6ee-ef8c-410f-8af7-cf7a700d4ce6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:16 GMT" + ], + "Content-Length": [ + "20" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Running\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfZmIxY2UxN2QtNzI4MC00ZmU3LWI3MGYtZDdiMzJkMTNjZGQx?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmWm1JeFkyVXhOMlF0TnpJNE1DMDBabVUzTFdJM01HWXRaRGRpTXpKa01UTmpaR1F4P2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWgmYXN5bmNpbmZv", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "f311d63b-7da6-40e5-b9a8-3796dcf45b01" + ], + "x-ms-correlation-request-id": [ + "f311d63b-7da6-40e5-b9a8-3796dcf45b01" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034447Z:f311d63b-7da6-40e5-b9a8-3796dcf45b01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:47 GMT" + ], + "Content-Length": [ + "22" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-request-id": [ + "7ec2444e-1a96-4afe-a0c7-181656c0bc7a" + ], + "x-ms-correlation-request-id": [ + "7ec2444e-1a96-4afe-a0c7-181656c0bc7a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034448Z:7ec2444e-1a96-4afe-a0c7-181656c0bc7a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:48 GMT" + ], + "Content-Length": [ + "1460" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527\",\r\n \"name\": \"ps8527\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps4604\",\r\n \"etag\": \"AAAAAAyfr4U=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"East US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps8527.azure-devices.net\",\r\n \"eventHubEndpoints\": {\r\n \"events\": {\r\n \"retentionTimeInDays\": 1,\r\n \"partitionCount\": 4,\r\n \"partitionIds\": [\r\n \"0\",\r\n \"1\",\r\n \"2\",\r\n \"3\"\r\n ],\r\n \"path\": \"ps8527\",\r\n \"endpoint\": \"sb://iothub-ns-ps8527-3214461-98a097c640.servicebus.windows.net/\"\r\n }\r\n },\r\n \"routing\": {\r\n \"endpoints\": {\r\n \"serviceBusQueues\": [],\r\n \"serviceBusTopics\": [],\r\n \"eventHubs\": [],\r\n \"storageContainers\": []\r\n },\r\n \"routes\": [],\r\n \"fallbackRoute\": {\r\n \"name\": \"$fallback\",\r\n \"source\": \"DeviceMessages\",\r\n \"condition\": \"true\",\r\n \"endpointNames\": [\r\n \"events\"\r\n ],\r\n \"isEnabled\": true\r\n }\r\n },\r\n \"storageEndpoints\": {\r\n \"$default\": {\r\n \"sasTtlAsIso8601\": \"PT1H\",\r\n \"connectionString\": \"\",\r\n \"containerName\": \"\"\r\n }\r\n },\r\n \"messagingEndpoints\": {\r\n \"fileNotifications\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"enableFileUploadNotifications\": false,\r\n \"cloudToDevice\": {\r\n \"maxDeliveryCount\": 10,\r\n \"defaultTtlAsIso8601\": \"PT1H\",\r\n \"feedback\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"features\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8acb5a88-3b87-4d89-b2bb-9ac7d4de4f19" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-request-id": [ + "4a9c64b2-1d4f-47c9-b733-d89e2273cba7" + ], + "x-ms-correlation-request-id": [ + "4a9c64b2-1d4f-47c9-b733-d89e2273cba7" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034449Z:4a9c64b2-1d4f-47c9-b733-d89e2273cba7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:48 GMT" + ], + "Content-Length": [ + "1460" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527\",\r\n \"name\": \"ps8527\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps4604\",\r\n \"etag\": \"AAAAAAyfr4U=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"East US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps8527.azure-devices.net\",\r\n \"eventHubEndpoints\": {\r\n \"events\": {\r\n \"retentionTimeInDays\": 1,\r\n \"partitionCount\": 4,\r\n \"partitionIds\": [\r\n \"0\",\r\n \"1\",\r\n \"2\",\r\n \"3\"\r\n ],\r\n \"path\": \"ps8527\",\r\n \"endpoint\": \"sb://iothub-ns-ps8527-3214461-98a097c640.servicebus.windows.net/\"\r\n }\r\n },\r\n \"routing\": {\r\n \"endpoints\": {\r\n \"serviceBusQueues\": [],\r\n \"serviceBusTopics\": [],\r\n \"eventHubs\": [],\r\n \"storageContainers\": []\r\n },\r\n \"routes\": [],\r\n \"fallbackRoute\": {\r\n \"name\": \"$fallback\",\r\n \"source\": \"DeviceMessages\",\r\n \"condition\": \"true\",\r\n \"endpointNames\": [\r\n \"events\"\r\n ],\r\n \"isEnabled\": true\r\n }\r\n },\r\n \"storageEndpoints\": {\r\n \"$default\": {\r\n \"sasTtlAsIso8601\": \"PT1H\",\r\n \"connectionString\": \"\",\r\n \"containerName\": \"\"\r\n }\r\n },\r\n \"messagingEndpoints\": {\r\n \"fileNotifications\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"enableFileUploadNotifications\": false,\r\n \"cloudToDevice\": {\r\n \"maxDeliveryCount\": 10,\r\n \"defaultTtlAsIso8601\": \"PT1H\",\r\n \"feedback\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"features\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3fb017c5-1c41-4e35-801c-35fda329003a" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-request-id": [ + "389f98fb-32d4-431a-9417-7fdcb9e82ec7" + ], + "x-ms-correlation-request-id": [ + "389f98fb-32d4-431a-9417-7fdcb9e82ec7" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034449Z:389f98fb-32d4-431a-9417-7fdcb9e82ec7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:49 GMT" + ], + "Content-Length": [ + "1460" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527\",\r\n \"name\": \"ps8527\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps4604\",\r\n \"etag\": \"AAAAAAyfr4U=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"East US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps8527.azure-devices.net\",\r\n \"eventHubEndpoints\": {\r\n \"events\": {\r\n \"retentionTimeInDays\": 1,\r\n \"partitionCount\": 4,\r\n \"partitionIds\": [\r\n \"0\",\r\n \"1\",\r\n \"2\",\r\n \"3\"\r\n ],\r\n \"path\": \"ps8527\",\r\n \"endpoint\": \"sb://iothub-ns-ps8527-3214461-98a097c640.servicebus.windows.net/\"\r\n }\r\n },\r\n \"routing\": {\r\n \"endpoints\": {\r\n \"serviceBusQueues\": [],\r\n \"serviceBusTopics\": [],\r\n \"eventHubs\": [],\r\n \"storageContainers\": []\r\n },\r\n \"routes\": [],\r\n \"fallbackRoute\": {\r\n \"name\": \"$fallback\",\r\n \"source\": \"DeviceMessages\",\r\n \"condition\": \"true\",\r\n \"endpointNames\": [\r\n \"events\"\r\n ],\r\n \"isEnabled\": true\r\n }\r\n },\r\n \"storageEndpoints\": {\r\n \"$default\": {\r\n \"sasTtlAsIso8601\": \"PT1H\",\r\n \"connectionString\": \"\",\r\n \"containerName\": \"\"\r\n }\r\n },\r\n \"messagingEndpoints\": {\r\n \"fileNotifications\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"enableFileUploadNotifications\": false,\r\n \"cloudToDevice\": {\r\n \"maxDeliveryCount\": 10,\r\n \"defaultTtlAsIso8601\": \"PT1H\",\r\n \"feedback\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"features\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "34f5b2c2-d9a5-4122-9f62-a58b3dddf206" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-request-id": [ + "46fe9b48-0a1f-4dcb-9599-0d666ff2b648" + ], + "x-ms-correlation-request-id": [ + "46fe9b48-0a1f-4dcb-9599-0d666ff2b648" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034450Z:46fe9b48-0a1f-4dcb-9599-0d666ff2b648" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:50 GMT" + ], + "Content-Length": [ + "1460" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527\",\r\n \"name\": \"ps8527\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps4604\",\r\n \"etag\": \"AAAAAAyfr4U=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"East US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps8527.azure-devices.net\",\r\n \"eventHubEndpoints\": {\r\n \"events\": {\r\n \"retentionTimeInDays\": 1,\r\n \"partitionCount\": 4,\r\n \"partitionIds\": [\r\n \"0\",\r\n \"1\",\r\n \"2\",\r\n \"3\"\r\n ],\r\n \"path\": \"ps8527\",\r\n \"endpoint\": \"sb://iothub-ns-ps8527-3214461-98a097c640.servicebus.windows.net/\"\r\n }\r\n },\r\n \"routing\": {\r\n \"endpoints\": {\r\n \"serviceBusQueues\": [],\r\n \"serviceBusTopics\": [],\r\n \"eventHubs\": [],\r\n \"storageContainers\": []\r\n },\r\n \"routes\": [],\r\n \"fallbackRoute\": {\r\n \"name\": \"$fallback\",\r\n \"source\": \"DeviceMessages\",\r\n \"condition\": \"true\",\r\n \"endpointNames\": [\r\n \"events\"\r\n ],\r\n \"isEnabled\": true\r\n }\r\n },\r\n \"storageEndpoints\": {\r\n \"$default\": {\r\n \"sasTtlAsIso8601\": \"PT1H\",\r\n \"connectionString\": \"\",\r\n \"containerName\": \"\"\r\n }\r\n },\r\n \"messagingEndpoints\": {\r\n \"fileNotifications\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"enableFileUploadNotifications\": false,\r\n \"cloudToDevice\": {\r\n \"maxDeliveryCount\": 10,\r\n \"defaultTtlAsIso8601\": \"PT1H\",\r\n \"feedback\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"features\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b9524ac2-fe58-46ca-868a-37d491f3627a" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11991" + ], + "x-ms-request-id": [ + "6209fd1d-b5c2-42ad-871a-0644e14d3956" + ], + "x-ms-correlation-request-id": [ + "6209fd1d-b5c2-42ad-871a-0644e14d3956" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034451Z:6209fd1d-b5c2-42ad-871a-0644e14d3956" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:51 GMT" + ], + "Content-Length": [ + "1460" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527\",\r\n \"name\": \"ps8527\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps4604\",\r\n \"etag\": \"AAAAAAyfr4U=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"East US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps8527.azure-devices.net\",\r\n \"eventHubEndpoints\": {\r\n \"events\": {\r\n \"retentionTimeInDays\": 1,\r\n \"partitionCount\": 4,\r\n \"partitionIds\": [\r\n \"0\",\r\n \"1\",\r\n \"2\",\r\n \"3\"\r\n ],\r\n \"path\": \"ps8527\",\r\n \"endpoint\": \"sb://iothub-ns-ps8527-3214461-98a097c640.servicebus.windows.net/\"\r\n }\r\n },\r\n \"routing\": {\r\n \"endpoints\": {\r\n \"serviceBusQueues\": [],\r\n \"serviceBusTopics\": [],\r\n \"eventHubs\": [],\r\n \"storageContainers\": []\r\n },\r\n \"routes\": [],\r\n \"fallbackRoute\": {\r\n \"name\": \"$fallback\",\r\n \"source\": \"DeviceMessages\",\r\n \"condition\": \"true\",\r\n \"endpointNames\": [\r\n \"events\"\r\n ],\r\n \"isEnabled\": true\r\n }\r\n },\r\n \"storageEndpoints\": {\r\n \"$default\": {\r\n \"sasTtlAsIso8601\": \"PT1H\",\r\n \"connectionString\": \"\",\r\n \"containerName\": \"\"\r\n }\r\n },\r\n \"messagingEndpoints\": {\r\n \"fileNotifications\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"enableFileUploadNotifications\": false,\r\n \"cloudToDevice\": {\r\n \"maxDeliveryCount\": 10,\r\n \"defaultTtlAsIso8601\": \"PT1H\",\r\n \"feedback\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"features\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "068aad50-0e80-4720-8eda-5391faf7a277" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11990" + ], + "x-ms-request-id": [ + "79ba5f0a-fea4-4571-ab0b-8db38db86838" + ], + "x-ms-correlation-request-id": [ + "79ba5f0a-fea4-4571-ab0b-8db38db86838" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034452Z:79ba5f0a-fea4-4571-ab0b-8db38db86838" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:52 GMT" + ], + "Content-Length": [ + "1460" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527\",\r\n \"name\": \"ps8527\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps4604\",\r\n \"etag\": \"AAAAAAyfr4U=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"East US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps8527.azure-devices.net\",\r\n \"eventHubEndpoints\": {\r\n \"events\": {\r\n \"retentionTimeInDays\": 1,\r\n \"partitionCount\": 4,\r\n \"partitionIds\": [\r\n \"0\",\r\n \"1\",\r\n \"2\",\r\n \"3\"\r\n ],\r\n \"path\": \"ps8527\",\r\n \"endpoint\": \"sb://iothub-ns-ps8527-3214461-98a097c640.servicebus.windows.net/\"\r\n }\r\n },\r\n \"routing\": {\r\n \"endpoints\": {\r\n \"serviceBusQueues\": [],\r\n \"serviceBusTopics\": [],\r\n \"eventHubs\": [],\r\n \"storageContainers\": []\r\n },\r\n \"routes\": [],\r\n \"fallbackRoute\": {\r\n \"name\": \"$fallback\",\r\n \"source\": \"DeviceMessages\",\r\n \"condition\": \"true\",\r\n \"endpointNames\": [\r\n \"events\"\r\n ],\r\n \"isEnabled\": true\r\n }\r\n },\r\n \"storageEndpoints\": {\r\n \"$default\": {\r\n \"sasTtlAsIso8601\": \"PT1H\",\r\n \"connectionString\": \"\",\r\n \"containerName\": \"\"\r\n }\r\n },\r\n \"messagingEndpoints\": {\r\n \"fileNotifications\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"enableFileUploadNotifications\": false,\r\n \"cloudToDevice\": {\r\n \"maxDeliveryCount\": 10,\r\n \"defaultTtlAsIso8601\": \"PT1H\",\r\n \"feedback\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"features\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d29c70f3-6f36-4a02-ac32-922df408ee53" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "x-ms-request-id": [ + "def6ba7e-9a3d-419b-b531-e9cc79eaec0e" + ], + "x-ms-correlation-request-id": [ + "def6ba7e-9a3d-419b-b531-e9cc79eaec0e" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034453Z:def6ba7e-9a3d-419b-b531-e9cc79eaec0e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:53 GMT" + ], + "Content-Length": [ + "1460" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527\",\r\n \"name\": \"ps8527\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps4604\",\r\n \"etag\": \"AAAAAAyfr4U=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"East US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps8527.azure-devices.net\",\r\n \"eventHubEndpoints\": {\r\n \"events\": {\r\n \"retentionTimeInDays\": 1,\r\n \"partitionCount\": 4,\r\n \"partitionIds\": [\r\n \"0\",\r\n \"1\",\r\n \"2\",\r\n \"3\"\r\n ],\r\n \"path\": \"ps8527\",\r\n \"endpoint\": \"sb://iothub-ns-ps8527-3214461-98a097c640.servicebus.windows.net/\"\r\n }\r\n },\r\n \"routing\": {\r\n \"endpoints\": {\r\n \"serviceBusQueues\": [],\r\n \"serviceBusTopics\": [],\r\n \"eventHubs\": [],\r\n \"storageContainers\": []\r\n },\r\n \"routes\": [],\r\n \"fallbackRoute\": {\r\n \"name\": \"$fallback\",\r\n \"source\": \"DeviceMessages\",\r\n \"condition\": \"true\",\r\n \"endpointNames\": [\r\n \"events\"\r\n ],\r\n \"isEnabled\": true\r\n }\r\n },\r\n \"storageEndpoints\": {\r\n \"$default\": {\r\n \"sasTtlAsIso8601\": \"PT1H\",\r\n \"connectionString\": \"\",\r\n \"containerName\": \"\"\r\n }\r\n },\r\n \"messagingEndpoints\": {\r\n \"fileNotifications\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"enableFileUploadNotifications\": false,\r\n \"cloudToDevice\": {\r\n \"maxDeliveryCount\": 10,\r\n \"defaultTtlAsIso8601\": \"PT1H\",\r\n \"feedback\": {\r\n \"lockDurationAsIso8601\": \"PT1M\",\r\n \"ttlAsIso8601\": \"PT1H\",\r\n \"maxDeliveryCount\": 10\r\n }\r\n },\r\n \"features\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1MjcvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5fba7fe8-1d41-4ee9-bffd-013a7acdc5e5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "4d792aa8-a984-43db-a6bf-bb14fcccb01e" + ], + "x-ms-correlation-request-id": [ + "4d792aa8-a984-43db-a6bf-bb14fcccb01e" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034449Z:4d792aa8-a984-43db-a6bf-bb14fcccb01e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:49 GMT" + ], + "Content-Length": [ + "905" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"keyName\": \"iothubowner\",\r\n \"primaryKey\": \"dAvKYnRjNPJoWjreLBlEo58Ld0s02eQlUnQe+SG2Igg=\",\r\n \"secondaryKey\": \"7zLx5OPKtksiXKKda+KnKpqHBPipiFs6Z09QhIwjCOM=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"9dw21yVWXuqJ3WmhZsukO+W8clbGoo9IVs6hDYCr5UA=\",\r\n \"secondaryKey\": \"jqEpvwT0YZwds9WT6LyWs2BbWcTGA/C6fN3U6iw16o4=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"Cfai5XnDFLXbDXGMYSP2sMYf8UYSt+qjucK8TAeqmn4=\",\r\n \"secondaryKey\": \"rmWZflm8icmdc0/z6lraEz3WuJRu+0BJe7vfHLQ8nok=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Y3ECjy2KYoeo3vNzigtZplAWENxEb0m0hJyTUNatlxk=\",\r\n \"secondaryKey\": \"dE3300+T0FNgPU8YoJ1+gkJ5osM3IX3897MCx/NgEKE=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"kGhNXhfH80K/EAG4Ln3X76dr8U/F995EfdAVsvuUaFE=\",\r\n \"secondaryKey\": \"pFdZM/vvXIWWHXKgrj06d36lnnaNvB1MBwHZOx7crv0=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1MjcvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0b21e6d8-5fc8-42c9-8f54-cbb4374418fb" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-request-id": [ + "68a81627-1442-4f57-bbb1-fc75c9593f3e" + ], + "x-ms-correlation-request-id": [ + "68a81627-1442-4f57-bbb1-fc75c9593f3e" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034450Z:68a81627-1442-4f57-bbb1-fc75c9593f3e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:50 GMT" + ], + "Content-Length": [ + "905" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"keyName\": \"iothubowner\",\r\n \"primaryKey\": \"dAvKYnRjNPJoWjreLBlEo58Ld0s02eQlUnQe+SG2Igg=\",\r\n \"secondaryKey\": \"7zLx5OPKtksiXKKda+KnKpqHBPipiFs6Z09QhIwjCOM=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"9dw21yVWXuqJ3WmhZsukO+W8clbGoo9IVs6hDYCr5UA=\",\r\n \"secondaryKey\": \"jqEpvwT0YZwds9WT6LyWs2BbWcTGA/C6fN3U6iw16o4=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"Cfai5XnDFLXbDXGMYSP2sMYf8UYSt+qjucK8TAeqmn4=\",\r\n \"secondaryKey\": \"rmWZflm8icmdc0/z6lraEz3WuJRu+0BJe7vfHLQ8nok=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Y3ECjy2KYoeo3vNzigtZplAWENxEb0m0hJyTUNatlxk=\",\r\n \"secondaryKey\": \"dE3300+T0FNgPU8YoJ1+gkJ5osM3IX3897MCx/NgEKE=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"kGhNXhfH80K/EAG4Ln3X76dr8U/F995EfdAVsvuUaFE=\",\r\n \"secondaryKey\": \"pFdZM/vvXIWWHXKgrj06d36lnnaNvB1MBwHZOx7crv0=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1MjcvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "aec8aa62-8421-4f8c-9051-6edd898ea43b" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-request-id": [ + "694955f5-9783-4a96-91f3-6edf574e4704" + ], + "x-ms-correlation-request-id": [ + "694955f5-9783-4a96-91f3-6edf574e4704" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034451Z:694955f5-9783-4a96-91f3-6edf574e4704" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:51 GMT" + ], + "Content-Length": [ + "905" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"keyName\": \"iothubowner\",\r\n \"primaryKey\": \"dAvKYnRjNPJoWjreLBlEo58Ld0s02eQlUnQe+SG2Igg=\",\r\n \"secondaryKey\": \"7zLx5OPKtksiXKKda+KnKpqHBPipiFs6Z09QhIwjCOM=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"9dw21yVWXuqJ3WmhZsukO+W8clbGoo9IVs6hDYCr5UA=\",\r\n \"secondaryKey\": \"jqEpvwT0YZwds9WT6LyWs2BbWcTGA/C6fN3U6iw16o4=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"Cfai5XnDFLXbDXGMYSP2sMYf8UYSt+qjucK8TAeqmn4=\",\r\n \"secondaryKey\": \"rmWZflm8icmdc0/z6lraEz3WuJRu+0BJe7vfHLQ8nok=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Y3ECjy2KYoeo3vNzigtZplAWENxEb0m0hJyTUNatlxk=\",\r\n \"secondaryKey\": \"dE3300+T0FNgPU8YoJ1+gkJ5osM3IX3897MCx/NgEKE=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"kGhNXhfH80K/EAG4Ln3X76dr8U/F995EfdAVsvuUaFE=\",\r\n \"secondaryKey\": \"pFdZM/vvXIWWHXKgrj06d36lnnaNvB1MBwHZOx7crv0=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1MjcvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3358051e-624c-44a1-b598-49b1c2347114" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-request-id": [ + "aebe7fa7-6ad8-4c41-93ff-d279f7e612dc" + ], + "x-ms-correlation-request-id": [ + "aebe7fa7-6ad8-4c41-93ff-d279f7e612dc" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034452Z:aebe7fa7-6ad8-4c41-93ff-d279f7e612dc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:52 GMT" + ], + "Content-Length": [ + "905" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"keyName\": \"iothubowner\",\r\n \"primaryKey\": \"dAvKYnRjNPJoWjreLBlEo58Ld0s02eQlUnQe+SG2Igg=\",\r\n \"secondaryKey\": \"7zLx5OPKtksiXKKda+KnKpqHBPipiFs6Z09QhIwjCOM=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"9dw21yVWXuqJ3WmhZsukO+W8clbGoo9IVs6hDYCr5UA=\",\r\n \"secondaryKey\": \"jqEpvwT0YZwds9WT6LyWs2BbWcTGA/C6fN3U6iw16o4=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"Cfai5XnDFLXbDXGMYSP2sMYf8UYSt+qjucK8TAeqmn4=\",\r\n \"secondaryKey\": \"rmWZflm8icmdc0/z6lraEz3WuJRu+0BJe7vfHLQ8nok=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Y3ECjy2KYoeo3vNzigtZplAWENxEb0m0hJyTUNatlxk=\",\r\n \"secondaryKey\": \"dE3300+T0FNgPU8YoJ1+gkJ5osM3IX3897MCx/NgEKE=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"kGhNXhfH80K/EAG4Ln3X76dr8U/F995EfdAVsvuUaFE=\",\r\n \"secondaryKey\": \"pFdZM/vvXIWWHXKgrj06d36lnnaNvB1MBwHZOx7crv0=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1MjcvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "631f0e71-54a0-41df-91e1-c258c192fcb7" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-request-id": [ + "9b6d3d80-5e30-42c3-8aa9-fba8d425ce88" + ], + "x-ms-correlation-request-id": [ + "9b6d3d80-5e30-42c3-8aa9-fba8d425ce88" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034453Z:9b6d3d80-5e30-42c3-8aa9-fba8d425ce88" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:53 GMT" + ], + "Content-Length": [ + "905" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"keyName\": \"iothubowner\",\r\n \"primaryKey\": \"dAvKYnRjNPJoWjreLBlEo58Ld0s02eQlUnQe+SG2Igg=\",\r\n \"secondaryKey\": \"7zLx5OPKtksiXKKda+KnKpqHBPipiFs6Z09QhIwjCOM=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"9dw21yVWXuqJ3WmhZsukO+W8clbGoo9IVs6hDYCr5UA=\",\r\n \"secondaryKey\": \"jqEpvwT0YZwds9WT6LyWs2BbWcTGA/C6fN3U6iw16o4=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"Cfai5XnDFLXbDXGMYSP2sMYf8UYSt+qjucK8TAeqmn4=\",\r\n \"secondaryKey\": \"rmWZflm8icmdc0/z6lraEz3WuJRu+0BJe7vfHLQ8nok=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Y3ECjy2KYoeo3vNzigtZplAWENxEb0m0hJyTUNatlxk=\",\r\n \"secondaryKey\": \"dE3300+T0FNgPU8YoJ1+gkJ5osM3IX3897MCx/NgEKE=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"kGhNXhfH80K/EAG4Ln3X76dr8U/F995EfdAVsvuUaFE=\",\r\n \"secondaryKey\": \"pFdZM/vvXIWWHXKgrj06d36lnnaNvB1MBwHZOx7crv0=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps4604/providers/Microsoft.Devices/IotHubs/ps8527?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzNDYwNC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczg1Mjc/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5292c079-9b33-4fe4-9aa6-e106bb34e286" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfMDE4OGFiNGYtYzcxMS00MzZiLTlkNjgtNGI4Mjg3NWRiZmE4?api-version=2019-07-01-preview&operationSource=os_ih" + ], + "Retry-After": [ + "15" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfMDE4OGFiNGYtYzcxMS00MzZiLTlkNjgtNGI4Mjg3NWRiZmE4?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "85ccda5d-dab0-450a-911e-20674f1a6a50" + ], + "x-ms-correlation-request-id": [ + "85ccda5d-dab0-450a-911e-20674f1a6a50" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034455Z:85ccda5d-dab0-450a-911e-20674f1a6a50" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:44:55 GMT" + ], + "Content-Length": [ + "4" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "null", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfMDE4OGFiNGYtYzcxMS00MzZiLTlkNjgtNGI4Mjg3NWRiZmE4?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmTURFNE9HRmlOR1l0WXpjeE1TMDBNelppTFRsa05qZ3ROR0k0TWpnM05XUmlabUU0P2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWgmYXN5bmNpbmZv", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11988" + ], + "x-ms-request-id": [ + "18c6d395-5d3c-486a-9078-3a9ee39ecb02" + ], + "x-ms-correlation-request-id": [ + "18c6d395-5d3c-486a-9078-3a9ee39ecb02" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034511Z:18c6d395-5d3c-486a-9078-3a9ee39ecb02" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:45:10 GMT" + ], + "Content-Length": [ + "22" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfMDE4OGFiNGYtYzcxMS00MzZiLTlkNjgtNGI4Mjg3NWRiZmE4?api-version=2019-07-01-preview&operationSource=os_ih", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmTURFNE9HRmlOR1l0WXpjeE1TMDBNelppTFRsa05qZ3ROR0k0TWpnM05XUmlabUU0P2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWg=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.IotHub.IotHubClient/2.10.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfMDE4OGFiNGYtYzcxMS00MzZiLTlkNjgtNGI4Mjg3NWRiZmE4?api-version=2019-07-01-preview&operationSource=os_ih" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11987" + ], + "x-ms-request-id": [ + "71eed104-3c4e-4df4-a602-71a9fc40094f" + ], + "x-ms-correlation-request-id": [ + "71eed104-3c4e-4df4-a602-71a9fc40094f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20200408T034511Z:71eed104-3c4e-4df4-a602-71a9fc40094f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 08 Apr 2020 03:45:10 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + } + ], + "Names": { + "Test-AzureRmIotHubConfigurationLifecycle": [ + "ps8527", + "ps4604", + "ps1166", + "ps5548", + "ps7014" + ] + }, + "Variables": { + "SubscriptionId": "91d12660-3dec-467a-be2a-213b5544ddc0" + } +} \ No newline at end of file diff --git a/src/IotHub/IotHub/Az.IotHub.psd1 b/src/IotHub/IotHub/Az.IotHub.psd1 index 2058c3c84860..6bc067bf1ddc 100644 --- a/src/IotHub/IotHub/Az.IotHub.psd1 +++ b/src/IotHub/IotHub/Az.IotHub.psd1 @@ -102,7 +102,9 @@ CmdletsToExport = 'Add-AzIotHubKey', 'Get-AzIotHubEventHubConsumerGroup', 'Remove-AzIotHubDeviceChildren', 'Get-AzIotHubDeviceChildren', 'Get-AzIotHubDistributedTracing', 'Set-AzIotHubDistributedTracing', 'Get-AzIotHubDeviceTwin', 'Update-AzIotHubDeviceTwin', 'Invoke-AzIotHubDeviceMethod', - 'Get-AzIotHubModuleTwin', 'Update-AzIotHubModuleTwin' + 'Get-AzIotHubModuleTwin', 'Update-AzIotHubModuleTwin', + 'Add-AzIotHubConfiguration', 'Get-AzIotHubConfiguration', + 'Remove-AzIotHubConfiguration', 'Set-AzIotHubConfiguration' # Variables to export from this module # VariablesToExport = @() diff --git a/src/IotHub/IotHub/ChangeLog.md b/src/IotHub/IotHub/ChangeLog.md index 1bf9c9ce8d0f..8acdf645d886 100644 --- a/src/IotHub/IotHub/ChangeLog.md +++ b/src/IotHub/IotHub/ChangeLog.md @@ -25,6 +25,11 @@ * Manage IoT device module twin configuration, New cmdlets are: - `Get-AzIotHubModuleTwin` - `Update-AzIotHubModuleTwin` +* Manage IoT automatic device management configuration at scale. New cmdlets are: + - `Add-AzIotHubConfiguration` + - `Get-AzIotHubConfiguration` + - `Remove-AzIotHubConfiguration` + - `Set-AzIotHubConfiguration` ## Version 2.3.0 * Added support to manage distributed settings per-device. New Cmdlets are: diff --git a/src/IotHub/IotHub/Common/IotHubDataPlaneUtils.cs b/src/IotHub/IotHub/Common/IotHubDataPlaneUtils.cs index 919fdbc0e7ea..1c5caa3b5989 100644 --- a/src/IotHub/IotHub/Common/IotHubDataPlaneUtils.cs +++ b/src/IotHub/IotHub/Common/IotHubDataPlaneUtils.cs @@ -70,6 +70,21 @@ public static IEnumerable ToPSModules(IEnumerable modules) return IotHubUtils.ConvertObject, IEnumerable>(modules.ToList()); } + public static PSConfiguration ToPSConfiguration(Configuration config) + { + return IotHubUtils.ConvertObject(config); + } + + public static Configuration ToConfiguration(PSConfiguration psConfig) + { + return IotHubUtils.ConvertObject(psConfig); + } + + public static IEnumerable ToPSConfigurations(IEnumerable configs) + { + return IotHubUtils.ConvertObject, IEnumerable>(configs.ToList()); + } + public static PSDeviceTwin ToPSDeviceTwin(Twin deviceTwin) { return IotHubUtils.ConvertObject(deviceTwin); diff --git a/src/IotHub/IotHub/IotHub.format.ps1xml b/src/IotHub/IotHub/IotHub.format.ps1xml index 6a2576e6d8c6..02f13432407c 100644 --- a/src/IotHub/IotHub/IotHub.format.ps1xml +++ b/src/IotHub/IotHub/IotHub.format.ps1xml @@ -1027,5 +1027,116 @@ + + + Microsoft.Azure.Commands.Management.IotHub.Models.PSConfiguration + + + Microsoft.Azure.Commands.Management.IotHub.Models.PSConfiguration + + + + + + + + $_.Id + + + + $_.SchemaVersion + + + + $_.ContentType + + + Priority + + + + $_.TargetCondition + + + + $_.Labels + + + + $_.SystemMetrics + + + + $_.Metrics + + + + $_.Content.DeviceContent + + + + $_.CreatedTimeUtc.ToLocalTime().toString("M/dd/yyyy HH:MM") + + + + $_.LastUpdatedTimeUtc.ToLocalTime().toString("M/dd/yyyy HH:MM") + + + + + + + + + Microsoft.Azure.Commands.Management.IotHub.Models.PSConfigurations + + + Microsoft.Azure.Commands.Management.IotHub.Models.PSConfigurations + + + + + + + + + + + + + + + + + + + + + + + + + $_.Id + + + if($_.Content.DeviceContent) { "Device Twin Configuration" } else { "None" } + + + $_.Priority + + + + "Targeted : " + $_.SystemMetrics.Results["targetedCount"].ToString() + "Applied : " + $_.SystemMetrics.Results["appliedCount"].ToString() + + + + $_.LastUpdatedTimeUtc.ToLocalTime().toString("M/dd/yyyy HH:MM") + + + + + + \ No newline at end of file diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Configuration/AddAzIotHubConfiguration.cs b/src/IotHub/IotHub/IotHub/DataPlane/Configuration/AddAzIotHubConfiguration.cs new file mode 100644 index 000000000000..0ed1117b20ba --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Configuration/AddAzIotHubConfiguration.cs @@ -0,0 +1,139 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Management.IotHub +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.Management.IotHub.Common; + using Microsoft.Azure.Commands.Management.IotHub.Models; + using Microsoft.Azure.Devices; + using Microsoft.Azure.Management.IotHub; + using Microsoft.Azure.Management.IotHub.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + using ResourceManager.Common.ArgumentCompleters; + + [Cmdlet("Add", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubConfiguration", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)] + [OutputType(typeof(PSConfiguration))] + public class AddAzIotHubConfiguration : IotHubBaseCmdlet + { + private const string ResourceIdParameterSet = "ResourceIdSet"; + private const string ResourceParameterSet = "ResourceSet"; + private const string InputObjectParameterSet = "InputObjectSet"; + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = InputObjectParameterSet, ValueFromPipeline = true, HelpMessage = "IotHub object")] + [ValidateNotNullOrEmpty] + public PSIotHub InputObject { get; set; } + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = ResourceIdParameterSet, ValueFromPipelineByPropertyName = true, HelpMessage = "IotHub Resource Id")] + [ValidateNotNullOrEmpty] + [ResourceIdCompleter("Microsoft.Devices/IotHubs")] + public string ResourceId { get; set; } + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Name of the Resource Group")] + [ValidateNotNullOrEmpty] + [ResourceGroupCompleter] + public string ResourceGroupName { get; set; } + + [Parameter(Position = 1, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Name of the Iot Hub")] + [ValidateNotNullOrEmpty] + public string IotHubName { get; set; } + + [Parameter(Mandatory = true, HelpMessage = "Identifier for the configuration.")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Configuration for IotHub devices.")] + [ValidateNotNullOrEmpty] + public Hashtable DeviceContent { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Weight of the device configuration in case of competing rules (highest wins).")] + [ValidateNotNullOrEmpty] + public int Priority { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Target condition in which a device configuration applies to.")] + [ValidateNotNullOrEmpty] + public string TargetCondition { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Queries collection for configuration metrics definition.")] + public Hashtable Metric { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Map of labels to be applied to target configuration.")] + public Hashtable Label { get; set; } + + public override void ExecuteCmdlet() + { + if (ShouldProcess(this.IotHubName, Properties.Resources.AddIotHubConfiguration)) + { + IotHubDescription iotHubDescription; + if (ParameterSetName.Equals(InputObjectParameterSet)) + { + this.ResourceGroupName = this.InputObject.Resourcegroup; + this.IotHubName = this.InputObject.Name; + iotHubDescription = IotHubUtils.ConvertObject(this.InputObject); + } + else + { + if (ParameterSetName.Equals(ResourceIdParameterSet)) + { + this.ResourceGroupName = IotHubUtils.GetResourceGroupName(this.ResourceId); + this.IotHubName = IotHubUtils.GetIotHubName(this.ResourceId); + } + + iotHubDescription = this.IotHubClient.IotHubResource.Get(this.ResourceGroupName, this.IotHubName); + } + + IEnumerable authPolicies = this.IotHubClient.IotHubResource.ListKeys(this.ResourceGroupName, this.IotHubName); + SharedAccessSignatureAuthorizationRule policy = IotHubUtils.GetPolicy(authPolicies, PSAccessRights.RegistryWrite); + PSIotHubConnectionString psIotHubConnectionString = IotHubUtils.ToPSIotHubConnectionString(policy, iotHubDescription.Properties.HostName); + RegistryManager registryManager = RegistryManager.CreateFromConnectionString(psIotHubConnectionString.PrimaryConnectionString); + + PSConfiguration psConfiguration = new PSConfiguration(); + psConfiguration.Id = this.Name; + psConfiguration.Priority = this.Priority; + psConfiguration.TargetCondition = string.IsNullOrEmpty(this.TargetCondition) ? "" : this.TargetCondition; + psConfiguration.Labels = new Hashtable(); + psConfiguration.Metrics = new PSConfigurationMetrics() { Queries = new Hashtable(), Results = new Hashtable() }; + psConfiguration.Content = new PSConfigurationContent() { DeviceContent = new Hashtable(), ModulesContent = new Hashtable() }; + + if (this.IsParameterBound(c => c.Label)) + { + psConfiguration.Labels = this.Label; + } + + if (this.IsParameterBound(c => c.Metric)) + { + psConfiguration.Metrics.Queries = this.Metric; + } + + if (this.IsParameterBound(c => c.DeviceContent)) + { + foreach (DictionaryEntry kvp in this.DeviceContent) + { + if (!Convert.ToString(kvp.Key).StartsWith("properties.desired", StringComparison.InvariantCultureIgnoreCase)) + { + throw new ArgumentException("The device content key must begin with \"properties.desired\"."); + } + } + + psConfiguration.Content.DeviceContent = this.DeviceContent; + } + + this.WriteObject(IotHubDataPlaneUtils.ToPSConfiguration(registryManager.AddConfigurationAsync(IotHubDataPlaneUtils.ToConfiguration(psConfiguration)).GetAwaiter().GetResult())); + } + } + } +} diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Configuration/GetAzIotHubConfiguration.cs b/src/IotHub/IotHub/IotHub/DataPlane/Configuration/GetAzIotHubConfiguration.cs new file mode 100644 index 000000000000..275e569b9ffc --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Configuration/GetAzIotHubConfiguration.cs @@ -0,0 +1,92 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Management.IotHub +{ + using System; + using System.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.Management.IotHub.Common; + using Microsoft.Azure.Commands.Management.IotHub.Models; + using Microsoft.Azure.Devices; + using Microsoft.Azure.Management.IotHub; + using Microsoft.Azure.Management.IotHub.Models; + using ResourceManager.Common.ArgumentCompleters; + + [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubConfiguration", DefaultParameterSetName = ResourceParameterSet)] + [OutputType(typeof(PSConfiguration), typeof(PSConfigurations[]))] + public class GetAzIotHubConfiguration : IotHubBaseCmdlet + { + private const string ResourceIdParameterSet = "ResourceIdSet"; + private const string ResourceParameterSet = "ResourceSet"; + private const string InputObjectParameterSet = "InputObjectSet"; + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = InputObjectParameterSet, ValueFromPipeline = true, HelpMessage = "IotHub object")] + [ValidateNotNullOrEmpty] + public PSIotHub InputObject { get; set; } + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = ResourceIdParameterSet, ValueFromPipelineByPropertyName = true, HelpMessage = "IotHub Resource Id")] + [ValidateNotNullOrEmpty] + [ResourceIdCompleter("Microsoft.Devices/IotHubs")] + public string ResourceId { get; set; } + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Name of the Resource Group")] + [ValidateNotNullOrEmpty] + [ResourceGroupCompleter] + public string ResourceGroupName { get; set; } + + [Parameter(Position = 1, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Name of the Iot Hub")] + [ValidateNotNullOrEmpty] + public string IotHubName { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Identifier for the configuration.")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + public override void ExecuteCmdlet() + { + IotHubDescription iotHubDescription; + if (ParameterSetName.Equals(InputObjectParameterSet)) + { + this.ResourceGroupName = this.InputObject.Resourcegroup; + this.IotHubName = this.InputObject.Name; + iotHubDescription = IotHubUtils.ConvertObject(this.InputObject); + } + else + { + if (ParameterSetName.Equals(ResourceIdParameterSet)) + { + this.ResourceGroupName = IotHubUtils.GetResourceGroupName(this.ResourceId); + this.IotHubName = IotHubUtils.GetIotHubName(this.ResourceId); + } + + iotHubDescription = this.IotHubClient.IotHubResource.Get(this.ResourceGroupName, this.IotHubName); + } + + IEnumerable authPolicies = this.IotHubClient.IotHubResource.ListKeys(this.ResourceGroupName, this.IotHubName); + SharedAccessSignatureAuthorizationRule policy = IotHubUtils.GetPolicy(authPolicies, PSAccessRights.RegistryWrite); + PSIotHubConnectionString psIotHubConnectionString = IotHubUtils.ToPSIotHubConnectionString(policy, iotHubDescription.Properties.HostName); + RegistryManager registryManager = RegistryManager.CreateFromConnectionString(psIotHubConnectionString.PrimaryConnectionString); + + if (this.Name != null) + { + this.WriteObject(IotHubDataPlaneUtils.ToPSConfiguration(registryManager.GetConfigurationAsync(this.Name).GetAwaiter().GetResult())); + } + else + { + this.WriteObject(IotHubDataPlaneUtils.ToPSConfigurations(registryManager.GetConfigurationsAsync(Int32.MaxValue).GetAwaiter().GetResult()), true); + } + } + } +} diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Configuration/RemoveAzIotHubConfiguration.cs b/src/IotHub/IotHub/IotHub/DataPlane/Configuration/RemoveAzIotHubConfiguration.cs new file mode 100644 index 000000000000..a3727a931673 --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Configuration/RemoveAzIotHubConfiguration.cs @@ -0,0 +1,119 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Management.IotHub +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using Microsoft.Azure.Commands.Management.IotHub.Common; + using Microsoft.Azure.Commands.Management.IotHub.Models; + using Microsoft.Azure.Devices; + using Microsoft.Azure.Management.IotHub; + using Microsoft.Azure.Management.IotHub.Models; + using Newtonsoft.Json; + using ResourceManager.Common.ArgumentCompleters; + + [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubConfiguration", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)] + [OutputType(typeof(bool))] + public class RemoveAzIotHubConfiguration : IotHubBaseCmdlet + { + private const string ResourceIdParameterSet = "ResourceIdSet"; + private const string ResourceParameterSet = "ResourceSet"; + private const string InputObjectParameterSet = "InputObjectSet"; + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = InputObjectParameterSet, ValueFromPipeline = true, HelpMessage = "IotHub object")] + [ValidateNotNullOrEmpty] + public PSIotHub InputObject { get; set; } + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = ResourceIdParameterSet, ValueFromPipelineByPropertyName = true, HelpMessage = "IotHub Resource Id")] + [ValidateNotNullOrEmpty] + [ResourceIdCompleter("Microsoft.Devices/IotHubs")] + public string ResourceId { get; set; } + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Name of the Resource Group")] + [ValidateNotNullOrEmpty] + [ResourceGroupCompleter] + public string ResourceGroupName { get; set; } + + [Parameter(Position = 1, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Name of the Iot Hub")] + [ValidateNotNullOrEmpty] + public string IotHubName { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Identifier for the configuration.")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Allows to return the boolean object. By default, this cmdlet does not generate any output.")] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteCmdlet() + { + if (ShouldProcess(this.IotHubName, Properties.Resources.RemoveIotHubConfiguration)) + { + IotHubDescription iotHubDescription; + if (ParameterSetName.Equals(InputObjectParameterSet)) + { + this.ResourceGroupName = this.InputObject.Resourcegroup; + this.IotHubName = this.InputObject.Name; + iotHubDescription = IotHubUtils.ConvertObject(this.InputObject); + } + else + { + if (ParameterSetName.Equals(ResourceIdParameterSet)) + { + this.ResourceGroupName = IotHubUtils.GetResourceGroupName(this.ResourceId); + this.IotHubName = IotHubUtils.GetIotHubName(this.ResourceId); + } + + iotHubDescription = this.IotHubClient.IotHubResource.Get(this.ResourceGroupName, this.IotHubName); + } + + IEnumerable authPolicies = this.IotHubClient.IotHubResource.ListKeys(this.ResourceGroupName, this.IotHubName); + SharedAccessSignatureAuthorizationRule policy = IotHubUtils.GetPolicy(authPolicies, PSAccessRights.RegistryWrite); + PSIotHubConnectionString psIotHubConnectionString = IotHubUtils.ToPSIotHubConnectionString(policy, iotHubDescription.Properties.HostName); + RegistryManager registryManager = RegistryManager.CreateFromConnectionString(psIotHubConnectionString.PrimaryConnectionString); + + try + { + if (this.Name != null) + { + registryManager.RemoveConfigurationAsync(this.Name).GetAwaiter().GetResult(); + } + else + { + IEnumerable configs = registryManager.GetConfigurationsAsync(Int32.MaxValue).GetAwaiter().GetResult(); + foreach (Configuration config in configs) + { + registryManager.RemoveConfigurationAsync(config).GetAwaiter().GetResult(); + } + } + + if (PassThru.IsPresent) + { + this.WriteObject(true); + } + } + catch + { + if (PassThru.IsPresent) + { + this.WriteObject(false); + } + } + } + } + } +} diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Configuration/SetAzIotHubConfiguration.cs b/src/IotHub/IotHub/IotHub/DataPlane/Configuration/SetAzIotHubConfiguration.cs new file mode 100644 index 000000000000..79c2bb7c027b --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Configuration/SetAzIotHubConfiguration.cs @@ -0,0 +1,130 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Management.IotHub +{ + using System.Collections; + using System.Collections.Generic; + using System.Management.Automation; + using Microsoft.Azure.Commands.Management.IotHub.Common; + using Microsoft.Azure.Commands.Management.IotHub.Models; + using Microsoft.Azure.Devices; + using Microsoft.Azure.Management.IotHub; + using Microsoft.Azure.Management.IotHub.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + using ResourceManager.Common.ArgumentCompleters; + + [Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubConfiguration", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)] + [OutputType(typeof(PSConfiguration))] + public class SetAzIotHubConfiguration : IotHubBaseCmdlet + { + private const string ResourceIdParameterSet = "ResourceIdSet"; + private const string ResourceParameterSet = "ResourceSet"; + private const string InputObjectParameterSet = "InputObjectSet"; + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = InputObjectParameterSet, ValueFromPipeline = true, HelpMessage = "IotHub object")] + [ValidateNotNullOrEmpty] + public PSIotHub InputObject { get; set; } + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = ResourceIdParameterSet, ValueFromPipelineByPropertyName = true, HelpMessage = "IotHub Resource Id")] + [ValidateNotNullOrEmpty] + [ResourceIdCompleter("Microsoft.Devices/IotHubs")] + public string ResourceId { get; set; } + + [Parameter(Position = 0, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Name of the Resource Group")] + [ValidateNotNullOrEmpty] + [ResourceGroupCompleter] + public string ResourceGroupName { get; set; } + + [Parameter(Position = 1, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Name of the Iot Hub")] + [ValidateNotNullOrEmpty] + public string IotHubName { get; set; } + + [Parameter(Position = 1, Mandatory = true, ParameterSetName = InputObjectParameterSet, HelpMessage = "Identifier for the configuration.")] + [Parameter(Position = 1, Mandatory = true, ParameterSetName = ResourceIdParameterSet, HelpMessage = "Identifier for the configuration.")] + [Parameter(Position = 2, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Identifier for the configuration.")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Weight of the device configuration in case of competing rules (highest wins).")] + [ValidateNotNullOrEmpty] + public int Priority { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Target condition in which a device configuration applies to.")] + [ValidateNotNullOrEmpty] + public string TargetCondition { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Queries collection for configuration metrics definition.")] + public Hashtable Metric { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Map of labels to be applied to target configuration.")] + public Hashtable Label { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Allows configuration object to be replaced even if it was updated since it was retrieved last time.")] + public SwitchParameter Force { get; set; } + + public override void ExecuteCmdlet() + { + if (ShouldProcess(this.IotHubName, Properties.Resources.SetIotHubConfiguration)) + { + IotHubDescription iotHubDescription; + if (ParameterSetName.Equals(InputObjectParameterSet)) + { + this.ResourceGroupName = this.InputObject.Resourcegroup; + this.IotHubName = this.InputObject.Name; + iotHubDescription = IotHubUtils.ConvertObject(this.InputObject); + } + else + { + if (ParameterSetName.Equals(ResourceIdParameterSet)) + { + this.ResourceGroupName = IotHubUtils.GetResourceGroupName(this.ResourceId); + this.IotHubName = IotHubUtils.GetIotHubName(this.ResourceId); + } + + iotHubDescription = this.IotHubClient.IotHubResource.Get(this.ResourceGroupName, this.IotHubName); + } + + IEnumerable authPolicies = this.IotHubClient.IotHubResource.ListKeys(this.ResourceGroupName, this.IotHubName); + SharedAccessSignatureAuthorizationRule policy = IotHubUtils.GetPolicy(authPolicies, PSAccessRights.RegistryWrite); + PSIotHubConnectionString psIotHubConnectionString = IotHubUtils.ToPSIotHubConnectionString(policy, iotHubDescription.Properties.HostName); + RegistryManager registryManager = RegistryManager.CreateFromConnectionString(psIotHubConnectionString.PrimaryConnectionString); + + PSConfiguration psConfiguration = IotHubDataPlaneUtils.ToPSConfiguration(registryManager.GetConfigurationAsync(this.Name).GetAwaiter().GetResult()); + + if (this.IsParameterBound(c => c.Priority)) + { + psConfiguration.Priority = this.Priority; + } + + if (this.IsParameterBound(c => c.TargetCondition)) + { + psConfiguration.TargetCondition = this.TargetCondition; + } + + if (this.IsParameterBound(c => c.Label)) + { + psConfiguration.Labels = this.Label; + } + + if (this.IsParameterBound(c => c.Metric)) + { + psConfiguration.Metrics.Queries = this.Metric; + } + + this.WriteObject(IotHubDataPlaneUtils.ToPSConfiguration(registryManager.UpdateConfigurationAsync(IotHubDataPlaneUtils.ToConfiguration(psConfiguration), this.Force.IsPresent).GetAwaiter().GetResult())); + } + } + } +} diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfiguration.cs b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfiguration.cs new file mode 100644 index 000000000000..fb7d4ff29210 --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfiguration.cs @@ -0,0 +1,101 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Management.IotHub.Models +{ + using System; + using System.Collections; + using Newtonsoft.Json; + + /// + /// Configuration for IotHub devices and modules. + /// + public class PSConfiguration + { + /// + /// Gets Identifier for the configuration. + /// + [JsonProperty(PropertyName = "id", Required = Required.Always)] + public string Id { get; set; } + + /// + /// Gets Schema version for the configuration. + /// + [JsonProperty(PropertyName = "schemaVersion", NullValueHandling = NullValueHandling.Ignore)] + public string SchemaVersion { get; set; } + + /// + /// Gets or sets labels for the configuration. + /// + [JsonProperty(PropertyName = "labels", NullValueHandling = NullValueHandling.Ignore)] + public Hashtable Labels { get; set; } + + /// + /// Gets or sets Content for the configuration. + /// + [JsonProperty(PropertyName = "content", NullValueHandling = NullValueHandling.Ignore)] + public PSConfigurationContent Content { get; set; } + + /// + /// Gets the content type for configuration. + /// + [JsonProperty(PropertyName = "contentType")] + public string ContentType { get; internal set; } + + /// + /// Gets or sets Target Condition for the configuration. + /// + [JsonProperty(PropertyName = "targetCondition")] + public string TargetCondition { get; set; } + + /// + /// Gets creation time for the configuration. + /// + [JsonProperty(PropertyName = "createdTimeUtc")] + public DateTime CreatedTimeUtc { get; internal set; } + + /// + /// Gets last update time for the configuration. + /// + [JsonProperty(PropertyName = "lastUpdatedTimeUtc")] + public DateTime LastUpdatedTimeUtc { get; internal set; } + + /// + /// Gets or sets Priority for the configuration. + /// + [JsonProperty(PropertyName = "priority")] + public int Priority { get; set; } + + /// + /// System Configuration Metrics. + /// + [JsonProperty(PropertyName = "systemMetrics", NullValueHandling = NullValueHandling.Ignore)] + public PSConfigurationMetrics SystemMetrics { get; internal set; } + + /// + /// Custom Configuration Metrics. + /// + [JsonProperty(PropertyName = "metrics", NullValueHandling = NullValueHandling.Ignore)] + public PSConfigurationMetrics Metrics { get; set; } + + /// + /// Gets or sets configuration's ETag. + /// + [JsonProperty(PropertyName = "etag")] + public string ETag { get; set; } + } + + public class PSConfigurations : PSConfiguration + { } +} \ No newline at end of file diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfigurationContent.cs b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfigurationContent.cs new file mode 100644 index 000000000000..dd5522e19d79 --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfigurationContent.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Management.IotHub.Models +{ + using System; + using System.Collections; + using Newtonsoft.Json; + + /// + /// Configurations for Module Management Agent, Edge Hub and Modules on the device. + /// + public class PSConfigurationContent + { + /// + /// Gets or sets Device Configurations. + /// + [JsonProperty(PropertyName = "deviceContent")] + public Hashtable DeviceContent { get; set; } + + /// + /// Gets or sets Module Configurations. + /// + [JsonProperty(PropertyName = "modulesContent")] + public Hashtable ModulesContent { get; set; } + } +} \ No newline at end of file diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfigurationMetrics.cs b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfigurationMetrics.cs new file mode 100644 index 000000000000..dcae09f64f81 --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSConfigurationMetrics.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Management.IotHub.Models +{ + using System; + using System.Collections; + using Newtonsoft.Json; + + /// + /// Azure IoT Configuration Metrics + /// + public class PSConfigurationMetrics + { + /// + /// Results of the metrics collection queries + /// + [JsonProperty("results")] + public Hashtable Results { get; set; } + + /// + /// Queries used for metrics collection + /// + [JsonProperty("queries")] + public Hashtable Queries { get; set; } + } +} \ No newline at end of file diff --git a/src/IotHub/IotHub/Properties/Resources.Designer.cs b/src/IotHub/IotHub/Properties/Resources.Designer.cs index ec5b1764c2fa..58364b687fae 100644 --- a/src/IotHub/IotHub/Properties/Resources.Designer.cs +++ b/src/IotHub/IotHub/Properties/Resources.Designer.cs @@ -85,6 +85,15 @@ internal static string AddIotHubCertificate { } } + /// + /// Looks up a localized string similar to Add Configuration. + /// + internal static string AddIotHubConfiguration { + get { + return ResourceManager.GetString("AddIotHubConfiguration", resourceCulture); + } + } + /// /// Looks up a localized string similar to Add Device. /// @@ -238,6 +247,15 @@ internal static string RemoveIotHubCertificate { } } + /// + /// Looks up a localized string similar to Remove Configuration. + /// + internal static string RemoveIotHubConfiguration { + get { + return ResourceManager.GetString("RemoveIotHubConfiguration", resourceCulture); + } + } + /// /// Looks up a localized string similar to Remove Device. /// @@ -301,6 +319,15 @@ internal static string RemoveIotHubRoutingEndpoint { } } + /// + /// Looks up a localized string similar to Set Configuration. + /// + internal static string SetIotHubConfiguration { + get { + return ResourceManager.GetString("SetIotHubConfiguration", resourceCulture); + } + } + /// /// Looks up a localized string similar to Update Distributed Tracing. /// diff --git a/src/IotHub/IotHub/Properties/Resources.resx b/src/IotHub/IotHub/Properties/Resources.resx index 46b01bcd566b..6e3acfd305a9 100644 --- a/src/IotHub/IotHub/Properties/Resources.resx +++ b/src/IotHub/IotHub/Properties/Resources.resx @@ -228,4 +228,13 @@ Update Device Module Twin + + Add Configuration + + + Remove Configuration + + + Set Configuration + \ No newline at end of file diff --git a/src/IotHub/IotHub/help/Add-AzIotHubConfiguration.md b/src/IotHub/IotHub/help/Add-AzIotHubConfiguration.md new file mode 100644 index 000000000000..a4967ec39758 --- /dev/null +++ b/src/IotHub/IotHub/help/Add-AzIotHubConfiguration.md @@ -0,0 +1,304 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.IotHub.dll-Help.xml +Module Name: Az.IotHub +online version: https://docs.microsoft.com/en-us/powershell/module/az.iothub/add-aziothubconfiguration +schema: 2.0.0 +--- + +# Add-AzIotHubConfiguration + +## SYNOPSIS +Add an IoT automatic device management configuration in a target IoT Hub. + +## SYNTAX + +### ResourceSet (Default) +``` +Add-AzIotHubConfiguration [-ResourceGroupName] [-IotHubName] -Name + [-DeviceContent ] [-Priority ] [-TargetCondition ] [-Metric ] + [-Label ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### InputObjectSet +``` +Add-AzIotHubConfiguration [-InputObject] -Name [-DeviceContent ] + [-Priority ] [-TargetCondition ] [-Metric ] [-Label ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### ResourceIdSet +``` +Add-AzIotHubConfiguration [-ResourceId] -Name [-DeviceContent ] + [-Priority ] [-TargetCondition ] [-Metric ] [-Label ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Configuration content is json and slighty varies based on device or module intent. +Device configurations are in the form of {"deviceContent":{...}} +Module configurations are in the form of {"moduleContent":{...}} +Configurations can be defined with user provided metrics for on demand evaluation. +User metrics are json and in the form of {"queries":{...}} or {"metrics":{"queries":{...}}}. + +Note: Target condition for modules must start with "from devices.modules where". See https://docs.microsoft.com/azure/iot-hub/iot-hub-automatic-device-management for more information. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Add-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" +``` + +Create a device configuration with default metadata. + +### Example 2 +```powershell +PS C:\> Add-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" -Priority 3 -TargetCondition "tags.building=9 and tags.environment='test'" +``` + +Create a device configuration with a priority of 3 that applies on condition when a device is tagged in building 9 and the environment is 'test'. + +### Example 2 +```powershell +PS C:\> $metrics = @{} +PS C:\> $metrics.add("query1", "select deviceId from devices where tags.location='US'") +PS C:\> Add-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" -Metric $metrics +``` + +Create a device configuration with user metrics. + +### Example 3 +```powershell +PS C:\> $labels = @{} +PS C:\> $labels.add("key0","value0") +PS C:\> $labels.add("key1","value1") +PS C:\> Add-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" -Label $labels +``` + +Create a device configuration with labels. + +### Example 4 +```powershell +PS C:\> $prop = @{} +PS C:\> $prop.add("Location", "US") +PS C:\> $content = @{} +PS C:\> $content.add("properties.desired.Region", $prop) +PS C:\> Add-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" -DeviceContent $content +``` + +Create a device configuration with content. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceContent +Configuration for IotHub devices. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +IotHub object + +```yaml +Type: Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub +Parameter Sets: InputObjectSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IotHubName +Name of the Iot Hub + +```yaml +Type: System.String +Parameter Sets: ResourceSet +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Label +Map of labels to be applied to target configuration. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Metric +Queries collection for configuration metrics definition. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Identifier for the configuration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Priority +Weight of the device configuration in case of competing rules (highest wins). + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the Resource Group + +```yaml +Type: System.String +Parameter Sets: ResourceSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +IotHub Resource Id + +```yaml +Type: System.String +Parameter Sets: ResourceIdSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TargetCondition +Target condition in which a device configuration applies to. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Management.IotHub.Models.PSConfiguration + +## NOTES + +## RELATED LINKS diff --git a/src/IotHub/IotHub/help/Az.IotHub.md b/src/IotHub/IotHub/help/Az.IotHub.md index 2e454bd7814b..e99a5db74cb3 100644 --- a/src/IotHub/IotHub/help/Az.IotHub.md +++ b/src/IotHub/IotHub/help/Az.IotHub.md @@ -14,6 +14,9 @@ Commands for Managing Azure IotHubs ### [Add-AzIotHubCertificate](Add-AzIotHubCertificate.md) Create/update an Azure IoT Hub certificate. +### [Add-AzIotHubConfiguration](Add-AzIotHubConfiguration.md) +Add an IoT automatic device management configuration in a target IoT Hub. + ### [Add-AzIotHubDevice](Add-AzIotHubDevice.md) Create a device in an IoT Hub. @@ -47,6 +50,9 @@ Lists all certificates or a particular certificate contained within an Azure IoT ### [Get-AzIotHubCertificateVerificationCode](Get-AzIotHubCertificateVerificationCode.md) Generates a verification code for an Azure IoT Hub certificate. +### [Get-AzIotHubConfiguration](Get-AzIotHubConfiguration.md) +Lists all or a particular IoT automatic device management configuration. + ### [Get-AzIotHubConnectionString](Get-AzIotHubConnectionString.md) Gets the IotHub connectionstrings. @@ -128,6 +134,9 @@ Deletes an IotHub. ### [Remove-AzIotHubCertificate](Remove-AzIotHubCertificate.md) Deletes an Azure IoT Hub certificate. +### [Remove-AzIotHubConfiguration](Remove-AzIotHubConfiguration.md) +Delete an IoT device configuration. + ### [Remove-AzIotHubDevice](Remove-AzIotHubDevice.md) Delete an IoT Hub device. @@ -155,6 +164,9 @@ Delete an endpoint for your IoT Hub ### [Set-AzIotHub](Set-AzIotHub.md) Updates the properties of an IotHub. +### [Set-AzIotHubConfiguration](Set-AzIotHubConfiguration.md) +Update the mutable fields of the configuration registration. + ### [Set-AzIotHubDevice](Set-AzIotHubDevice.md) Update an IoT Hub device. diff --git a/src/IotHub/IotHub/help/Get-AzIotHubConfiguration.md b/src/IotHub/IotHub/help/Get-AzIotHubConfiguration.md new file mode 100644 index 000000000000..d070ba573a91 --- /dev/null +++ b/src/IotHub/IotHub/help/Get-AzIotHubConfiguration.md @@ -0,0 +1,162 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.IotHub.dll-Help.xml +Module Name: Az.IotHub +online version: https://docs.microsoft.com/en-us/powershell/module/az.iothub/get-aziothubconfiguration +schema: 2.0.0 +--- + +# Get-AzIotHubConfiguration + +## SYNOPSIS +Lists all or a particular IoT automatic device management configuration. + +## SYNTAX + +### ResourceSet (Default) +``` +Get-AzIotHubConfiguration [-ResourceGroupName] [-IotHubName] [-Name ] + [-DefaultProfile ] [] +``` + +### InputObjectSet +``` +Get-AzIotHubConfiguration [-InputObject] [-Name ] [-DefaultProfile ] + [] +``` + +### ResourceIdSet +``` +Get-AzIotHubConfiguration [-ResourceId] [-Name ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get the details of an IoT automatic device management configuration or list IoT automatic device management configurations in an IoT Hub. +See https://docs.microsoft.com/azure/iot-hub/iot-hub-automatic-device-management for more information. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" +``` + +Get the details of an IoT automatic device management configuration. + +### Example 2 +```powershell +PS C:\> Get-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" +``` + +List IoT automatic device management configurations in an IoT Hub. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +IotHub object + +```yaml +Type: Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub +Parameter Sets: InputObjectSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IotHubName +Name of the Iot Hub + +```yaml +Type: System.String +Parameter Sets: ResourceSet +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Identifier for the configuration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the Resource Group + +```yaml +Type: System.String +Parameter Sets: ResourceSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +IotHub Resource Id + +```yaml +Type: System.String +Parameter Sets: ResourceIdSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Management.IotHub.Models.PSConfiguration + +### Microsoft.Azure.Commands.Management.IotHub.Models.PSConfigurations[] + +## NOTES + +## RELATED LINKS diff --git a/src/IotHub/IotHub/help/Remove-AzIotHubConfiguration.md b/src/IotHub/IotHub/help/Remove-AzIotHubConfiguration.md new file mode 100644 index 000000000000..cebf4ba46d53 --- /dev/null +++ b/src/IotHub/IotHub/help/Remove-AzIotHubConfiguration.md @@ -0,0 +1,199 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.IotHub.dll-Help.xml +Module Name: Az.IotHub +online version: https://docs.microsoft.com/en-us/powershell/module/az.iothub/remove-aziothubconfiguration +schema: 2.0.0 +--- + +# Remove-AzIotHubConfiguration + +## SYNOPSIS +Delete an IoT device configuration. + +## SYNTAX + +### ResourceSet (Default) +``` +Remove-AzIotHubConfiguration [-ResourceGroupName] [-IotHubName] [-Name ] [-PassThru] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### InputObjectSet +``` +Remove-AzIotHubConfiguration [-InputObject] [-Name ] [-PassThru] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### ResourceIdSet +``` +Remove-AzIotHubConfiguration [-ResourceId] [-Name ] [-PassThru] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +See https://docs.microsoft.com/azure/iot-hub/iot-hub-automatic-device-management for more information. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Remove-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" +``` + +Delete an IoT device configuration. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +IotHub object + +```yaml +Type: Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub +Parameter Sets: InputObjectSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IotHubName +Name of the Iot Hub + +```yaml +Type: System.String +Parameter Sets: ResourceSet +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Identifier for the configuration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Allows to return the boolean object. +By default, this cmdlet does not generate any output. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the Resource Group + +```yaml +Type: System.String +Parameter Sets: ResourceSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +IotHub Resource Id + +```yaml +Type: System.String +Parameter Sets: ResourceIdSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub + +### System.String + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS diff --git a/src/IotHub/IotHub/help/Set-AzIotHubConfiguration.md b/src/IotHub/IotHub/help/Set-AzIotHubConfiguration.md new file mode 100644 index 000000000000..076855fe5d6c --- /dev/null +++ b/src/IotHub/IotHub/help/Set-AzIotHubConfiguration.md @@ -0,0 +1,263 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.IotHub.dll-Help.xml +Module Name: Az.IotHub +online version: https://docs.microsoft.com/en-us/powershell/module/az.iothub/set-aziothubconfiguration +schema: 2.0.0 +--- + +# Set-AzIotHubConfiguration + +## SYNOPSIS +Update the mutable fields of the configuration registration. + +## SYNTAX + +### ResourceSet (Default) +``` +Set-AzIotHubConfiguration [-ResourceGroupName] [-IotHubName] [-Name] + [-Priority ] [-TargetCondition ] [-Metric ] [-Label ] [-Force] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### InputObjectSet +``` +Set-AzIotHubConfiguration [-InputObject] [-Name] [-Priority ] + [-TargetCondition ] [-Metric ] [-Label ] [-Force] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### ResourceIdSet +``` +Set-AzIotHubConfiguration [-ResourceId] [-Name] [-Priority ] + [-TargetCondition ] [-Metric ] [-Label ] [-Force] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Update specified properties of an IoT automatic device management configuration. +Note: Configuration content is immutable. Configuration properties that can be updated are 'labels', 'metrics', 'priority' and 'targetCondition'. +See https://docs.microsoft.com/azure/iot-hub/iot-hub-automatic-device-management for more information. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Set-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" -Priority 7 -TargetCondition "tags.building=3 and tags.environment='dev'" +``` + +Alter the priority of a device configuration and update its target condition + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Allows configuration object to be replaced even if it was updated since it was retrieved last time. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +IotHub object + +```yaml +Type: Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub +Parameter Sets: InputObjectSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IotHubName +Name of the Iot Hub + +```yaml +Type: System.String +Parameter Sets: ResourceSet +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Label +Map of labels to be applied to target configuration. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Metric +Queries collection for configuration metrics definition. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Identifier for the configuration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Priority +Weight of the device configuration in case of competing rules (highest wins). + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Name of the Resource Group + +```yaml +Type: System.String +Parameter Sets: ResourceSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +IotHub Resource Id + +```yaml +Type: System.String +Parameter Sets: ResourceIdSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TargetCondition +Target condition in which a device configuration applies to. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Management.IotHub.Models.PSConfiguration + +## NOTES + +## RELATED LINKS diff --git a/tools/SecurityTools/CredScanSuppressions.json b/tools/SecurityTools/CredScanSuppressions.json index e801d8c4be7f..f8a32891f04f 100644 --- a/tools/SecurityTools/CredScanSuppressions.json +++ b/tools/SecurityTools/CredScanSuppressions.json @@ -549,6 +549,10 @@ "file": "src\\IotHub\\IotHub.Test\\SessionRecords\\Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPTracingTests\\TestAzureIotHubTracing.json", "_justification": "Mocked test resource. The resources are being deleted after the test run in Record mode." }, + { + "file": "src\\IotHub\\IotHub.Test\\SessionRecords\\Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPConfigurationTests\\TestAzureIotHubConfigurationLifecycle.json", + "_justification": "Mocked test resource. The resources are being deleted after the test run in Record mode." + }, { "file": "src\\Compute\\Compute.Test\\SessionRecords\\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.AEMExtensionTests\\TestAEMExtensionAdvancedLinux.json", "_justification": "Mocked test resource. The resources are being deleted after the test run in Record mode."