【问题标题】:Can I use Azure Function to automate linux tasks我可以使用 Azure Function 自动执行 linux 任务吗
【发布时间】:2021-12-14 08:38:45
【问题描述】:

这是一张图表,解释了我手动执行的操作 && 我想要自动化的操作

  • 连接到本地 gitlab-ce 实例
  • 启动 gitlab 备份并等待它完成
  • 将备份文件复制到 azure blob 并等待它完成
  • 将备份文件从 blob 复制到 azure vm 并等待它 完成
  • 连接到 azure vm 并恢复备份

我想自动化我使用 azure 工具执行的那些任务。 有人可以引导我找到可以开始寻找的方向吗?

Azure Functions 可以执行这类任务吗??

谢谢。

【问题讨论】:

  • 您可以使用带有Function Chaining patternDurable Azure 函数来实现此目的。有一些可用的文档here 将引导您创建您的第一个持久函数。也有可用的示例here
  • 感谢 Matt 的回复,我现在就开始阅读。
  • 您需要自动启动 gitlab 备份并将其作为 blob 推送到 Azure blob 存储 - 这部分需要在本地运行,因此您可以使用 Powershell 来完成此操作。然后,您的 Azure blob 存储trigger function 可以通过启动持久函数来获取备份 blob 并执行其余步骤,它必须使用 Azure sdk 来恢复 Azure VM 内的备份。

标签: linux azure automation azure-functions


【解决方案1】:

谢谢Matt StannettAnand Sowmithiran。发布您的建议作为帮助其他社区成员的答案。

您可以使用带有 function chaining pattern 的 Durable Azure 函数来实现此目的。

您需要自动启动 gitlab 备份并将其作为 blob 推送到 Azure blob 存储 - 这部分需要在本地运行,因此您可以使用 Powershell 来执行此操作。然后,您的 Azure blob 存储 trigger function 可以通过启动持久函数获取备份 blob 并执行其余步骤,它必须 use Azure sdk to restore the backup inside Azure VM

您可以参考Create your first durable function in PythonStorage Providers for Azure Durable FunctionsAzure Functions: How to manage Durable Functions with Blob Triggers?Automate Linux VM Customization Tasks Using CustomScript Extension

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-06
    • 1970-01-01
    • 2015-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多