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)