azure - 如何按计划在 azure 函数中运行 powershell 脚本
问题描述
我需要使用 azure 函数按计划运行 powershell 脚本,我尝试使用 node.js 执行该文件,但它不起作用,我不知道为什么。
解决方案
虽然当时我的原始答案是正确的,但 Azure 已更新为支持使用 Powershell 的 Azure Functions:https ://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-powershell
原答案:
对我来说,Azure 自动化 ( https://docs.microsoft.com/en-us/azure/automation/ ) 似乎是在 Azure 中按计划运行 Powershell 脚本的更好模型,因为它确实是该工具的本机功能。
如果您真的想在 Azure 函数中执行此操作,看起来确实可以尝试一些资源(我没有测试过它们):
https://blogs.msdn.microsoft.com/powershell/2017/02/24/using-powershell-modules-in-azure-functions/
https://github.com/Azure/azure-functions-powershell-worker
祝你好运!!
推荐阅读
- sql - 将行分组到范围内,同时也显示间隙
- javascript - 将 express 控制器拆分为多个文件
- np - SAT 是 NP 完备的,那么为什么我们没有 k-SAT 对于任意 k 值是 NP 完备的
- oop - 为什么我的表返回 NIL 并且没有填充?
- javascript - 如何将 chessboard.js 节点模块导入 Angular 项目?
- python - 映射/连接到发布 Django 网站时的错误请求问题
- sql - IBM Db2 on Cloud 中使用的 SQL 方言是什么
- visual-studio-code - 在 Visual Studio Code 中的模板字符串之间添加用户创建的片段
- forth - 在 Forth 中执行一个字符或字符串,就好像它是一个单词一样
- python - python中的回溯是什么?