azure - Start-AzAutomationRunbook 不断失败,并出现“未指定 Runbook 强制参数”。参数名称 ResourceGroupName。
问题描述
我正在尝试使用 powershell 启动自动化运行手册,但命令不断失败并出现以下错误...
Start-AzAutomationRunbook : Runbook mandatory parameter not specified. Parameter name ResourceGroupName.
这是我正在运行的命令...
Start-AzAutomationRunbook -AutomationAccountName "existingAccountName" -Name "existingRB" -ResourceGroupName "existingRG" -MaxWaitSeconds 2000 -Wait
我已确认自动化帐户存在、资源组存在、运行手册存在。我已经成功地在控制台中启动了运行手册,没有出现错误。
我希望在 Powershell 中运行 Start-AzAutomationRunbook 时启动运行手册。
解决方案
看来您的作业脚本需要一个resourcegroupname
参数才能运行。您在下面的行中指定的资源组是运行手册所在帐户的资源组。
Start-AzAutomationRunbook -AutomationAccountName "existingAccountName" -Name "existingRB" -ResourceGroupName "existingRG" -MaxWaitSeconds 2000 -Wait
要将资源组或参数应用于实际作业,您必须传递参数,如果您的作业只需要 ResourceGroupName,则下面应该可以工作。
$AutomationRG = "existingRG"
$params = @{"ResourceGroupName"="$AutomationRG"}
Start-AzureRmAutomationRunbook -AutomationAccountName "existingAccountName" -Name "existingRB" -ResourceGroupName $AutomationRG -Parameters $params
推荐阅读
- docker - 与不同桥接网络中的多个 docker-compose.yml 通信
- markdown - 如何按顺序自动编号 MkDocs 图形
- java - Java固定线程池竞争条件?
- python-3.x - 如何使用 if 语句同时读取列表中的所有元素?
- python - 按 2 列分组并在 Pandas 中为每个组合打印数据
- ios - Apple 开发者注册错误:此时无法完成您在 Apple 开发者计划中的注册
- apache-spark - 在 Pyspark 中将月份名称转换为数字
- mql4 - MT4 MQL4- OrderClose() 返回结果的确切时间是什么?
- python - 第一个相邻的差值大于一个值
- apache-spark-sql - 用于 spark sql 的 date_add/dateadd Athena/Redshift 类似函数