powershell - 使用 Powershell 获取 Azure Function 路由参数(段)

标签 powershell azure azure-functions

我正在尝试弄清楚如何使用 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/

相关文章:

powershell - 如何使用 Powershell 在 IIS 10 上更新站点的 "physical path"?

azure - 无法使用 Connect-MsolService 进行连接

powershell - 使用Powershell和ADSI设置本地密码

windows - RunOnce 在重新启动时使用随机名称重命名计算机名

powershell - 在PowerShell中获取窗口的位置和大小

用于 VPN 的 Azure 静态 IP?

MongoDB 副本集 - 参数 linuxConfiguration.ssh.publicKeys.keyData 的值无效

node.js - azure 函数 javascript 锐利模块

azure - 尝试调用包装在 Docker 容器中的 Azure Function 时出现内部服务器错误 (500)

java - 使用 azure junit 测试在 Spring Cloud 函数中出现错误