diff --git a/src/logic/HISTORY.rst b/src/logic/HISTORY.rst index 8c1cb02df3f..34f97de3783 100644 --- a/src/logic/HISTORY.rst +++ b/src/logic/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.0.1 +++++++ +* `az logic workflow`: Fix the issue with `parameters` in `--definition` not working + 1.0.0 ++++++ * Add new command group `az logic workflow identity` to support managing identity diff --git a/src/logic/azext_logic/aaz/latest/logic/integration_account/_list.py b/src/logic/azext_logic/aaz/latest/logic/integration_account/_list.py index ab518e5a1b1..9d36ced08d0 100644 --- a/src/logic/azext_logic/aaz/latest/logic/integration_account/_list.py +++ b/src/logic/azext_logic/aaz/latest/logic/integration_account/_list.py @@ -15,7 +15,7 @@ "logic integration-account list", ) class List(AAZCommand): - """List a list of integration accounts by subscription. + """List integration accounts :example: List integration accounts by resource group name az logic integration-account list --resource-group rg diff --git a/src/logic/azext_logic/aaz/latest/logic/workflow/_create.py b/src/logic/azext_logic/aaz/latest/logic/workflow/_create.py index c13d65e0ec8..27d982adf3b 100644 --- a/src/logic/azext_logic/aaz/latest/logic/workflow/_create.py +++ b/src/logic/azext_logic/aaz/latest/logic/workflow/_create.py @@ -69,7 +69,6 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema.definition = AAZFreeFormDictArg( options=["--definition"], help="The definition.", - blank={}, ) _args_schema.endpoints_configuration = AAZObjectArg( options=["--endpoints-configuration"], @@ -83,6 +82,10 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--integration-service-environment"], help="The integration service environment.", ) + _args_schema.parameters = AAZFreeFormDictArg( + options=["--parameters"], + help="The parameters.", + ) _args_schema.state = AAZStrArg( options=["--state"], help="The state.", @@ -487,6 +490,7 @@ def content(self): properties.set_prop("endpointsConfiguration", AAZObjectType, ".endpoints_configuration") properties.set_prop("integrationAccount", AAZObjectType, ".integration_account") properties.set_prop("integrationServiceEnvironment", AAZObjectType, ".integration_service_environment") + properties.set_prop("parameters", AAZFreeFormDictType, ".parameters") properties.set_prop("state", AAZStrType, ".state") access_control = _builder.get(".properties.accessControl") @@ -695,6 +699,10 @@ def content(self): if integration_service_environment is not None: integration_service_environment.set_prop("id", AAZStrType, ".id") + parameters = _builder.get(".properties.parameters") + if parameters is not None: + parameters.set_anytype_elements(".") + tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") @@ -792,6 +800,7 @@ def _build_schema_on_200_201(cls): serialized_name="integrationServiceEnvironment", ) _CreateHelper._build_schema_resource_reference_read(properties.integration_service_environment) + properties.parameters = AAZFreeFormDictType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", ) diff --git a/src/logic/azext_logic/aaz/latest/logic/workflow/_list.py b/src/logic/azext_logic/aaz/latest/logic/workflow/_list.py index 89784885021..beded15d0ac 100644 --- a/src/logic/azext_logic/aaz/latest/logic/workflow/_list.py +++ b/src/logic/azext_logic/aaz/latest/logic/workflow/_list.py @@ -15,7 +15,7 @@ "logic workflow list", ) class List(AAZCommand): - """List a list of workflows by subscription. + """List workflows :example: List all workflows in a resource group az logic workflow list --resource-group rg @@ -248,6 +248,7 @@ def _build_schema_on_200(cls): serialized_name="integrationServiceEnvironment", ) _ListHelper._build_schema_resource_reference_read(properties.integration_service_environment) + properties.parameters = AAZFreeFormDictType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", ) @@ -448,6 +449,7 @@ def _build_schema_on_200(cls): serialized_name="integrationServiceEnvironment", ) _ListHelper._build_schema_resource_reference_read(properties.integration_service_environment) + properties.parameters = AAZFreeFormDictType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", ) diff --git a/src/logic/azext_logic/aaz/latest/logic/workflow/_show.py b/src/logic/azext_logic/aaz/latest/logic/workflow/_show.py index 40785e5515e..64b5c232d7e 100644 --- a/src/logic/azext_logic/aaz/latest/logic/workflow/_show.py +++ b/src/logic/azext_logic/aaz/latest/logic/workflow/_show.py @@ -15,7 +15,7 @@ "logic workflow show", ) class Show(AAZCommand): - """Get a workflow. + """Show a workflow. :example: Show workflow az logic workflow show --resource-group rg --name workflow @@ -226,6 +226,7 @@ def _build_schema_on_200(cls): serialized_name="integrationServiceEnvironment", ) _ShowHelper._build_schema_resource_reference_read(properties.integration_service_environment) + properties.parameters = AAZFreeFormDictType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", ) diff --git a/src/logic/azext_logic/aaz/latest/logic/workflow/_update.py b/src/logic/azext_logic/aaz/latest/logic/workflow/_update.py index 68dd43b768c..4d236f012d9 100644 --- a/src/logic/azext_logic/aaz/latest/logic/workflow/_update.py +++ b/src/logic/azext_logic/aaz/latest/logic/workflow/_update.py @@ -76,7 +76,6 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--definition"], help="The definition.", nullable=True, - blank={}, ) _args_schema.endpoints_configuration = AAZObjectArg( options=["--endpoints-configuration"], @@ -93,6 +92,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="The integration service environment.", nullable=True, ) + _args_schema.parameters = AAZFreeFormDictArg( + options=["--parameters"], + help="The parameters.", + nullable=True, + ) _args_schema.state = AAZStrArg( options=["--state"], help="The state.", @@ -711,6 +715,7 @@ def _update_instance(self, instance): properties.set_prop("endpointsConfiguration", AAZObjectType, ".endpoints_configuration") properties.set_prop("integrationAccount", AAZObjectType, ".integration_account") properties.set_prop("integrationServiceEnvironment", AAZObjectType, ".integration_service_environment") + properties.set_prop("parameters", AAZFreeFormDictType, ".parameters") properties.set_prop("state", AAZStrType, ".state") access_control = _builder.get(".properties.accessControl") @@ -919,6 +924,10 @@ def _update_instance(self, instance): if integration_service_environment is not None: integration_service_environment.set_prop("id", AAZStrType, ".id") + parameters = _builder.get(".properties.parameters") + if parameters is not None: + parameters.set_anytype_elements(".") + tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") @@ -1144,6 +1153,7 @@ def _build_schema_workflow_read(cls, _schema): serialized_name="integrationServiceEnvironment", ) cls._build_schema_resource_reference_read(properties.integration_service_environment) + properties.parameters = AAZFreeFormDictType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", ) diff --git a/src/logic/azext_logic/aaz/latest/logic/workflow/identity/_assign.py b/src/logic/azext_logic/aaz/latest/logic/workflow/identity/_assign.py index 967c7b3d316..f842f28381c 100644 --- a/src/logic/azext_logic/aaz/latest/logic/workflow/identity/_assign.py +++ b/src/logic/azext_logic/aaz/latest/logic/workflow/identity/_assign.py @@ -521,6 +521,7 @@ def _build_schema_workflow_read(cls, _schema): serialized_name="integrationServiceEnvironment", ) cls._build_schema_resource_reference_read(properties.integration_service_environment) + properties.parameters = AAZFreeFormDictType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", ) diff --git a/src/logic/azext_logic/aaz/latest/logic/workflow/identity/_remove.py b/src/logic/azext_logic/aaz/latest/logic/workflow/identity/_remove.py index 1e5366dcc56..1e6949e77fe 100644 --- a/src/logic/azext_logic/aaz/latest/logic/workflow/identity/_remove.py +++ b/src/logic/azext_logic/aaz/latest/logic/workflow/identity/_remove.py @@ -523,6 +523,7 @@ def _build_schema_workflow_read(cls, _schema): serialized_name="integrationServiceEnvironment", ) cls._build_schema_resource_reference_read(properties.integration_service_environment) + properties.parameters = AAZFreeFormDictType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", ) diff --git a/src/logic/azext_logic/custom.py b/src/logic/azext_logic/custom.py index 5cd0ada6dd9..3c78fe2aadc 100644 --- a/src/logic/azext_logic/custom.py +++ b/src/logic/azext_logic/custom.py @@ -134,6 +134,7 @@ def _build_arguments_schema(cls, *args, **kwargs): "/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{}") ) args_schema.identity._registered = False + args_schema.parameters._registered = False return args_schema def pre_operations(self): @@ -142,6 +143,7 @@ def pre_operations(self): raise RequiredArgumentMissingError("--definition does not contain a 'definition' key") definition = args.definition.to_serialized_data() args.access_control = definition.get('accessControl', args.access_control) + args.parameters = definition.get('parameters', None) args.definition = definition['definition'] if args.mi_system_assigned: args.identity.type = "SystemAssigned" @@ -165,6 +167,7 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.integration_service_environment._registered = False args_schema.integration_account._registered = False args_schema.access_control._registered = False + args_schema.parameters._registered = False return args_schema def pre_operations(self): @@ -175,6 +178,7 @@ def pre_operations(self): definition = args.definition.to_serialized_data() args.definition = definition['definition'] args.access_control = definition.get('accessControl', args.access_control) + args.parameters = definition.get('parameters', None) def pre_instance_update(self, instance): self.ctx.args.location = instance.location diff --git a/src/logic/azext_logic/tests/latest/recordings/test_workflow_parameters.yaml b/src/logic/azext_logic/tests/latest/recordings/test_workflow_parameters.yaml new file mode 100644 index 00000000000..b69a9c74dd5 --- /dev/null +++ b/src/logic/azext_logic/tests/latest/recordings/test_workflow_parameters.yaml @@ -0,0 +1,273 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --definition --name + User-Agent: + - AZURECLI/2.55.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001","name":"cli_test_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_workflow_parameters","date":"2023-12-14T07:50:32Z","module":"logic"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '359' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 14 Dec 2023 07:50:36 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"definition": {"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": {"Get_blob_content_(V2)": {"inputs": {"host": {"connection": {"name": + "@parameters(''$connections'')[''azureblob_2''][''connectionId'']"}}, "method": + "get", "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent(''AccountNameFromSettings''))}/files/@{encodeURIComponent(encodeURIComponent(''JTJmdGVzdCUyZmFhYS50eHQ=''))}/content", + "queries": {"inferContentType": true}}, "metadata": {"JTJmdGVzdCUyZmFhYS50eHQ=": + "/test/aaa.txt"}, "runAfter": {}, "type": "ApiConnection"}}, "contentVersion": + "1.0.0.0", "outputs": {}, "parameters": {"$connections": {"defaultValue": {}, + "type": "Object"}}, "triggers": {"Recurrence": {"evaluatedRecurrence": {"frequency": + "Month", "interval": 3}, "recurrence": {"frequency": "Month", "interval": 3}, + "type": "Recurrence"}}}, "parameters": {"$connections": {"value": {}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow create + Connection: + - keep-alive + Content-Length: + - '985' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --definition --name + User-Agent: + - AZURECLI/2.55.0 (AAZ) azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000002?api-version=2019-05-01 + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2023-12-14T07:50:37.9420031Z","changedTime":"2023-12-14T07:50:37.9381795Z","state":"Enabled","version":"08584990666475558275","accessEndpoint":"https://prod-157.westus.logic.azure.com:443/workflows/f8123ea7cfb14993acba49cdbc7a6524","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"Recurrence":{"recurrence":{"frequency":"Month","interval":3},"evaluatedRecurrence":{"frequency":"Month","interval":3},"type":"Recurrence"}},"actions":{"Get_blob_content_(V2)":{"runAfter":{},"metadata":{"JTJmdGVzdCUyZmFhYS50eHQ=":"/test/aaa.txt"},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''azureblob_2''][''connectionId'']"}},"method":"get","path":"/v2/datasets/@{encodeURIComponent(encodeURIComponent(''AccountNameFromSettings''))}/files/@{encodeURIComponent(encodeURIComponent(''JTJmdGVzdCUyZmFhYS50eHQ=''))}/content","queries":{"inferContentType":true}}}},"outputs":{}},"parameters":{"$connections":{"value":{}}},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"52.160.92.112"},{"address":"40.118.244.241"},{"address":"40.118.241.243"},{"address":"157.56.162.53"},{"address":"157.56.167.147"},{"address":"104.42.49.145"},{"address":"40.83.164.80"},{"address":"104.42.38.32"},{"address":"13.86.223.0"},{"address":"13.86.223.1"},{"address":"13.86.223.2"},{"address":"13.86.223.3"},{"address":"13.86.223.4"},{"address":"13.86.223.5"},{"address":"104.40.34.169"},{"address":"104.40.32.148"},{"address":"52.160.70.221"},{"address":"52.160.70.105"},{"address":"13.91.81.221"},{"address":"13.64.231.196"},{"address":"13.87.204.182"},{"address":"40.78.65.193"},{"address":"13.87.207.39"},{"address":"104.42.44.28"},{"address":"40.83.134.97"},{"address":"40.78.65.112"},{"address":"168.62.9.74"},{"address":"168.62.28.191"}],"accessEndpointIpAddresses":[{"address":"52.160.90.237"},{"address":"138.91.188.137"},{"address":"13.91.252.184"},{"address":"157.56.160.212"},{"address":"104.40.34.112"},{"address":"52.160.68.27"},{"address":"13.88.168.158"},{"address":"104.42.40.164"},{"address":"13.87.207.79"},{"address":"13.87.204.210"},{"address":"168.62.9.100"}]},"connector":{"outgoingIpAddresses":[{"address":"13.93.148.62"},{"address":"104.42.122.49"},{"address":"40.112.195.87"},{"address":"13.86.223.32/27"},{"address":"40.112.243.160/28"},{"address":"20.59.77.0/27"},{"address":"20.66.6.112/28"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000002","name":"cli_test_000002","type":"Microsoft.Logic/workflows","location":"westus"}' + headers: + cache-control: + - no-cache + content-length: + - '2818' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 14 Dec 2023 07:50:37 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bd8696554b8b9641052025659e1a9ef9f5c582b5bb5a1e21f02a3b362099a7e7;Path=/;HttpOnly;Secure;Domain=management.westus.logic.azure.com + - ARRAffinitySameSite=bd8696554b8b9641052025659e1a9ef9f5c582b5bb5a1e21f02a3b362099a7e7;Path=/;HttpOnly;SameSite=None;Secure;Domain=management.westus.logic.azure.com + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow update + Connection: + - keep-alive + ParameterSetName: + - --resource-group --definition --name + User-Agent: + - AZURECLI/2.55.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001","name":"cli_test_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","test":"test_workflow_parameters","date":"2023-12-14T07:50:32Z","module":"logic"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '359' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 14 Dec 2023 07:50:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow update + Connection: + - keep-alive + ParameterSetName: + - --resource-group --definition --name + User-Agent: + - AZURECLI/2.55.0 (AAZ) azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000002?api-version=2019-05-01 + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2023-12-14T07:50:37.9420031Z","changedTime":"2023-12-14T07:50:37.9381795Z","state":"Enabled","version":"08584990666475558275","accessEndpoint":"https://prod-157.westus.logic.azure.com:443/workflows/f8123ea7cfb14993acba49cdbc7a6524","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"Recurrence":{"recurrence":{"frequency":"Month","interval":3},"evaluatedRecurrence":{"frequency":"Month","interval":3},"type":"Recurrence"}},"actions":{"Get_blob_content_(V2)":{"runAfter":{},"metadata":{"JTJmdGVzdCUyZmFhYS50eHQ=":"/test/aaa.txt"},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''azureblob_2''][''connectionId'']"}},"method":"get","path":"/v2/datasets/@{encodeURIComponent(encodeURIComponent(''AccountNameFromSettings''))}/files/@{encodeURIComponent(encodeURIComponent(''JTJmdGVzdCUyZmFhYS50eHQ=''))}/content","queries":{"inferContentType":true}}}},"outputs":{}},"parameters":{"$connections":{"value":{}}},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"52.160.92.112"},{"address":"40.118.244.241"},{"address":"40.118.241.243"},{"address":"157.56.162.53"},{"address":"157.56.167.147"},{"address":"104.42.49.145"},{"address":"40.83.164.80"},{"address":"104.42.38.32"},{"address":"13.86.223.0"},{"address":"13.86.223.1"},{"address":"13.86.223.2"},{"address":"13.86.223.3"},{"address":"13.86.223.4"},{"address":"13.86.223.5"},{"address":"104.40.34.169"},{"address":"104.40.32.148"},{"address":"52.160.70.221"},{"address":"52.160.70.105"},{"address":"13.91.81.221"},{"address":"13.64.231.196"},{"address":"13.87.204.182"},{"address":"40.78.65.193"},{"address":"13.87.207.39"},{"address":"104.42.44.28"},{"address":"40.83.134.97"},{"address":"40.78.65.112"},{"address":"168.62.9.74"},{"address":"168.62.28.191"}],"accessEndpointIpAddresses":[{"address":"52.160.90.237"},{"address":"138.91.188.137"},{"address":"13.91.252.184"},{"address":"157.56.160.212"},{"address":"104.40.34.112"},{"address":"52.160.68.27"},{"address":"13.88.168.158"},{"address":"104.42.40.164"},{"address":"13.87.207.79"},{"address":"13.87.204.210"},{"address":"168.62.9.100"}]},"connector":{"outgoingIpAddresses":[{"address":"13.93.148.62"},{"address":"104.42.122.49"},{"address":"40.112.195.87"},{"address":"13.86.223.32/27"},{"address":"40.112.243.160/28"},{"address":"20.59.77.0/27"},{"address":"20.66.6.112/28"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000002","name":"cli_test_000002","type":"Microsoft.Logic/workflows","location":"westus"}' + headers: + cache-control: + - no-cache + content-length: + - '2818' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 14 Dec 2023 07:50:39 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=417d241e95568378202af11f383a7ca6d1ae040fce5b56060d9d7065e5e1e33b;Path=/;HttpOnly;Secure;Domain=management.westus.logic.azure.com + - ARRAffinitySameSite=417d241e95568378202af11f383a7ca6d1ae040fce5b56060d9d7065e5e1e33b;Path=/;HttpOnly;SameSite=None;Secure;Domain=management.westus.logic.azure.com + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '19999' + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"definition": {"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": {"Get_blob_content_(V2)": {"inputs": {"host": {"connection": {"name": + "@parameters(''$connections'')[''azureblob_2''][''connectionId'']"}}, "method": + "get", "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent(''AccountNameFromSettings''))}/files/@{encodeURIComponent(encodeURIComponent(''JTJmdGVzdCUyZmFhYS50eHQ=''))}/content", + "queries": {"inferContentType": true}}, "metadata": {"JTJmdGVzdCUyZmFhYS50eHQ=": + "/test/aaa.txt"}, "runAfter": {}, "type": "ApiConnection"}}, "contentVersion": + "1.0.0.0", "outputs": {}, "parameters": {"$connections": {"defaultValue": {}, + "type": "Object"}}, "triggers": {"Recurrence": {"evaluatedRecurrence": {"frequency": + "Month", "interval": 4}, "recurrence": {"frequency": "Month", "interval": 4}, + "type": "Recurrence"}}}, "endpointsConfiguration": {"connector": {"outgoingIpAddresses": + [{"address": "13.93.148.62"}, {"address": "104.42.122.49"}, {"address": "40.112.195.87"}, + {"address": "13.86.223.32/27"}, {"address": "40.112.243.160/28"}, {"address": + "20.59.77.0/27"}, {"address": "20.66.6.112/28"}]}, "workflow": {"accessEndpointIpAddresses": + [{"address": "52.160.90.237"}, {"address": "138.91.188.137"}, {"address": "13.91.252.184"}, + {"address": "157.56.160.212"}, {"address": "104.40.34.112"}, {"address": "52.160.68.27"}, + {"address": "13.88.168.158"}, {"address": "104.42.40.164"}, {"address": "13.87.207.79"}, + {"address": "13.87.204.210"}, {"address": "168.62.9.100"}], "outgoingIpAddresses": + [{"address": "52.160.92.112"}, {"address": "40.118.244.241"}, {"address": "40.118.241.243"}, + {"address": "157.56.162.53"}, {"address": "157.56.167.147"}, {"address": "104.42.49.145"}, + {"address": "40.83.164.80"}, {"address": "104.42.38.32"}, {"address": "13.86.223.0"}, + {"address": "13.86.223.1"}, {"address": "13.86.223.2"}, {"address": "13.86.223.3"}, + {"address": "13.86.223.4"}, {"address": "13.86.223.5"}, {"address": "104.40.34.169"}, + {"address": "104.40.32.148"}, {"address": "52.160.70.221"}, {"address": "52.160.70.105"}, + {"address": "13.91.81.221"}, {"address": "13.64.231.196"}, {"address": "13.87.204.182"}, + {"address": "40.78.65.193"}, {"address": "13.87.207.39"}, {"address": "104.42.44.28"}, + {"address": "40.83.134.97"}, {"address": "40.78.65.112"}, {"address": "168.62.9.74"}, + {"address": "168.62.28.191"}]}}, "parameters": {"$connections": {"value": {}}}, + "provisioningState": "Succeeded", "state": "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow update + Connection: + - keep-alive + Content-Length: + - '2543' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --definition --name + User-Agent: + - AZURECLI/2.55.0 (AAZ) azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000002?api-version=2019-05-01 + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2023-12-14T07:50:40.351573Z","changedTime":"2023-12-14T07:50:40.3330634Z","state":"Enabled","version":"08584990666452980025","accessEndpoint":"https://prod-157.westus.logic.azure.com:443/workflows/f8123ea7cfb14993acba49cdbc7a6524","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"Recurrence":{"recurrence":{"frequency":"Month","interval":4},"evaluatedRecurrence":{"frequency":"Month","interval":4},"type":"Recurrence"}},"actions":{"Get_blob_content_(V2)":{"runAfter":{},"metadata":{"JTJmdGVzdCUyZmFhYS50eHQ=":"/test/aaa.txt"},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''azureblob_2''][''connectionId'']"}},"method":"get","path":"/v2/datasets/@{encodeURIComponent(encodeURIComponent(''AccountNameFromSettings''))}/files/@{encodeURIComponent(encodeURIComponent(''JTJmdGVzdCUyZmFhYS50eHQ=''))}/content","queries":{"inferContentType":true}}}},"outputs":{}},"parameters":{"$connections":{"value":{}}},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"52.160.92.112"},{"address":"40.118.244.241"},{"address":"40.118.241.243"},{"address":"157.56.162.53"},{"address":"157.56.167.147"},{"address":"104.42.49.145"},{"address":"40.83.164.80"},{"address":"104.42.38.32"},{"address":"13.86.223.0"},{"address":"13.86.223.1"},{"address":"13.86.223.2"},{"address":"13.86.223.3"},{"address":"13.86.223.4"},{"address":"13.86.223.5"},{"address":"104.40.34.169"},{"address":"104.40.32.148"},{"address":"52.160.70.221"},{"address":"52.160.70.105"},{"address":"13.91.81.221"},{"address":"13.64.231.196"},{"address":"13.87.204.182"},{"address":"40.78.65.193"},{"address":"13.87.207.39"},{"address":"104.42.44.28"},{"address":"40.83.134.97"},{"address":"40.78.65.112"},{"address":"168.62.9.74"},{"address":"168.62.28.191"}],"accessEndpointIpAddresses":[{"address":"52.160.90.237"},{"address":"138.91.188.137"},{"address":"13.91.252.184"},{"address":"157.56.160.212"},{"address":"104.40.34.112"},{"address":"52.160.68.27"},{"address":"13.88.168.158"},{"address":"104.42.40.164"},{"address":"13.87.207.79"},{"address":"13.87.204.210"},{"address":"168.62.9.100"}]},"connector":{"outgoingIpAddresses":[{"address":"13.93.148.62"},{"address":"104.42.122.49"},{"address":"40.112.195.87"},{"address":"13.86.223.32/27"},{"address":"40.112.243.160/28"},{"address":"20.59.77.0/27"},{"address":"20.66.6.112/28"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000002","name":"cli_test_000002","type":"Microsoft.Logic/workflows","location":"westus"}' + headers: + cache-control: + - no-cache + content-length: + - '2817' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 14 Dec 2023 07:50:40 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=acb0c62d255c09b592f5adc76ba687822b8f0eda0601a91112662784a9aff785;Path=/;HttpOnly;Secure;Domain=management.westus.logic.azure.com + - ARRAffinitySameSite=acb0c62d255c09b592f5adc76ba687822b8f0eda0601a91112662784a9aff785;Path=/;HttpOnly;SameSite=None;Secure;Domain=management.westus.logic.azure.com + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +version: 1 diff --git a/src/logic/azext_logic/tests/latest/test_logic_scenario.py b/src/logic/azext_logic/tests/latest/test_logic_scenario.py index 43ec1137839..3259ba72283 100644 --- a/src/logic/azext_logic/tests/latest/test_logic_scenario.py +++ b/src/logic/azext_logic/tests/latest/test_logic_scenario.py @@ -115,6 +115,23 @@ def test_logic(self, resource_group): '-y', checks=[]) + @ResourceGroupPreparer(name_prefix='cli_test_logic_test-resource-group'[:9], key='rg') + def test_workflow_parameters(self, resource_group): + curr_dir = os.path.dirname(os.path.realpath(__file__)) + self.kwargs.update({ + 'testWorkflow': self.create_random_name(prefix='cli_test_workflows'[:9], length=24), + 'definition_path': os.path.join(curr_dir, 'workflow_connection.json'), + 'definition_path_2': os.path.join(curr_dir, 'workflow_connection_update.json'), + }) + self.cmd('az logic workflow create --resource-group "{rg}" --definition "{definition_path}" --name "{testWorkflow}"', checks=[ + self.check('definition.triggers.Recurrence.evaluatedRecurrence.interval', 3), + self.exists('parameters') + ]) + self.cmd('az logic workflow update --resource-group "{rg}" --definition "{definition_path_2}" --name "{testWorkflow}"', checks=[ + self.check('definition.triggers.Recurrence.evaluatedRecurrence.interval', 4), + self.exists('parameters') + ]) + @ResourceGroupPreparer() def test_integration_account_map(self): curr_dir = os.path.dirname(os.path.realpath(__file__)) diff --git a/src/logic/azext_logic/tests/latest/workflow_connection.json b/src/logic/azext_logic/tests/latest/workflow_connection.json new file mode 100644 index 00000000000..8433b3f01ab --- /dev/null +++ b/src/logic/azext_logic/tests/latest/workflow_connection.json @@ -0,0 +1,53 @@ +{ + "definition": { + "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": { + "Get_blob_content_(V2)": { + "inputs": { + "host": { + "connection": { + "name": "@parameters('$connections')['azureblob_2']['connectionId']" + } + }, + "method": "get", + "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/files/@{encodeURIComponent(encodeURIComponent('JTJmdGVzdCUyZmFhYS50eHQ='))}/content", + "queries": { + "inferContentType": true + } + }, + "metadata": { + "JTJmdGVzdCUyZmFhYS50eHQ=": "/test/aaa.txt" + }, + "runAfter": {}, + "type": "ApiConnection" + } + }, + "contentVersion": "1.0.0.0", + "outputs": {}, + "parameters": { + "$connections": { + "defaultValue": {}, + "type": "Object" + } + }, + "triggers": { + "Recurrence": { + "evaluatedRecurrence": { + "frequency": "Month", + "interval": 3 + }, + "recurrence": { + "frequency": "Month", + "interval": 3 + }, + "type": "Recurrence" + } + } + }, + "parameters": { + "$connections": { + "value": { + } + } + } +} \ No newline at end of file diff --git a/src/logic/azext_logic/tests/latest/workflow_connection_update.json b/src/logic/azext_logic/tests/latest/workflow_connection_update.json new file mode 100644 index 00000000000..00f28fbc9b6 --- /dev/null +++ b/src/logic/azext_logic/tests/latest/workflow_connection_update.json @@ -0,0 +1,53 @@ +{ + "definition": { + "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": { + "Get_blob_content_(V2)": { + "inputs": { + "host": { + "connection": { + "name": "@parameters('$connections')['azureblob_2']['connectionId']" + } + }, + "method": "get", + "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/files/@{encodeURIComponent(encodeURIComponent('JTJmdGVzdCUyZmFhYS50eHQ='))}/content", + "queries": { + "inferContentType": true + } + }, + "metadata": { + "JTJmdGVzdCUyZmFhYS50eHQ=": "/test/aaa.txt" + }, + "runAfter": {}, + "type": "ApiConnection" + } + }, + "contentVersion": "1.0.0.0", + "outputs": {}, + "parameters": { + "$connections": { + "defaultValue": {}, + "type": "Object" + } + }, + "triggers": { + "Recurrence": { + "evaluatedRecurrence": { + "frequency": "Month", + "interval": 4 + }, + "recurrence": { + "frequency": "Month", + "interval": 4 + }, + "type": "Recurrence" + } + } + }, + "parameters": { + "$connections": { + "value": { + } + } + } +} \ No newline at end of file diff --git a/src/logic/setup.py b/src/logic/setup.py index 250203aca3d..bd29f4c2cdf 100644 --- a/src/logic/setup.py +++ b/src/logic/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '1.0.0' +VERSION = '1.0.1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers