Python Azure功能可启动VM并执行操作 [英] Python Azure function to start a VM and perform action

查看:121
本文介绍了Python Azure功能可启动VM并执行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我一直在浏览azure函数文档,但是似乎很少有Python语言的官方文档.我的用例是创建一个azure函数,该函数可以从blob存储中提取文件,启动停止的VM并运行文件 在里面.

I have been going through azure functions documentation but it seems like there is little official documentation for Python language. My use-case is to create a azure function that can pick up a file from blob storage, start a stopped VM and run the file inside it. 

任何人都可以在这里向我指出正确的方向.

Can anyone point me in the right direction here.

推荐答案

Python的Azure函数最近

Azure Functions for Python was recently announced as a Public Preview, hence the lack of comprehensive documentation.

话虽这么说,但我相信您的大多数用例(如果不是全部的话)确实都有文档,这些文档可能分散在各处.这是您需要的文档的链接

That being said, I believe most if not all of your use case does have documentation which is probably scattered across. Here are the links to the docs that you would need

Functions Python快速入门
Functions Python Reference
Python绑定参考

Functions Python Quickstart
Functions Python Reference
Python Bindings Reference

有关如何使用绑定的示例,您可以在各自的绑定参考"文档中找到它们. 这里是用于Blob存储的那个.您可以在文档页面的侧面菜单中找到其他人.

For samples on how to use bindings, you can find them in the respective Bindings Reference docs. Here is the one for blob storage. You can find the others in the side menu of the docs page.

话虽如此,您也可以查看我们的 Logic Apps ,以减少此用例的总体编码工作量.逻辑应用程序可以
1.使用 Azure Blob存储连接器
2.使用 Azure资源管理器连接器
启动VM. 3.使用 SFTP-SSH连接器
4.调用一个(更简单的)函数,该函数使用

That being said, you could also check our Logic Apps to reduce your overall coding effort for this use case. The Logic App could
1. Pick up the file from blob using the Azure Blob Storage Connector
2. Start the VM using the Azure Resource Manager Connector
3. Copy the file into the VM using the SFTP-SSH Connector
4. Call a (much simpler) function which runs the file on the VM using the Azure Functions Connector - unfortunately there isn't a logic app connector that does this yet

根据您的用例,可以通过 HTTP 存储队列消息 服务总线消息等.

Depending on your use case, this Logic App could be triggered via HTTP, Storage Queue Message, Service Bus Message, etc.


这篇关于Python Azure功能可启动VM并执行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆