Running Azure PowerShell commands from a webjob

前端 未结 2 699
忘了有多久
忘了有多久 2021-01-19 10:31

Update: I used Azure Automation per BenV\'s suggestion below and it worked! More info can be found here.


I have a PowerShell script that need

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-19 11:16

    Azure PowerShell is not currently supported from the sandbox in which WebJobs runs. There are a variety of factors:

    1. The CmdLets are not installed on the worker
    2. Even if installed, there are issues that prevent them from running correctly
    3. Even if they run, you'd need to authenticate before running command. This last part is solvable using Service Principals.

    Factor #2 is the biggest blocker. We'd like to get to a point where this is possible, but right now it is tricky.

    One potential workaround is to do ARM requests directly, though that's a bit more work (and you still need to auth using Service Principal). You could also write C# code to make the calls.

提交回复
热议问题