From 533c1000575694236ea103467d85bcac7d54f527 Mon Sep 17 00:00:00 2001 From: Ryan K Date: Wed, 13 Nov 2024 13:22:03 -0800 Subject: [PATCH 1/3] fix: dependency and pipeline fixes (#724) * merge pipeline fixes * pin down azure-identity < 1.18.0 --- .azure-devops/templates/evaluate-command-table.yml | 3 +++ azext_iot/tests/iothub/devices/test_iothub_device_tracing.py | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.azure-devops/templates/evaluate-command-table.yml b/.azure-devops/templates/evaluate-command-table.yml index eec3ee92b..956150b27 100644 --- a/.azure-devops/templates/evaluate-command-table.yml +++ b/.azure-devops/templates/evaluate-command-table.yml @@ -20,6 +20,7 @@ steps: source ./venv/bin/activate git clone --single-branch -b dev https://github.com/Azure/azure-cli.git ../azure-cli pip install azdev + pip install wheel==0.30.0 setuptools==70.0.0 azdev --version azdev setup -c ../azure-cli -r ./ AZURE_EXTENSION_DIR=~/.azure/cliextensions @@ -30,4 +31,6 @@ steps: az extension add --source $i -y --debug done cp ./linter_exclusions.yml $AZURE_EXTENSION_DIR/azure-iot/ + # temp fix for newest azdev v0.1.65 + cp .pylintrc pylintrc azdev linter --include-whl-extensions azure-iot --min-severity medium diff --git a/azext_iot/tests/iothub/devices/test_iothub_device_tracing.py b/azext_iot/tests/iothub/devices/test_iothub_device_tracing.py index 46e9f3aa2..5311adbb6 100644 --- a/azext_iot/tests/iothub/devices/test_iothub_device_tracing.py +++ b/azext_iot/tests/iothub/devices/test_iothub_device_tracing.py @@ -51,7 +51,7 @@ def test_iothub_device_distributed_tracing(self): result = self.cmd( self.set_cmd_auth_type( f"iot hub distributed-tracing update " - f"-d {device_ids[0]} -n {self.host_name} -g { self.entity_rg} --sm on --sr 50", + f"-d {device_ids[0]} -n {self.host_name} -g {self.entity_rg} --sm on --sr 50", auth_type=auth_phase, ) ).get_output_in_json() diff --git a/setup.py b/setup.py index a27502a37..308278e87 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ DEPENDENCIES = [ "azure-core>=1.24.0,<2.0.0", "azure-mgmt-core>=1.3.0,<2.0.0", - "azure-identity>=1.6.1,<2.0.0", + "azure-identity>=1.6.1,<1.18.0", "azure-storage-blob>=12.14.0,<13.0.0", "msrest>=0.6.21", "msrestazure>=0.6.3,<2.0.0", From 9a3eee65dc66a9a4692b1e6c56c69a933b062103 Mon Sep 17 00:00:00 2001 From: Johnson Yang Date: Wed, 13 Nov 2024 13:58:06 -0800 Subject: [PATCH 2/3] Fix diagnositics validate message failures (#722) --- azext_iot/central/models/v2022_06_30_preview/template.py | 1 + 1 file changed, 1 insertion(+) diff --git a/azext_iot/central/models/v2022_06_30_preview/template.py b/azext_iot/central/models/v2022_06_30_preview/template.py index 5e2c5c97d..cd4a25d22 100644 --- a/azext_iot/central/models/v2022_06_30_preview/template.py +++ b/azext_iot/central/models/v2022_06_30_preview/template.py @@ -91,6 +91,7 @@ def _extract_modules(self, template: dict) -> dict: interfaces = self._extract_interfaces(template) schema_names = self._extract_schema_names(interfaces) components = self._extract_components(template) + component_schema_names = [] if components: component_schema_names = self._extract_schema_names(components) From 6e16c6706e4ba54fb08250cb74e4ea2342d52cf7 Mon Sep 17 00:00:00 2001 From: Victoria Litvinova <73560279+vilit1@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:45:03 -0800 Subject: [PATCH 3/3] test: update the IoT Hub Cosmos Db custom endpoint tests to use the actual partition key (#726) --- azext_iot/tests/iothub/conftest.py | 1 + .../iothub/message_endpoint/test_iothub_message_endpoint_int.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/azext_iot/tests/iothub/conftest.py b/azext_iot/tests/iothub/conftest.py index 81c719cbc..c5ffb0910 100644 --- a/azext_iot/tests/iothub/conftest.py +++ b/azext_iot/tests/iothub/conftest.py @@ -707,6 +707,7 @@ def _cosmos_db_provisioner(): "cosmosdb": cosmos_obj, "database": database_obj, "container": container_obj, + "partitionKey": partition_key_path, "connectionString": _cosmos_db_get_cstring(account_name) } diff --git a/azext_iot/tests/iothub/message_endpoint/test_iothub_message_endpoint_int.py b/azext_iot/tests/iothub/message_endpoint/test_iothub_message_endpoint_int.py index c1e12b3e3..94de3486b 100644 --- a/azext_iot/tests/iothub/message_endpoint/test_iothub_message_endpoint_int.py +++ b/azext_iot/tests/iothub/message_endpoint/test_iothub_message_endpoint_int.py @@ -918,7 +918,7 @@ def test_iot_cosmos_endpoint_lifecycle(provisioned_cosmosdb_with_identity_module endpoint_names = generate_ep_names(3) partition_template = "{iothub}-{device_id}-{DD}-{MM}-{YYYY}" partition_template_default = "{deviceid}-{YYYY}-{MM}" - partition_path = "example" + partition_path = cosmosdb_obj["partitionKey"] # use connection string - no pkn or pkt cli.invoke( "iot hub message-endpoint create cosmosdb-container -n {} -g {} --en {} --erg {} -c {} --container {} "