-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure CLI Enrollment Group Update unlinks all IoT Hubs #29002
Comments
Hi @cboschert1, 2.52.0 is not the latest Azure CLI(2.61.0). If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli. |
Thank you for opening this issue, we will look into it. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-iot-cli-triage. |
Verified this happens with the latest azure CLI (2.61.0) as well. |
Hi, I managed to reproduce your issue and have looked into the code and documentation as to why this occurs. The initial goal was to have the customer re-enter the IoT Hubs they want to connect if they change the allocation policy. This is extremely important for allocation policies such as static, in which exactly one IoT Hub is allowed. However, I can see this being a pain point, especially if there are multiple IoT Hubs present and the allocation policy is minimally changed (such as updating the webhook url). Thus, I will modify the enrollment update code so that the current IoT Hub list is kept unless a new one is specified via the command. |
Thank you for the quick response, I appreciate it and will follow this issue for updates. In the meantime I did this as a workaround if someone else happens across this. There's probably a better way, but this works for now:
|
Closing issue since the code has been merged in and released |
Describe the bug
When I update the allocation policy using the update enrollment-group command, it unlinks all IoT Hubs from the enrollment group.
Related command
az iot dps enrollment-group update -n -g <resource_group> --enrollment-id --allocation-policy custom --webhook-url --api-version 2021-10-01
Errors
Command succeeds and updates the allocation policy.
Issue script & Debug output
Please message if needed, don't want to have to go through the output and block sensitive info.
Expected behavior
I expect all other settings to stay the same on the enrollment group, and all of the selected linked hubs to remain unchanged.


Before the command:
After the command:
Environment Summary
{
"azure-cli": "2.52.0",
"azure-cli-core": "2.52.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"azure-devops": "0.26.0",
"azure-iot": "0.23.1"
}
}
Additional context
Am I misunderstanding the update command. I expect an update command to only update the parameters I pass in, leaving everything else unchanged.
The text was updated successfully, but these errors were encountered: