Azure 数据工厂获取业务中心总账条目

问题描述 投票:0回答:1

我创建了一个 OData LinkedService 并将其连接到 Business Central,如屏幕截图所示:

Screenshot of settings

然后,当我运行管道或预览时,出现以下错误:

Operation on target Copy data1 failed: Failure happened on 'Source' side. ErrorCode=ODataRequestNotSucceeded,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Requesting response from path G_LEntries and query failed with status code NotFound and message {"error":{"code":"Internal_CompanyNotFound","message":"Cannot process the request because the default company cannot be found. You can specify a default company in the service configuration file, or specify one for each tenant, or you can add a query string in the form of "company=[name]". You can see the available companies by accessing the default OData web service, Company. For more information, see "OData Web Services" in Help. ,Source=Microsoft.DataTransfer.Runtime.ODataConnector,'

不知道是否是这样传递参数的方式,或者是否可以通过其他方式进行管理。我已多次将参数名称更改为 Company、Company、company、company、companyname、defaultcompany,但我仍然收到相同的错误。

azure azure-data-factory odata businesscentral
1个回答
0
投票

不知道是不是这样传递参数的方式,还是可以通过其他方式管理

创建链接服务参数后,您需要在 OData URL 中通过字符串插值使用该参数

@{<linked_service_parameter>}
。链接的服务名称可以是任何名称。您传递给它的值将会给出错误。

如果您想通过参数将您的值

samplecompany
传递到链接服务URL,首先您需要像下面的示例一样包含它。

https://<ODATA_org>/<your_URL>/@{linkedService().<your_linkedservice_parameter_name>}

这里,我的链接服务参数名称是

name
。如果您的参数名称是
Company
,请将其添加到您需要的位置,例如
@linkedService().Company

enter image description here

现在,为该参数提供所需的值。

enter image description here

此外,在 OData URL 中,特殊字符应按编码给出。例如,对于值

My Company
,URL 中的编码值为
My%20Company
。因此,请将表达式
@encodeUriComponent('<your_value>')
赋予您的参数,以便在出现特殊字符时将普通字符串编码为 OData URL 格式。

© www.soinside.com 2019 - 2024. All rights reserved.