ADF V2 - ADF管道Web活动 - 关于使用相对Web地址的可行性 [英] ADF V2 - ADF pipeline Web Activity - regarding feasibility of using relative web address

查看:80
本文介绍了ADF V2 - ADF管道Web活动 - 关于使用相对Web地址的可行性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试使用ADF管道的Web活动来调用GET请求。我使用端点地址如下,它工作正常:

develop.environment.azurewebservices.net/DoThis?Parameter=123


<我想知道我们是否可以使用相对地址调用Web请求(例如,创建一个REST链接服务,在那里添加基地址,然后在管道活动中添加相对地址为  / DoThis?Parameter = 123



谢谢,


Paaras

解决方案

你好Paaras,谢谢你的询问。 使用基本和相对地址创建动态定义的URL可以在不使用单独的REST链接服务的情况下完成。 在我进入之前,让我澄清一些困惑。



"链接服务"和"数据集"在Web活动的设置中(图中圈出),用作发送到端点的有效负载,至少根据

此文档






我试过在网络活动中只添加相对地址,但这似乎不起作用。 以下是我发现的工作:

1为基地址创建一个参数,并为其分配值

2为相对地址创建参数或变量

3创建Web活动,并为URL选择动态内容和@concat()基础和亲属。

这是我刚刚创建的示例管道。 它可以针对运行期间确定的相对地址以及运行前确定的相对地址进行修改。



 {
" name" ;:"带有动态网址的网络活动",
" properties":{
" activities":[
{
" name":" Web1",
" type":" WebActivity",
" dependsOn":[
{
" activity":" set_tail",
" dependencyConditions" ;:[
"成功"
]
}
],
" policy" ;: {
" timeout":" 7.00:00:00",
" retry":0,
" retryIntervalInSeconds":30,
" secureOutput":false,
" secureInput":false
},
" typeProperties" ;:{
" url":{
" value":" @concat(pipeline()。parameters.base_url,variables('tail'))",
" ;输入":"和"表达式"
},
" method""" GET"
}
},
{
" name":" set_tail",
" type":" SetVariable",
" typeProperties":{
" variableName":" tail",
" value":{
" value":" @pipeline()。parameters.tail_url",
" type":" Expression"
}
}
}
],
" parameters" ;: {
" base_url":{
" type": " string",
" defaultValue":" https://docs.microsoft.com/en-us/azure/data-factory"
},
" tail_url":{
" type":" string",
" defaultValue":" / control-flow-web-activity"
}
},
" variables" ;: {
" tail":{
" type":" String",
" ; defaultValue":" /"
}
}
}
}




我知道这不完全是你的计划要做,但我认为它可以达到同样的效果。 这有帮助吗?


Hi,

I am trying to invoke a GET request using web activity of ADF pipeline. I am using endpoint address as below and it is working fine:
develop.environment.azurewebservices.net/DoThis?Parameter=123

I wanted to know if we can invoke web request using relative address (e.g. create a REST linked service, add base address there, and then add relative address in activity of pipeline as /DoThis?Parameter=123)

Thanks,

Paaras

解决方案

Hello Paaras and thank you for your inquiry.  Creating a dynamically defined URL , with a base and relative address, can be done without using a separate REST linked service.  Before I get into that, let me clear some confusion.

The "Linked Services" and "Datasets" in the settings of the Web Activity (circled in picture), are intended as payloads sent to the endpoint, at least according to this document.


I have tried adding just the relative address in the web activity, but that does not seem to work.  Here is what I found did work:
1 Create a parameter for the base address, and assign its value
2 Create a parameter or variable for the relative address
3 Create the Web activity, and for the URL, select dynamic content and @concat() the base and relative.
Here is a sample pipeline I just created.  It can be modified for relative addresses decided during run and for relative addresses decided before run.

{
    "name": "Web activity with dynamic URL",
    "properties": {
        "activities": [
            {
                "name": "Web1",
                "type": "WebActivity",
                "dependsOn": [
                    {
                        "activity": "set_tail",
                        "dependencyConditions": [
                            "Succeeded"
                        ]
                    }
                ],
                "policy": {
                    "timeout": "7.00:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30,
                    "secureOutput": false,
                    "secureInput": false
                },
                "typeProperties": {
                    "url": {
                        "value": "@concat(pipeline().parameters.base_url,variables('tail'))",
                        "type": "Expression"
                    },
                    "method": "GET"
                }
            },
            {
                "name": "set_tail",
                "type": "SetVariable",
                "typeProperties": {
                    "variableName": "tail",
                    "value": {
                        "value": "@pipeline().parameters.tail_url",
                        "type": "Expression"
                    }
                }
            }
        ],
        "parameters": {
            "base_url": {
                "type": "string",
                "defaultValue": "https://docs.microsoft.com/en-us/azure/data-factory"
            },
            "tail_url": {
                "type": "string",
                "defaultValue": "/control-flow-web-activity"
            }
        },
        "variables": {
            "tail": {
                "type": "String",
                "defaultValue": "/"
            }
        }
    }
}


I know this isn't exactly what you were planning to do, but I think it achieves the same result.  Does this help?


这篇关于ADF V2 - ADF管道Web活动 - 关于使用相对Web地址的可行性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆