Azure / Azure/azure-iot-hub-python
Deployment configuration updates fail when using IoTHubConfigurationManager.update_configuration
- Dominant language
- Python
- Stars
- 18
- Forks
- 24
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 1
Description
# Context
- **OS and version used:** MacOS 11.6.4
- **Python version:** 3.7.5
- **pip version:** 20.2.3
- **list of installed packages:** azure-iot-hub 2.6.0
## Description of the issue
It is not possible to update a device configuration using IoTHubConfigurationManager.update_configuration. All requests result in `Operation returned an invalid status code 'Conflict'`. In the code example below, I retrieve an existing configuration, change the target_condition and then attempt to update it.
## Code sample exhibiting the issue
```
from msrest.exceptions import HttpOperationError
from azure.iot.hub import IoTHubConfigurationManager
config_service = IoTHubConfigurationManager(iothub_conn_str)
# retrieve an existing deployment
current_config = config_service.get_configuration("my_deployment")
print(current_config)
# change the target condition
current_config.target_condition = "tags.environment='test'"
try:
config_service.update_configuration(current_config, current_config.etag)
except HttpOperationError as ex:
print(ex)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.