了解 Azure 数据工厂中 HTTP 请求 Activity 中的基础和动态 URL
Understanding of Base and dynamic URL in HTTP Request Activity in Azure data factory
我正在尝试使用 Azure 数据工厂从 API 调用中获取数据,然后使用复制数据 activity 将其推送到目的地。我正在尝试使用 HTTP 请求 activity 作为我的复制数据 activity 操作中的源。我在 HTTP 请求源中的输入如下:
Base URL: https://ABCDEF.com
Relative URL:Parameter
Parameter Passed:@concat('/bulk/v1/activities/export/',variables('Export ID Activities'),'/file.json?client_id=ClientID&client_secret=ClientSecret')
Headers:'Authorization: Bearer ABCDEF'
我从另一个调用中获取导出 ID 变量,该变量可以正常工作。即使这个调用在 Postman 中也没有问题。但是,如果我尝试调试该问题,则会出现以下错误。我认为问题出在我的亲戚 URL 身上。 URL 的相对 URL 点点滴滴可以 URL 还是只包含 API 调用的查询参数?
{"code":"BadRequest","message":"ErrorCode=InvalidTemplate, ErrorMessage=Unable to parse expression 'body('Copy data2ComposeRuntimeVariables')","details":null,"error":null}
中relativeUrl的描述
relativeUrl: A relative URL to the resource that contains the data. The
HTTP connector copies data from the combined URL: [URL specified in
linked service][relative URL specified in dataset].
根据我的测试,相对 URL 只能包含查询参数。您可以硬编码您的亲戚 URL 来试一试。
我能够解决问题。您可以向相对 URL 添加多个查询参数。主要请求基本上是 Base URL 和 Relative URL 的串联。当我参数化相对 URL 时,我将其命名为
Export ID
由于导出和 ID 之间的 space,管道一直失败。删除 space 为我解决了这个问题,我能够将更多的东西传递给亲戚 URL。
我正在尝试使用 Azure 数据工厂从 API 调用中获取数据,然后使用复制数据 activity 将其推送到目的地。我正在尝试使用 HTTP 请求 activity 作为我的复制数据 activity 操作中的源。我在 HTTP 请求源中的输入如下:
Base URL: https://ABCDEF.com
Relative URL:Parameter
Parameter Passed:@concat('/bulk/v1/activities/export/',variables('Export ID Activities'),'/file.json?client_id=ClientID&client_secret=ClientSecret')
Headers:'Authorization: Bearer ABCDEF'
我从另一个调用中获取导出 ID 变量,该变量可以正常工作。即使这个调用在 Postman 中也没有问题。但是,如果我尝试调试该问题,则会出现以下错误。我认为问题出在我的亲戚 URL 身上。 URL 的相对 URL 点点滴滴可以 URL 还是只包含 API 调用的查询参数?
{"code":"BadRequest","message":"ErrorCode=InvalidTemplate, ErrorMessage=Unable to parse expression 'body('Copy data2ComposeRuntimeVariables')","details":null,"error":null}
relativeUrl: A relative URL to the resource that contains the data. The HTTP connector copies data from the combined URL: [URL specified in linked service][relative URL specified in dataset].
根据我的测试,相对 URL 只能包含查询参数。您可以硬编码您的亲戚 URL 来试一试。
我能够解决问题。您可以向相对 URL 添加多个查询参数。主要请求基本上是 Base URL 和 Relative URL 的串联。当我参数化相对 URL 时,我将其命名为
Export ID
由于导出和 ID 之间的 space,管道一直失败。删除 space 为我解决了这个问题,我能够将更多的东西传递给亲戚 URL。