我正在尝试弄清楚如何使用 Powershell 获取 Azure Functions 路由参数(段)。
我想以某种方式获取 function.json 文件中定义的方法:
{
"bindings": [
{
"name": "req",
"type": "httpTrigger",
"direction": "in",
"authLevel": "function",
"route": "api/{method}"
},
...
]
}
$req = 如果使用 POST,则为我提供正文
$req_query_* = 提供查询参数,但不提供路由中定义的段。
提前致谢
最佳答案
可能有更好的方法,但一个选择是阅读 function.json
直接归档,如下:
$Config = Get-Content D:\home\site\wwwroot\<function_name>\function.json -Raw | ConvertFrom-JSON
哪里<function_name>
是你的函数的名称。
关于powershell - 使用 Powershell 获取 Azure Function 路由参数(段),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46098337/