简体   繁体   English

如何从 postman 触发具有多个参数的 Azure 数据工厂管道

[英]How to trigger a Azure data factory pipeline with multiple parameter from postman

I have created a Azure Data Factory pipeline which have multiple pipeline parameter,which I need to enter all the time when pipeline trigger.Now I want to trigger this pipeline from postman in my local system and i need to pass parameters to pipeline from post.我已经创建了一个 Azure 数据工厂管道,它有多个管道参数,当管道触发时我需要一直输入。现在我想在我的本地系统中从 postman 触发这个管道,我需要从帖子传递参数到管道。

Do you really need to use postman?你真的需要使用postman吗? I've posted examples of doing this with Powershell and with Python.我已经发布了使用 Powershell 和 Python 执行此操作的示例。

Powershell: How to pass arguments to ADF pipeline using powershell Powershell: 如何使用 powershell 将 arguments 传递到 ADF 管道

Python: https://gist.github.com/Gorgoras/1fe534fd9b454412f81c8203c773c483 Python: https://gist.github.com/Gorgoras/1fe534fd9b454741c488

If your only option is to use the rest api, you can read about it and get some examples here: https://docs.microsoft.com/en-us/azure/data-factory/quickstart-create-data-factory-rest-api如果您唯一的选择是使用 rest api,您可以阅读它并在此处获取一些示例: https://-docs.microsoft-factory/cn-create-us/休息API

Hope this helped!!希望这有帮助!

Azure Docs doesn't provide examples on how to pass a parameter which I find weird also nowhere else on the internet have I found an example of how to pass multiple parameters via REST API, I guess most people use ADF shell to trigger it or python script. Azure Docs doesn't provide examples on how to pass a parameter which I find weird also nowhere else on the internet have I found an example of how to pass multiple parameters via REST API, I guess most people use ADF shell to trigger it or python脚本。

Anyway, if someone else stumbles on the same question then here's the solution (which is quite simple).无论如何,如果其他人偶然发现了同样的问题,那么这就是解决方案(这很简单)。

Firstly, Create an Azure App Registration and generate client ID and client secret value.首先,创建一个 Azure App Registration 并生成客户端 ID 和客户端密码值。

Authenticate via REST API to get the Bearer Token通过 REST API 认证得到 Bearer Token

curl --location --request POST 'https://login.microsoftonline.com/${TENANT_ID}/oauth2/token' \
--form 'grant_type="client_credentials"' \
--form 'client_id="${CLIENT_ID}"' \
--form 'client_secret="${CLIENT_SECRET_VALUE}"' \
--form 'resource="https://management.azure.com/"'

The response will contain a Bearer token, use it to trigger the pipeline.响应将包含一个 Bearer 令牌,使用它来触发管道。 Replace subscription id, resource group name, and adf name.替换订阅 ID、资源组名称和 adf 名称。

curl --location --request POST 'https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP_NAME}/providers/Microsoft.DataFactory/factories/${ADF_NAME}/pipelines/trigger-pipeline-from-rest/createRun?api-version=2018-06-01' \
--header 'Authorization: Bearer ${BEARER_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "date":"2022-08-22",
    "param1":"param1 value",
    "param2":"some-value"
}'

Note: The app should have contributor access to ADF to trigger the pipeline.注意:应用程序应具有对 ADF 的贡献者访问权限以触发管道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Azure数据工厂中将参数传递给管道? - How to pass parameter to pipeline in azure data factory? 如何使用PowerShell(Azure Automation)触发Azure Data Factory管道? - How to trigger Azure Data Factory pipeline using PowerShell (Azure Automation)? 从数据工厂管道触发器调用azure函数时出错 - Error calling the azure function from data factory pipeline trigger 使用 powershell 从 azure 数据工厂中的管道中删除触发器引用 - Remove trigger reference from pipeline in azure data factory using powershell 如何在 Azure 数据工厂中对管道执行触发器进行排序 - How to sequence pipeline execution trigger in Azure Data Factory 如何在 Azure 数据工厂中的触发器运行期间将参数传递给管道? - How to pass parameters to pipeline during trigger run in Azure Data Factory? Azure数据工厂管道触发时间 - Azure Data Factory Pipeline trigger time Azure 数据工厂 - 在外部手动触发管道 - Azure Data Factory - Trigger Pipeline Manually Externally 如何动态更改 Azure 数据工厂管道参数?我想从“元数据活动”为管道参数分配新值 - How can I change Azure data factory pipeline parameter dynamically?I want to assign new value to pipeline parameter from 'Metadata activity' 如何为多个用户重用 Azure 数据工厂管道 - How to reuse the Azure Data Factory pipeline for multiple users
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM