Howard Hoffman
Howard Hoffman

Reputation: 917

Proper values for PSOperationsMonitoringPropertie when using Set/New-AzureRmIotHub

We are attempting to create an Azure IOT Hub via PowerShell. The Microsoft.Azure.Commands.Management.IotHub.Models.PSOperationsMonitoringProperties parameter, (-OperationsMonitoringProperties) is a datatype that contains a single member, of type Dictionary<string,string>.

I believe it's key/value pairs, where the key is from the set of category values shown in the examples at https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-operations-monitoring.

I do not know what to supply for the 'value' portion, however. I believe the possible values are some spelling of the words {None, Verbose, Error}. Can anyone say what the possible values are? Passing the value "Error" had success, but not with other words. For example "Verbose" returns a 400 / BadRequest from the Set-AzureRmIotHub Powershell Command.

Upvotes: 0

Views: 57

Answers (1)

Dominic Betts
Dominic Betts

Reputation: 2331

The values are "None", "Information", and "Error". Example below:

$hub = Get-AzureRmIotHub
$op = $hub.Properties.OperationsMonitoringProperties
$op.OperationMonitoringEvents["DeviceIdentityOperations"] = "None" # None|Information|Error
$hubupdated = Set-AzureRmIotHub `
  -ResourceGroupName getStartedWithIoTHub_rg `
  -Name getStartedWithAnIoTHub `
  -OperationsMonitoringProperties $op
$hubupdated.Properties.OperationsMonitoringProperties

Upvotes: 2

Related Questions