【问题标题】:Run powershell script as microservice将 powershell 脚本作为微服务运行
【发布时间】:2017-04-09 23:32:30
【问题描述】:

是否可以让我的 powershell 脚本作为微服务运行?

Param(
    $a,
    $b
)

$x = [int]$a + [int]$b

echo $x

【问题讨论】:

  • 微服务以什么方式?
  • 究竟什么是微服务?特别是在 Windows 脚本的上下文中。
  • 我想运行我的脚本,作为接受地址localhost:port/sum?a=1&b=2上的HTTP GET类型的http请求的服务,并以内容3进行响应。
  • Powershell 可以运行 HTTP 服务器。您应该开始研究该主题并决定您喜欢哪些选项。如果您已经决定了一个选项并有一个具体的问题,欢迎您提出。快速搜索一下这个 Gist:gist.github.com/wagnerandrade/5424431,但还有更多示例可以帮助您入门。
  • 我不同意,在 Powershell 中运行 Web 服务器真是一团糟 + 无助于分配负载之类的东西

标签: windows azure powershell automation microservices


【解决方案1】:

实际上,您应该看看 Azure Functions,它们完全实现了您想要的并且它们支持 PowerShell/

https://david-obrien.net/2016/07/azure-functions-PowerShell/

https://azure.microsoft.com/en-us/services/functions/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-30
    • 1970-01-01
    相关资源
    最近更新 更多