如何通过Azure自动化部署文件共享快照计划程序? [英] how to deploy Files share snapshot scheduler by Azure Automation?

查看:107
本文介绍了如何通过Azure自动化部署文件共享快照计划程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Azure自动化来部署文件共享"快照计划程序,创建一个运行本,但是在Internet上找不到该cmdlet.

I want to use Azure Automation to deploy Files Share snapshots scheduler, I create a runbook, but I can't find the cmdlet at the internet.

(有一些关于如何从0创建快照的示例,但是我想创建现有的Files共享快照,并且我试图更改cmdlet以使其起作用,但是失败了.)

(there have some samples about how to create a snapshot from 0, but I want to create the existing Files share snapshots, and I tried to change the cmdlet to make it work, it was failed.).

有人可以告诉我有关正确的cmdlet或通过Azure自动化进行计划的某种方法.

Is there someone can tell me about the right cmdlet or some way to schedule that with Azure Automation.

非常感谢.

推荐答案

请尝试在您的运行手册中使用以下代码,该代码对我有效(如果要参数化帐户名/密钥和文件共享名,则可以这样做您的自我或向我寻求帮助):

Please try the code below in your runbook, it works at my side(if you want to parameterized the account name / key and fileshare name, you can do it your self or ask me for help):

$context = New-AzureStorageContext -StorageAccountName your_storage_account -StorageAccountKey your_storage_account_key

$share = Get-AzureStorageShare -Context $context -Name your_file_share_name

$snapshot = $share.Snapshot()

请注意,如果提示您输入the Snapshot() method is not found,则应从自动化帐户->模块"库中安装azure.storage模块,然后导入此模块.几分钟后生效.

Note that if it prompts that the Snapshot() method is not found, you should install the azure.storage module from your automation account -> Modules gallery, and import this module. It will take a few minutes to take effect.

这篇关于如何通过Azure自动化部署文件共享快照计划程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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