Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
379 stars 1.19k forks source link

Azure Data Factory Extension - Trigger Creation - not reading JSON file #3034

Open sschwein opened 3 years ago

sschwein commented 3 years ago

Extension: Datafactory

Description of issue (in as much detail as possible)

When I am trying to run the cli tool to create a trigger, the properties flag does not read the json file and instead passes a default string to the API.

az-cli command

az datafactory trigger create --factory-name REDACTED_FACTORY_NAME --resource-group REDACTED_RESOURCE_GROUP_NAME --properties @datafactory/triggers/sample-trigger-file.json --name REDACTED_TRIGGER_NAME --debug --verbose

Debug log for request

azure.core.pipeline.policies._universal: Request URL: 'https://management.azure.com/subscriptions/{redacted}/resourceGroups/{redacted}/providers/Microsoft.DataFactory/factories/{redacted}/triggers/{redacted}?api-version=2018-06-01'
azure.core.pipeline.policies._universal: Request method: 'PUT'
azure.core.pipeline.policies._universal: Request headers:
azure.core.pipeline.policies._universal:     'Content-Type': 'application/json'
azure.core.pipeline.policies._universal:     'Accept': 'application/json'
azure.core.pipeline.policies._universal:     'Content-Length': '35'
azure.core.pipeline.policies._universal:     'x-ms-client-request-id': '{redacted}'
azure.core.pipeline.policies._universal:     'CommandName': 'datafactory trigger create'
azure.core.pipeline.policies._universal:     'ParameterSetName': '--factory-name --resource-group --properties --name --debug --verbose'
azure.core.pipeline.policies._universal:     'User-Agent': 'AZURECLI/2.19.1 (RPM) azsdk-python-datafactorymanagementclient/unknown Python/3.6.8 ({redacted})'
azure.core.pipeline.policies._universal:     'Authorization': '*****'
azure.core.pipeline.policies._universal: Request body:
azure.core.pipeline.policies._universal: {"properties": {"type": "Trigger"}}

Here, the request body is set to

{"properties": {"type": "Trigger"}}

instead of the contents of the json file.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @shawnxzq, @lmy269.

Issue Details
### Extension: Datafactory ### Description of issue (in as much detail as possible) When I am trying to run the cli tool to create a trigger, the properties flag does not read the json file and instead passes a default string to the API. az-cli command ``` az datafactory trigger create --factory-name REDACTED_FACTORY_NAME --resource-group REDACTED_RESOURCE_GROUP_NAME --properties @datafactory/triggers/sample-trigger-file.json --name REDACTED_TRIGGER_NAME --debug --verbose ``` Debug log for request ``` azure.core.pipeline.policies._universal: Request URL: 'https://management.azure.com/subscriptions/{redacted}/resourceGroups/{redacted}/providers/Microsoft.DataFactory/factories/{redacted}/triggers/{redacted}?api-version=2018-06-01' azure.core.pipeline.policies._universal: Request method: 'PUT' azure.core.pipeline.policies._universal: Request headers: azure.core.pipeline.policies._universal: 'Content-Type': 'application/json' azure.core.pipeline.policies._universal: 'Accept': 'application/json' azure.core.pipeline.policies._universal: 'Content-Length': '35' azure.core.pipeline.policies._universal: 'x-ms-client-request-id': '{redacted}' azure.core.pipeline.policies._universal: 'CommandName': 'datafactory trigger create' azure.core.pipeline.policies._universal: 'ParameterSetName': '--factory-name --resource-group --properties --name --debug --verbose' azure.core.pipeline.policies._universal: 'User-Agent': 'AZURECLI/2.19.1 (RPM) azsdk-python-datafactorymanagementclient/unknown Python/3.6.8 ({redacted})' azure.core.pipeline.policies._universal: 'Authorization': '*****' azure.core.pipeline.policies._universal: Request body: azure.core.pipeline.policies._universal: {"properties": {"type": "Trigger"}} ``` Here, the request body is set to ``` {"properties": {"type": "Trigger"}} ``` instead of the contents of the json file.
Author: sschwein
Assignees: -
Labels: `Data Factory`, `Service Attention`
Milestone: -
yonzhan commented 3 years ago

datafactory