diff --git a/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPTracingTests.cs b/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPTracingTests.cs new file mode 100644 index 000000000000..e279903a511c --- /dev/null +++ b/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPTracingTests.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 IotHubDPTracingTests : RMTestBase + { + public XunitTracingInterceptor _logger; + + public IotHubDPTracingTests(ITestOutputHelper output) + { + _logger = new XunitTracingInterceptor(output); + XunitTracingInterceptor.AddToContext(_logger); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.LiveOnly)] + public void TestAzureIotHubTracing() + { + IotHubController.NewInstance.RunPsTest(_logger, "Test-AzureRmIotHubTracing"); + } + } +} diff --git a/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPTracingTests.ps1 b/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPTracingTests.ps1 new file mode 100644 index 000000000000..32dee8196d28 --- /dev/null +++ b/src/IotHub/IotHub.Test/ScenarioTests/IotHubDPTracingTests.ps1 @@ -0,0 +1,60 @@ +# ---------------------------------------------------------------------------------- +# +# 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 Tracing Cmdlets ## +################################# + +<# +.SYNOPSIS +Test all iothub device tracing cmdlets +#> +function Test-AzureRmIotHubTracing +{ + $Location = Get-Location "Microsoft.Devices" "IotHubs" "WEST US 2" + $IotHubName = getAssetName + $ResourceGroupName = getAssetName + $Sku = "S1" + $device1 = 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 } + + # Get device tracing detail + $deviceTracing = Get-AzIotHubDistributedTracing -ResourceGroupName $ResourceGroupName -IotHubName $IotHubName -DeviceId $device1 + Assert-True { $deviceTracing.DeviceId -eq $device1} + Assert-True { $deviceTracing.TracingOption.SamplingMode -eq 'Disabled'} + Assert-True { $deviceTracing.TracingOption.SamplingRate -eq ''} + Assert-False { $deviceTracing.IsSynced} + + # Set device tracing option + $updatedDeviceTracing = Set-AzIotHubDistributedTracing -ResourceGroupName $ResourceGroupName -IotHubName $IotHubName -DeviceId $device1 -mode 'Enabled' -rate 45 + Assert-True { $updatedDeviceTracing.DeviceId -eq $device1} + Assert-True { $updatedDeviceTracing.TracingOption.SamplingMode -eq 'Enabled'} + Assert-True { $updatedDeviceTracing.TracingOption.SamplingRate -eq 45} + Assert-False { $updatedDeviceTracing.IsSynced} + + # Delete all devices + $result = Remove-AzIotHubDevice -ResourceGroupName $ResourceGroupName -IotHubName $IotHubName -Passthru + Assert-True { $result } +} \ No newline at end of file diff --git a/src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPTracingTests/TestAzureIotHubTracing.json b/src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPTracingTests/TestAzureIotHubTracing.json new file mode 100644 index 000000000000..0523738aacf5 --- /dev/null +++ b/src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPTracingTests/TestAzureIotHubTracing.json @@ -0,0 +1,1008 @@ +{ + "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": [ + "4bd8b0ed-a325-4098-9b25-1883a023caf2" + ], + "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.7" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "3e0bf4a8-3bd9-4ba8-a1a9-a84c8f9cfe04" + ], + "x-ms-correlation-request-id": [ + "3e0bf4a8-3bd9-4ba8-a1a9-a84c8f9cfe04" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230701Z:3e0bf4a8-3bd9-4ba8-a1a9-a84c8f9cfe04" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:07:01 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "5705" + ] + }, + "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 \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"checkNameAvailability\",\r\n \"locations\": [],\r\n \"apiVersions\": [\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\": \"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 \"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 \"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 \"apiVersions\": [\r\n \"2020-01-01\",\r\n \"2019-11-04\",\r\n \"2019-09-01\",\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-preview\",\r\n \"2018-04-01\",\r\n \"2018-01-22-preview\",\r\n \"2018-01-22\",\r\n \"2017-11-15\",\r\n \"2017-09-25-preview\",\r\n \"2017-08-21-preview\",\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\": \"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-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 \"2018-01-22\",\r\n \"2017-11-15\",\r\n \"2017-08-21-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\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/ps2438?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlZ3JvdXBzL3BzMjQzOD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West US 2\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b0ff9af9-776a-4e62-99af-fb57cec36d11" + ], + "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.7" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "1884395e-0984-49ac-a53d-edbfd9c0f5be" + ], + "x-ms-correlation-request-id": [ + "1884395e-0984-49ac-a53d-edbfd9c0f5be" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230702Z:1884395e-0984-49ac-a53d-edbfd9c0f5be" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:07:02 GMT" + ], + "Content-Length": [ + "166" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438\",\r\n \"name\": \"ps2438\",\r\n \"location\": \"westus2\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTg/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"capacity\": 1\r\n },\r\n \"location\": \"West US 2\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8cb01586-031b-423a-95f9-8556a3f95315" + ], + "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": [ + "87" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/providers/Microsoft.Devices/operationResults/b3NfaWhfNTdmZGViZTctYzk3NC00ZTY4LTgxOWQtODNlMmU2MmYxNmJj?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": [ + "ede98e8f-53d8-40a6-a99a-27d1ec0dc152" + ], + "x-ms-correlation-request-id": [ + "ede98e8f-53d8-40a6-a99a-27d1ec0dc152" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230724Z:ede98e8f-53d8-40a6-a99a-27d1ec0dc152" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:07:23 GMT" + ], + "Content-Length": [ + "621" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798\",\r\n \"name\": \"ps4798\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US 2\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps2438\",\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/b3NfaWhfNTdmZGViZTctYzk3NC00ZTY4LTgxOWQtODNlMmU2MmYxNmJj?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmTlRkbVpHVmlaVGN0WXprM05DMDBaVFk0TFRneE9XUXRPRE5sTW1VMk1tWXhObUpqP2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWgmYXN5bmNpbmZv", + "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": [ + "11980" + ], + "x-ms-request-id": [ + "888f81b5-d1c2-4720-b190-47a68b1c5c41" + ], + "x-ms-correlation-request-id": [ + "888f81b5-d1c2-4720-b190-47a68b1c5c41" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230754Z:888f81b5-d1c2-4720-b190-47a68b1c5c41" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:07:53 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/b3NfaWhfNTdmZGViZTctYzk3NC00ZTY4LTgxOWQtODNlMmU2MmYxNmJj?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmTlRkbVpHVmlaVGN0WXprM05DMDBaVFk0TFRneE9XUXRPRE5sTW1VMk1tWXhObUpqP2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWgmYXN5bmNpbmZv", + "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": [ + "11979" + ], + "x-ms-request-id": [ + "eb21caef-9833-47d1-8cd1-16e48fb57e89" + ], + "x-ms-correlation-request-id": [ + "eb21caef-9833-47d1-8cd1-16e48fb57e89" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230824Z:eb21caef-9833-47d1-8cd1-16e48fb57e89" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:23 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/b3NfaWhfNTdmZGViZTctYzk3NC00ZTY4LTgxOWQtODNlMmU2MmYxNmJj?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGV2aWNlcy9vcGVyYXRpb25SZXN1bHRzL2IzTmZhV2hmTlRkbVpHVmlaVGN0WXprM05DMDBaVFk0TFRneE9XUXRPRE5sTW1VMk1tWXhObUpqP2FwaS12ZXJzaW9uPTIwMTktMDctMDEtcHJldmlldyZvcGVyYXRpb25Tb3VyY2U9b3NfaWgmYXN5bmNpbmZv", + "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": [ + "11978" + ], + "x-ms-request-id": [ + "eff2e561-1266-401d-a438-acaf20f1fffe" + ], + "x-ms-correlation-request-id": [ + "eff2e561-1266-401d-a438-acaf20f1fffe" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230854Z:eff2e561-1266-401d-a438-acaf20f1fffe" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:54 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/ps2438/providers/Microsoft.Devices/IotHubs/ps4798?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTg/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": [ + "11977" + ], + "x-ms-request-id": [ + "17494ebe-ee50-44fb-966a-cfb16ebd3091" + ], + "x-ms-correlation-request-id": [ + "17494ebe-ee50-44fb-966a-cfb16ebd3091" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230855Z:17494ebe-ee50-44fb-966a-cfb16ebd3091" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:55 GMT" + ], + "Content-Length": [ + "1472" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798\",\r\n \"name\": \"ps4798\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US 2\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps2438\",\r\n \"etag\": \"AAAAAAvL20c=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US 2\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"West Central US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps4798.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\": \"ps4798\",\r\n \"endpoint\": \"sb://iothub-ns-ps4798-3020477-d95db4544d.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/ps2438/providers/Microsoft.Devices/IotHubs/ps4798?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTg/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fa13bd46-397e-4078-894a-18fa250cb82c" + ], + "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": [ + "11976" + ], + "x-ms-request-id": [ + "2464fdcb-34aa-45fd-b0d6-abe621d48533" + ], + "x-ms-correlation-request-id": [ + "2464fdcb-34aa-45fd-b0d6-abe621d48533" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230856Z:2464fdcb-34aa-45fd-b0d6-abe621d48533" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:55 GMT" + ], + "Content-Length": [ + "1472" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798\",\r\n \"name\": \"ps4798\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US 2\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps2438\",\r\n \"etag\": \"AAAAAAvL20c=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US 2\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"West Central US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps4798.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\": \"ps4798\",\r\n \"endpoint\": \"sb://iothub-ns-ps4798-3020477-d95db4544d.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/ps2438/providers/Microsoft.Devices/IotHubs/ps4798?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTg/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7481dd4b-75f5-4c1c-b761-008443615afa" + ], + "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": [ + "11975" + ], + "x-ms-request-id": [ + "ea5557e1-a27f-4753-a882-9e05a63b1fe6" + ], + "x-ms-correlation-request-id": [ + "ea5557e1-a27f-4753-a882-9e05a63b1fe6" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230856Z:ea5557e1-a27f-4753-a882-9e05a63b1fe6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:56 GMT" + ], + "Content-Length": [ + "1472" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798\",\r\n \"name\": \"ps4798\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US 2\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps2438\",\r\n \"etag\": \"AAAAAAvL20c=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US 2\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"West Central US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps4798.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\": \"ps4798\",\r\n \"endpoint\": \"sb://iothub-ns-ps4798-3020477-d95db4544d.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/ps2438/providers/Microsoft.Devices/IotHubs/ps4798?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTg/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7045908c-d040-4860-8f4f-9fd355b70b47" + ], + "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": [ + "11974" + ], + "x-ms-request-id": [ + "417cd353-eb42-435e-a835-37de393e19e8" + ], + "x-ms-correlation-request-id": [ + "417cd353-eb42-435e-a835-37de393e19e8" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230857Z:417cd353-eb42-435e-a835-37de393e19e8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:57 GMT" + ], + "Content-Length": [ + "1472" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798\",\r\n \"name\": \"ps4798\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US 2\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps2438\",\r\n \"etag\": \"AAAAAAvL20c=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US 2\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"West Central US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps4798.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\": \"ps4798\",\r\n \"endpoint\": \"sb://iothub-ns-ps4798-3020477-d95db4544d.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/ps2438/providers/Microsoft.Devices/IotHubs/ps4798?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTg/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c7a02808-832e-4e1c-9d70-3c37f2d210c5" + ], + "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": [ + "11973" + ], + "x-ms-request-id": [ + "55844386-bd26-4554-b9f4-fd1dd6439d53" + ], + "x-ms-correlation-request-id": [ + "55844386-bd26-4554-b9f4-fd1dd6439d53" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230858Z:55844386-bd26-4554-b9f4-fd1dd6439d53" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:58 GMT" + ], + "Content-Length": [ + "1472" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798\",\r\n \"name\": \"ps4798\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US 2\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps2438\",\r\n \"etag\": \"AAAAAAvL20c=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US 2\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"West Central US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps4798.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\": \"ps4798\",\r\n \"endpoint\": \"sb://iothub-ns-ps4798-3020477-d95db4544d.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/ps2438/providers/Microsoft.Devices/IotHubs/ps4798?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTg/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6818758d-3ac9-4ed6-9a54-d3991680d216" + ], + "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": [ + "11972" + ], + "x-ms-request-id": [ + "3fe38bf7-6874-4329-88da-795234783452" + ], + "x-ms-correlation-request-id": [ + "3fe38bf7-6874-4329-88da-795234783452" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230859Z:3fe38bf7-6874-4329-88da-795234783452" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:59 GMT" + ], + "Content-Length": [ + "1472" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798\",\r\n \"name\": \"ps4798\",\r\n \"type\": \"Microsoft.Devices/IotHubs\",\r\n \"location\": \"West US 2\",\r\n \"tags\": {},\r\n \"subscriptionid\": \"91d12660-3dec-467a-be2a-213b5544ddc0\",\r\n \"resourcegroup\": \"ps2438\",\r\n \"etag\": \"AAAAAAvL20c=\",\r\n \"properties\": {\r\n \"locations\": [\r\n {\r\n \"location\": \"West US 2\",\r\n \"role\": \"primary\"\r\n },\r\n {\r\n \"location\": \"West Central US\",\r\n \"role\": \"secondary\"\r\n }\r\n ],\r\n \"state\": \"Active\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"ipFilterRules\": [],\r\n \"hostName\": \"ps4798.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\": \"ps4798\",\r\n \"endpoint\": \"sb://iothub-ns-ps4798-3020477-d95db4544d.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/ps2438/providers/Microsoft.Devices/IotHubs/ps4798/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTgvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "dd238c5b-b255-4230-af4f-2c531596fbd4" + ], + "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": [ + "1186" + ], + "x-ms-request-id": [ + "8e5ce866-6478-4ba9-ae97-b775a8a3693f" + ], + "x-ms-correlation-request-id": [ + "8e5ce866-6478-4ba9-ae97-b775a8a3693f" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230856Z:8e5ce866-6478-4ba9-ae97-b775a8a3693f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:56 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\": \"fg0ZPmZDUzz6B70i0EP7jVWNVBSMHgykBLz0p4dIoWs=\",\r\n \"secondaryKey\": \"PxAs1/3t3eOgHfyz8WKsq20swVv2i3k9Ml/FYTm4aW0=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"qZnC25Kc+OgQiFOGEzVjp4kdOsshUw98yHjF81JVmfw=\",\r\n \"secondaryKey\": \"+yeNJ39Fm8kMQ+1yLmE1qqVoz4P1mbqkNCBwdOdLZ28=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"sXaHRu5lvZyw0/cnfiqMORqIh5N3xcLIq9B7dUuJIts=\",\r\n \"secondaryKey\": \"Sf3PNqcTDuzVq3Mn7SfytMuTEoq2Oulr+qXV2VCVV6I=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Hk8QAWgnOdEeuIhDMS+p465KrCJLj7DhrYSO8grzWC4=\",\r\n \"secondaryKey\": \"RhDAOsoCH1pSDtvZTNHkFXhk9e5P31/jKcumPJsJSe0=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"uMuImYTW9RvfuPs3hvh2A9JAm4coulHdaYWHygPfJ6U=\",\r\n \"secondaryKey\": \"lq49VRlqxB67ptjHGlj4e4rUqFPE+r9Fvlb9wpDhXac=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTgvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "68237ea1-ef11-4666-ae79-171aa271a411" + ], + "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": [ + "1185" + ], + "x-ms-request-id": [ + "6767ae54-4634-4aac-96a4-07c6c70d4d12" + ], + "x-ms-correlation-request-id": [ + "6767ae54-4634-4aac-96a4-07c6c70d4d12" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230857Z:6767ae54-4634-4aac-96a4-07c6c70d4d12" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:57 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\": \"fg0ZPmZDUzz6B70i0EP7jVWNVBSMHgykBLz0p4dIoWs=\",\r\n \"secondaryKey\": \"PxAs1/3t3eOgHfyz8WKsq20swVv2i3k9Ml/FYTm4aW0=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"qZnC25Kc+OgQiFOGEzVjp4kdOsshUw98yHjF81JVmfw=\",\r\n \"secondaryKey\": \"+yeNJ39Fm8kMQ+1yLmE1qqVoz4P1mbqkNCBwdOdLZ28=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"sXaHRu5lvZyw0/cnfiqMORqIh5N3xcLIq9B7dUuJIts=\",\r\n \"secondaryKey\": \"Sf3PNqcTDuzVq3Mn7SfytMuTEoq2Oulr+qXV2VCVV6I=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Hk8QAWgnOdEeuIhDMS+p465KrCJLj7DhrYSO8grzWC4=\",\r\n \"secondaryKey\": \"RhDAOsoCH1pSDtvZTNHkFXhk9e5P31/jKcumPJsJSe0=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"uMuImYTW9RvfuPs3hvh2A9JAm4coulHdaYWHygPfJ6U=\",\r\n \"secondaryKey\": \"lq49VRlqxB67ptjHGlj4e4rUqFPE+r9Fvlb9wpDhXac=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTgvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f96c21a1-09f6-4787-a809-580c4b030d42" + ], + "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": [ + "1184" + ], + "x-ms-request-id": [ + "4d2607c7-9c5a-49a9-9043-18bd1391ea56" + ], + "x-ms-correlation-request-id": [ + "4d2607c7-9c5a-49a9-9043-18bd1391ea56" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230858Z:4d2607c7-9c5a-49a9-9043-18bd1391ea56" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:58 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\": \"fg0ZPmZDUzz6B70i0EP7jVWNVBSMHgykBLz0p4dIoWs=\",\r\n \"secondaryKey\": \"PxAs1/3t3eOgHfyz8WKsq20swVv2i3k9Ml/FYTm4aW0=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"qZnC25Kc+OgQiFOGEzVjp4kdOsshUw98yHjF81JVmfw=\",\r\n \"secondaryKey\": \"+yeNJ39Fm8kMQ+1yLmE1qqVoz4P1mbqkNCBwdOdLZ28=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"sXaHRu5lvZyw0/cnfiqMORqIh5N3xcLIq9B7dUuJIts=\",\r\n \"secondaryKey\": \"Sf3PNqcTDuzVq3Mn7SfytMuTEoq2Oulr+qXV2VCVV6I=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Hk8QAWgnOdEeuIhDMS+p465KrCJLj7DhrYSO8grzWC4=\",\r\n \"secondaryKey\": \"RhDAOsoCH1pSDtvZTNHkFXhk9e5P31/jKcumPJsJSe0=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"uMuImYTW9RvfuPs3hvh2A9JAm4coulHdaYWHygPfJ6U=\",\r\n \"secondaryKey\": \"lq49VRlqxB67ptjHGlj4e4rUqFPE+r9Fvlb9wpDhXac=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/ps2438/providers/Microsoft.Devices/IotHubs/ps4798/listkeys?api-version=2019-07-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTFkMTI2NjAtM2RlYy00NjdhLWJlMmEtMjEzYjU1NDRkZGMwL3Jlc291cmNlR3JvdXBzL3BzMjQzOC9wcm92aWRlcnMvTWljcm9zb2Z0LkRldmljZXMvSW90SHVicy9wczQ3OTgvbGlzdGtleXM/YXBpLXZlcnNpb249MjAxOS0wNy0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6ed496a3-49b9-4cb7-b8ef-1ab78e526d5c" + ], + "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": [ + "1183" + ], + "x-ms-request-id": [ + "8f269c8f-ac48-4bac-b9dd-0206b045fe83" + ], + "x-ms-correlation-request-id": [ + "8f269c8f-ac48-4bac-b9dd-0206b045fe83" + ], + "x-ms-routing-request-id": [ + "WESTUS:20200302T230859Z:8f269c8f-ac48-4bac-b9dd-0206b045fe83" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 02 Mar 2020 23:08:59 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\": \"fg0ZPmZDUzz6B70i0EP7jVWNVBSMHgykBLz0p4dIoWs=\",\r\n \"secondaryKey\": \"PxAs1/3t3eOgHfyz8WKsq20swVv2i3k9Ml/FYTm4aW0=\",\r\n \"rights\": \"RegistryWrite, ServiceConnect, DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"service\",\r\n \"primaryKey\": \"qZnC25Kc+OgQiFOGEzVjp4kdOsshUw98yHjF81JVmfw=\",\r\n \"secondaryKey\": \"+yeNJ39Fm8kMQ+1yLmE1qqVoz4P1mbqkNCBwdOdLZ28=\",\r\n \"rights\": \"ServiceConnect\"\r\n },\r\n {\r\n \"keyName\": \"device\",\r\n \"primaryKey\": \"sXaHRu5lvZyw0/cnfiqMORqIh5N3xcLIq9B7dUuJIts=\",\r\n \"secondaryKey\": \"Sf3PNqcTDuzVq3Mn7SfytMuTEoq2Oulr+qXV2VCVV6I=\",\r\n \"rights\": \"DeviceConnect\"\r\n },\r\n {\r\n \"keyName\": \"registryRead\",\r\n \"primaryKey\": \"Hk8QAWgnOdEeuIhDMS+p465KrCJLj7DhrYSO8grzWC4=\",\r\n \"secondaryKey\": \"RhDAOsoCH1pSDtvZTNHkFXhk9e5P31/jKcumPJsJSe0=\",\r\n \"rights\": \"RegistryRead\"\r\n },\r\n {\r\n \"keyName\": \"registryReadWrite\",\r\n \"primaryKey\": \"uMuImYTW9RvfuPs3hvh2A9JAm4coulHdaYWHygPfJ6U=\",\r\n \"secondaryKey\": \"lq49VRlqxB67ptjHGlj4e4rUqFPE+r9Fvlb9wpDhXac=\",\r\n \"rights\": \"RegistryWrite\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + } + ], + "Names": { + "Test-AzureRmIotHubTracing": [ + "ps4798", + "ps2438", + "ps5622", + "ps305" + ] + }, + "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 ebe6d0080d90..eb7d8f6e24b3 100644 --- a/src/IotHub/IotHub/Az.IotHub.psd1 +++ b/src/IotHub/IotHub/Az.IotHub.psd1 @@ -99,8 +99,8 @@ CmdletsToExport = 'Add-AzIotHubKey', 'Get-AzIotHubEventHubConsumerGroup', 'Set-AzIotHubModule', 'Get-AzIotHubDeviceConnectionString', 'Get-AzIotHubModuleConnectionString', 'Get-AzIotHubDeviceParent', 'Set-AzIotHubDeviceParent', 'Add-AzIotHubDeviceChildren', - 'Remove-AzIotHubDeviceChildren', 'Get-AzIotHubDeviceChildren' - + 'Remove-AzIotHubDeviceChildren', 'Get-AzIotHubDeviceChildren', + 'Get-AzIotHubDistributedTracing', 'Set-AzIotHubDistributedTracing' # Variables to export from this module # VariablesToExport = @() @@ -109,7 +109,8 @@ AliasesToExport = 'Get-AzIotHubEHCG', 'Add-AzIotHubEHCG', 'Remove-AzIotHubEHCG', 'Set-AzIotHubVC', 'Get-AzIotHubCVC', 'Add-AzIotHubMsgEnrich', 'Get-AzIotHubMsgEnrich', 'Remove-AzIotHubMsgEnrich', 'Set-AzIotHubMsgEnrich', 'Get-AzIotHubDCS', 'Get-AzIotHubMCS', - 'Add-AzIotHubDCL', 'Remove-AzIotHubDCL', 'Get-AzIotHubDCL' + 'Add-AzIotHubDCL', 'Remove-AzIotHubDCL', 'Get-AzIotHubDCL', + 'Get-AzIotHubTracing', 'Set-AzIotHubTracing' # DSC resources to export from this module # DscResourcesToExport = @() diff --git a/src/IotHub/IotHub/ChangeLog.md b/src/IotHub/IotHub/ChangeLog.md index 5ca653eebed3..3f190cf81168 100644 --- a/src/IotHub/IotHub/ChangeLog.md +++ b/src/IotHub/IotHub/ChangeLog.md @@ -36,6 +36,9 @@ - `Get-AzIotHubDeviceParent` - `Set-AzIotHubDeviceParent` * Added support to manage device parent-child relationship. +* Added support to manage distributed settings per-device. New Cmdlets are: + - `Get-AzIotHubDistributedTracing` + - `Set-AzIotHubDistributedTracing` ## Version 2.1.0 * Added support to manage devices in an Iot Hub. New Cmdlets are: diff --git a/src/IotHub/IotHub/Common/IotHubDataPlaneUtils.cs b/src/IotHub/IotHub/Common/IotHubDataPlaneUtils.cs index 369f3fc073c2..ebd24700b9c8 100644 --- a/src/IotHub/IotHub/Common/IotHubDataPlaneUtils.cs +++ b/src/IotHub/IotHub/Common/IotHubDataPlaneUtils.cs @@ -14,13 +14,22 @@ namespace Microsoft.Azure.Commands.Management.IotHub.Common { + using System; using System.Collections.Generic; using System.Linq; using Microsoft.Azure.Commands.Management.IotHub.Models; using Microsoft.Azure.Devices; + using Microsoft.Azure.Devices.Shared; + using Newtonsoft.Json; public static class IotHubDataPlaneUtils { + public const string DeviceScopePrefix = "ms-azure-iot-edge://"; + public const string TracingAllowedForSku = "standard"; + public const string TracingProperty = "azureiot*com^dtracing^1"; + + public static readonly string[] TracingAllowedForLocation = { "northeurope", "westus2", "west us 2", "southeastasia" }; + public static string GetEdgeDevices() { return "select * from devices where capabilities.iotEdge=true"; @@ -60,5 +69,47 @@ public static IEnumerable ToPSModules(IEnumerable modules) { return IotHubUtils.ConvertObject, IEnumerable>(modules.ToList()); } + + public static void ValidateDeviceTracing(string DeviceId, string Sku, string Location, bool IsEdgeDevice) + { + if (!TracingAllowedForLocation.Any(location => location.Equals(Location, StringComparison.OrdinalIgnoreCase))) + { + throw new ArgumentException($"Distributed tracing isn\'t supported for the hub located at \"{Location}\""); + } + if (!TracingAllowedForSku.Equals(Sku, StringComparison.OrdinalIgnoreCase)) + { + throw new ArgumentException($"Distributed tracing isn\'t supported for the hub belongs to \"{Sku}\" sku tier."); + } + if (IsEdgeDevice) + { + throw new ArgumentException($"The device \"{DeviceId}\" should be non-edge device."); + } + } + + public static PSDeviceTracing GetDeviceTracing(string DeviceId, Twin deviceTwin) + { + PSDeviceTracing psDeviceTracing = new PSDeviceTracing + { + DeviceId = DeviceId, + TracingOption = new PSDistributedTracing() { SamplingMode = PSDistributedTracingSamplingMode.Disabled, SamplingRate = 0 }, + IsSynced = false + }; + + if (deviceTwin.Properties.Desired.Contains(TracingProperty)) + { + psDeviceTracing.TracingOption = JsonConvert.DeserializeObject(deviceTwin.Properties.Desired[TracingProperty].ToString()); + } + + if (deviceTwin.Properties.Reported.Contains(TracingProperty)) + { + PSDistributedTracing psReportedDistributedTracing = JsonConvert.DeserializeObject(deviceTwin.Properties.Reported[TracingProperty].ToString()); + if (psReportedDistributedTracing != null) + { + psDeviceTracing.IsSynced = (psDeviceTracing.TracingOption.SamplingMode.Equals(psReportedDistributedTracing.SamplingMode) && psDeviceTracing.TracingOption.SamplingRate.Equals(psReportedDistributedTracing.SamplingRate)); + } + } + + return psDeviceTracing; + } } } \ No newline at end of file diff --git a/src/IotHub/IotHub/IotHub.format.ps1xml b/src/IotHub/IotHub/IotHub.format.ps1xml index 31917acf787e..409371120de3 100644 --- a/src/IotHub/IotHub/IotHub.format.ps1xml +++ b/src/IotHub/IotHub/IotHub.format.ps1xml @@ -898,5 +898,35 @@ + + + Microsoft.Azure.Commands.Management.IotHub.Models.PSDeviceTracing + + + Microsoft.Azure.Commands.Management.IotHub.Models.PSDeviceTracing + + + + + + + DeviceId + + + + $_.TracingOption.SamplingMode + + + + if($_.TracingOption.SamplingMode.value__ -eq 1) { "$($_.TracingOption.SamplingRate)%" } else { "" } + + + IsSynced + + + + + + \ No newline at end of file diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Device/GetAzIotHubDeviceParent.cs b/src/IotHub/IotHub/IotHub/DataPlane/Device/GetAzIotHubDeviceParent.cs index bd9de8879976..a3a0c5c9cd5f 100644 --- a/src/IotHub/IotHub/IotHub/DataPlane/Device/GetAzIotHubDeviceParent.cs +++ b/src/IotHub/IotHub/IotHub/DataPlane/Device/GetAzIotHubDeviceParent.cs @@ -92,8 +92,8 @@ public override void ExecuteCmdlet() { throw new ArgumentException($"The entered device \"{this.DeviceId}\" doesn\'t support parent device functionality."); } - - string parentDeviceId = childDevice.Scope.Substring(Properties.Resources.DEVICE_DEVICESCOPE_PREFIX.Length, childDevice.Scope.LastIndexOf("-") - Properties.Resources.DEVICE_DEVICESCOPE_PREFIX.Length); + + string parentDeviceId = childDevice.Scope.Substring(IotHubDataPlaneUtils.DeviceScopePrefix.Length, childDevice.Scope.LastIndexOf("-") - IotHubDataPlaneUtils.DeviceScopePrefix.Length); this.WriteObject(IotHubDataPlaneUtils.ToPSDevice(registryManager.GetDeviceAsync(parentDeviceId).GetAwaiter().GetResult())); } diff --git a/src/IotHub/IotHub/IotHub/DataPlane/DistributedTracing/GetAzIotHubDistributedTracing.cs b/src/IotHub/IotHub/IotHub/DataPlane/DistributedTracing/GetAzIotHubDistributedTracing.cs new file mode 100644 index 000000000000..acf1d003c441 --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/DistributedTracing/GetAzIotHubDistributedTracing.cs @@ -0,0 +1,98 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Devices.Shared; + using Microsoft.Azure.Management.IotHub; + using Microsoft.Azure.Management.IotHub.Models; + using ResourceManager.Common.ArgumentCompleters; + + [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubDistributedTracing", DefaultParameterSetName = ResourceParameterSet)] + [Alias("Get-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubTracing")] + [OutputType(typeof(PSDeviceTracing))] + public class GetAzIotHubDistributedTracing : 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 = ResourceParameterSet, HelpMessage = "Name of the Resource Group")] + [ValidateNotNullOrEmpty] + [ResourceGroupCompleter] + public string ResourceGroupName { 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 = 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 = "Target Device Id.")] + [Parameter(Position = 1, Mandatory = true, ParameterSetName = ResourceIdParameterSet, HelpMessage = "Target Device Id.")] + [Parameter(Position = 2, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Target Device Id.")] + [ValidateNotNullOrEmpty] + public string DeviceId { 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); + + Twin deviceTwin = registryManager.GetTwinAsync(this.DeviceId).GetAwaiter().GetResult(); + + if (deviceTwin == null) + { + throw new ArgumentException($"The entered non-edge device \"{this.DeviceId}\" doesn't exist."); + } + + IotHubDataPlaneUtils.ValidateDeviceTracing(this.DeviceId, iotHubDescription.Sku.Tier.Value.ToString(), iotHubDescription.Location, deviceTwin.Capabilities.IotEdge); + + this.WriteObject(IotHubDataPlaneUtils.GetDeviceTracing(this.DeviceId, deviceTwin)); + } + } +} diff --git a/src/IotHub/IotHub/IotHub/DataPlane/DistributedTracing/SetAzIotHubDistributedTracing.cs b/src/IotHub/IotHub/IotHub/DataPlane/DistributedTracing/SetAzIotHubDistributedTracing.cs new file mode 100644 index 000000000000..52d4e46b6d87 --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/DistributedTracing/SetAzIotHubDistributedTracing.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.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.Devices.Shared; + using Microsoft.Azure.Management.IotHub; + using Microsoft.Azure.Management.IotHub.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + using Newtonsoft.Json; + using ResourceManager.Common.ArgumentCompleters; + + [Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubDistributedTracing", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)] + [Alias("Set-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubTracing")] + [OutputType(typeof(PSDeviceTracing))] + public class SetAzIotHubDistributedTracing : 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 = ResourceParameterSet, HelpMessage = "Name of the Resource Group")] + [ValidateNotNullOrEmpty] + [ResourceGroupCompleter] + public string ResourceGroupName { 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 = 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 = "Target Device Id.")] + [Parameter(Position = 1, Mandatory = true, ParameterSetName = ResourceIdParameterSet, HelpMessage = "Target Device Id.")] + [Parameter(Position = 2, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Target Device Id.")] + [ValidateNotNullOrEmpty] + public string DeviceId { get; set; } + + [Parameter(Position = 2, Mandatory = true, ParameterSetName = InputObjectParameterSet, HelpMessage = "Turns sampling for distributed tracing enable and disable.")] + [Parameter(Position = 2, Mandatory = true, ParameterSetName = ResourceIdParameterSet, HelpMessage = "Turns sampling for distributed tracing enable and disable.")] + [Parameter(Position = 3, Mandatory = true, ParameterSetName = ResourceParameterSet, HelpMessage = "Turns sampling for distributed tracing enable and disable.")] + [Alias("Mode")] + public PSDistributedTracingSamplingMode SamplingMode { get; set; } + + [Parameter(Mandatory = false, ParameterSetName = InputObjectParameterSet, HelpMessage = "Controls the amount of messages sampled for adding trace context. This value is a percentage. Only values from 0 to 100 (inclusive) are permitted.")] + [Parameter(Mandatory = false, ParameterSetName = ResourceIdParameterSet, HelpMessage = "Controls the amount of messages sampled for adding trace context. This value is a percentage. Only values from 0 to 100 (inclusive) are permitted.")] + [Parameter(Mandatory = false, ParameterSetName = ResourceParameterSet, HelpMessage = "Controls the amount of messages sampled for adding trace context. This value is a percentage. Only values from 0 to 100 (inclusive) are permitted.")] + [ValidateRange(0,100)] + [Alias("Rate")] + public int SamplingRate { get; set; } + + public override void ExecuteCmdlet() + { + if (ShouldProcess(this.DeviceId, Properties.Resources.SetIotHubDistributedTracing)) + { + 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); + + PSDistributedTracing psDistributedTracing = new PSDistributedTracing(); + Twin deviceTwin = registryManager.GetTwinAsync(this.DeviceId).GetAwaiter().GetResult(); + + IotHubDataPlaneUtils.ValidateDeviceTracing(this.DeviceId, iotHubDescription.Sku.Tier.Value.ToString(), iotHubDescription.Location, deviceTwin.Capabilities.IotEdge); + + if (deviceTwin.Properties.Desired.Contains(IotHubDataPlaneUtils.TracingProperty)) + { + psDistributedTracing = JsonConvert.DeserializeObject(deviceTwin.Properties.Desired[IotHubDataPlaneUtils.TracingProperty].ToString()); + } + + psDistributedTracing.SamplingMode = this.SamplingMode; + + if (this.SamplingMode.Equals(PSDistributedTracingSamplingMode.Enabled)) + { + if (this.IsParameterBound(c => c.SamplingRate)) + { + psDistributedTracing.SamplingRate = this.SamplingRate; + } + } + + deviceTwin.Properties.Desired[IotHubDataPlaneUtils.TracingProperty] = psDistributedTracing; + + deviceTwin = registryManager.UpdateTwinAsync(this.DeviceId, deviceTwin, deviceTwin.ETag).GetAwaiter().GetResult(); + + this.WriteObject(IotHubDataPlaneUtils.GetDeviceTracing(this.DeviceId, deviceTwin)); + } + } + } +} diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDeviceTracing.cs b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDeviceTracing.cs new file mode 100644 index 000000000000..d809bbec147c --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDeviceTracing.cs @@ -0,0 +1,35 @@ +// 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 +{ + /// + /// Distributed settings of the device. + /// + public class PSDeviceTracing + { + /// + /// Device ID. + /// + public string DeviceId { get; set; } + + /// + /// Distributed tracing option. + /// + public PSDistributedTracing TracingOption { get; set; } + + /// + /// Indicates that desired distributed settings are sync with reported. + /// + public bool IsSynced { get; set; } + } +} diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDistributedTracing.cs b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDistributedTracing.cs new file mode 100644 index 000000000000..3e777765b9de --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDistributedTracing.cs @@ -0,0 +1,34 @@ +// 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 Newtonsoft.Json; + + /// + /// Distributed tracing options. + /// + public class PSDistributedTracing + { + /// + /// Distributed tracing sampling mode. + /// + [JsonProperty(PropertyName = "sampling_mode")] + public PSDistributedTracingSamplingMode SamplingMode { get; set; } + + /// + /// Distributed tracing sampling rate in percent. + /// + [JsonProperty(PropertyName = "sampling_rate")] + public int SamplingRate { get; set; } + } +} diff --git a/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDistributedTracingSamplingMode.cs b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDistributedTracingSamplingMode.cs new file mode 100644 index 000000000000..961f0b513823 --- /dev/null +++ b/src/IotHub/IotHub/IotHub/DataPlane/Models/PSDistributedTracingSamplingMode.cs @@ -0,0 +1,32 @@ +// ---------------------------------------------------------------------------------- +// +// 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 +{ + /// + /// Specifies the different sampling mode of distributed tracing. + /// + public enum PSDistributedTracingSamplingMode + { + /// + /// Indicates that a distributed tracing is disabled + /// + Disabled = 0, + + /// + /// Indicates that a distributed tracing is enabled + /// + Enabled = 1 + } +} diff --git a/src/IotHub/IotHub/Properties/Resources.Designer.cs b/src/IotHub/IotHub/Properties/Resources.Designer.cs index cd3254bf471e..82d50637551c 100644 --- a/src/IotHub/IotHub/Properties/Resources.Designer.cs +++ b/src/IotHub/IotHub/Properties/Resources.Designer.cs @@ -148,15 +148,6 @@ internal static string AddIotHubRoutingEndpoint { } } - /// - /// Looks up a localized string similar to ms-azure-iot-edge://. - /// - internal static string DEVICE_DEVICESCOPE_PREFIX { - get { - return ResourceManager.GetString("DEVICE_DEVICESCOPE_PREFIX", resourceCulture); - } - } - /// /// Looks up a localized string similar to Failover Iot Hub to the secondary location.. /// @@ -301,6 +292,15 @@ internal static string RemoveIotHubRoutingEndpoint { } } + /// + /// Looks up a localized string similar to Update Distributed Tracing. + /// + internal static string SetIotHubDistributedTracing { + get { + return ResourceManager.GetString("SetIotHubDistributedTracing", resourceCulture); + } + } + /// /// Looks up a localized string similar to Set Parent Device. /// diff --git a/src/IotHub/IotHub/Properties/Resources.resx b/src/IotHub/IotHub/Properties/Resources.resx index 8a44dc0eb8be..12803c0988bc 100644 --- a/src/IotHub/IotHub/Properties/Resources.resx +++ b/src/IotHub/IotHub/Properties/Resources.resx @@ -207,9 +207,6 @@ Update Module - - ms-azure-iot-edge:// - Set Parent Device @@ -219,4 +216,7 @@ Remove Device Children + + Update Distributed Tracing + \ No newline at end of file diff --git a/src/IotHub/IotHub/help/Az.IotHub.md b/src/IotHub/IotHub/help/Az.IotHub.md index 54e857cb5da5..0529cd95debe 100644 --- a/src/IotHub/IotHub/help/Az.IotHub.md +++ b/src/IotHub/IotHub/help/Az.IotHub.md @@ -62,6 +62,9 @@ Get the connection string of a target IoT device in an Iot Hub. ### [Get-AzIotHubDeviceParent](Get-AzIotHubDeviceParent.md) Get the parent device of the specified device. +### [Get-AzIotHubDistributedTracing](Get-AzIotHubDistributedTracing.md) +Get the distributed tracing settings for a device. + ### [Get-AzIotHubEventHubConsumerGroup](Get-AzIotHubEventHubConsumerGroup.md) Gets all the eventhub consumergroups. @@ -149,6 +152,9 @@ Update an IoT Hub device. ### [Set-AzIotHubDeviceParent](Set-AzIotHubDeviceParent.md) Set the parent device of the specified device. +### [Set-AzIotHubDistributedTracing](Set-AzIotHubDistributedTracing.md) +Update the distributed tracing options for a device. + ### [Set-AzIotHubMessageEnrichment](Set-AzIotHubMessageEnrichment.md) Update a message enrichment in your IoT hub. diff --git a/src/IotHub/IotHub/help/Get-AzIotHubDistributedTracing.md b/src/IotHub/IotHub/help/Get-AzIotHubDistributedTracing.md new file mode 100644 index 000000000000..d74b34c19c95 --- /dev/null +++ b/src/IotHub/IotHub/help/Get-AzIotHubDistributedTracing.md @@ -0,0 +1,157 @@ +--- +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-aziothubdistributedtracing +schema: 2.0.0 +--- + +# Get-AzIotHubDistributedTracing + +## SYNOPSIS +Get the distributed tracing settings for a device. + +## SYNTAX + +### ResourceSet (Default) +``` +Get-AzIotHubDistributedTracing [-ResourceGroupName] [-IotHubName] [-DeviceId] + [-DefaultProfile ] [] +``` + +### InputObjectSet +``` +Get-AzIotHubDistributedTracing [-InputObject] [-DeviceId] + [-DefaultProfile ] [] +``` + +### ResourceIdSet +``` +Get-AzIotHubDistributedTracing [-ResourceId] [-DeviceId] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get the distributed tracing settings for a device. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-AzIotHubDistributedTracing -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" + +DeviceId : mydevice1 +Sampling Mode : Enabled +Sampling Rate : 22% +IsSynced : False +``` + +Get the distributed tracing settings for a device. + +## 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 +``` + +### -DeviceId +Target Device Id. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +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 +``` + +### -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.PSDeviceTracing + +## NOTES + +## RELATED LINKS diff --git a/src/IotHub/IotHub/help/Set-AzIotHubDistributedTracing.md b/src/IotHub/IotHub/help/Set-AzIotHubDistributedTracing.md new file mode 100644 index 000000000000..09136f16a114 --- /dev/null +++ b/src/IotHub/IotHub/help/Set-AzIotHubDistributedTracing.md @@ -0,0 +1,224 @@ +--- +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-aziothubdistributedtracing +schema: 2.0.0 +--- + +# Set-AzIotHubDistributedTracing + +## SYNOPSIS +Update the distributed tracing options for a device. + +## SYNTAX + +### ResourceSet (Default) +``` +Set-AzIotHubDistributedTracing [-ResourceGroupName] [-IotHubName] [-DeviceId] + [-SamplingMode] [-SamplingRate ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### InputObjectSet +``` +Set-AzIotHubDistributedTracing [-InputObject] [-DeviceId] + [-SamplingMode] [-SamplingRate ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### ResourceIdSet +``` +Set-AzIotHubDistributedTracing [-ResourceId] [-DeviceId] + [-SamplingMode] [-SamplingRate ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Update the distributed tracing options for a device. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Set-AzIotHubDistributedTracing -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -SamplingMode Enabled -SamplingRate 22 + +DeviceId : mydevice1 +Sampling Mode : Enabled +Sampling Rate : 22% +IsSynced : False +``` + +Update the distributed tracing options for a device. + +## 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 +``` + +### -DeviceId +Target Device Id. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +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 +``` + +### -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 +``` + +### -SamplingMode +Turns sampling for distributed tracing enable and disable. + +```yaml +Type: Microsoft.Azure.Commands.Management.IotHub.Models.PSDistributedTracingSamplingMode +Parameter Sets: (All) +Aliases: Mode +Accepted values: Disabled, Enabled + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SamplingRate +Controls the amount of messages sampled for adding trace context. +This value is a percentage. +Only values from 0 to 100 (inclusive) are permitted. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: Rate + +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.PSDeviceTracing + +## NOTES + +## RELATED LINKS diff --git a/tools/SecurityTools/CredScanSuppressions.json b/tools/SecurityTools/CredScanSuppressions.json index ea50379c7977..e801d8c4be7f 100644 --- a/tools/SecurityTools/CredScanSuppressions.json +++ b/tools/SecurityTools/CredScanSuppressions.json @@ -545,6 +545,10 @@ "file": "src\\IotHub\\IotHub.Test\\SessionRecords\\Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubDPModuleTests\\TestAzureIotHubModuleLifecycle.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.IotHubDPTracingTests\\TestAzureIotHubTracing.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."