-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
Hi I would like to add IP filter rules to IotHub, which has its Public network access configured to All networks using az cli.
See the image below.

I need az cli command to change from All networks to Selected IP ranges
When I follow the documentation to add new IP filter, I always get an error message saying
(400059) Request body validation failed. If you contact a support representative please include this correlation identifier: 7c8311d2-683e-43d1-8de1-3e19c72251a5, timestamp: 2025-06-10 11:14:04Z, errorcode: IH400059
Related command
az resource update -n $iotHubName -g $resourceGroup --resource-type Microsoft.Devices/IotHubs --add properties.networkRuleSets.ipRules "{"action":"Allow","filterName":"filterName","ipMask":"10.39.6.128/25"}"
Errors
(400059) Request body validation failed. If you contact a support representative please include this correlation identifier: 7c8311d2-683e-43d1-8de1-3e19c72251a5, timestamp: 2025-06-10 11:14:04Z, errorcode: IH400059.
-43d1-8de1-3e19c72251a5, timestamp: 2025-06-10 11:14:04Z, errorcode: IH400059.
Code: 400059
Message: Request body validation failed. If you contact a support representative please include this correla-43d1-8de1-3e19c72251a5, timestamp: 2025-06-10 11:14:04Z, errorcode: IH400059.
Issue script & Debug output
Expected behavior
I would expect the az resource update adds IP ranges to the Iot Hub network access
Environment Summary
azure-cli 2.72.0 *
core 2.72.0 *
telemetry 1.1.0
Extensions:
azure-iot 0.26.0
gallery-service-artifact 1.0.0b1
Dependencies:
msal 1.32.3
azure-mgmt-resource 23.1.1
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\E1252566.azure'
Extensions directory 'C:\Users\E1252566.azure\cliextensions'
Python (Windows) 3.12.8 (tags/v3.12.8:2dc476b, Dec 3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Additional context
No response