问题标签 [azure-automation]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1668 浏览

powershell - Azure 自动化模块导入 - 如何调查未作为活动导出/提取的模块成员?

我有一个带有一些嵌入式工作流和本机 ps1 cmdlet 的自定义模块。

当我导入此模块时,只有一部分 cmdlet 显示为模块下的提取活动。

模块正在成功完成导入,并显示为可用。

是否有任何地方可以查找特定输出和任何可能的特定于成员的导入错误?

无法加载的 cmdlet 取决于作为程序集的一部分添加的一些新类型。正在加载的 cmdlet还取决于该程序集的类型。

更令人困惑的是,当我在 ISE 中本地导入此模块时,一切正常,并且所有 cmdlet 都可用/可执行。

进一步:我已经在 Native PowerShell cmdlet 中看到了这一点,但它看起来好像(单个)PowerShell Workflow activity inside a .ps1 is not supported

此外,我在本地看到,取决于是否使用 .psd1 或 .psm1 加载我的模块,我得到不同的行为和结果 WRT 依赖程序集加载。

特别是,当尝试在本地解决不一致问题时,我得到了一些“找不到类型”或“找到多个 1 arg 的 ctor 重载”(尽管所讨论的类型没有 1 的 ctor arg) 通过[OutputType([typename])]等引用的类型的错误,当发现其他依赖于 SAME 程序集的类型的 cmdlet 时就好了..

[编辑]
我的测试 .psm1 的本地详细输出

详细:导入功能“同步测试”。
详细:将命令导入为工作流“Sync-VsoGitRmRunbook”。

在 AA 中,sync-test(只是一个编写字符串输出的普通运行手册)显示良好,而 Sync-VsoGitRmRunbook 则没有。

如果我将同步测试转换为工作流,它也会停止导入,这让我相信导出捆绑为 .ps1 文件的工作流活动的模块存在限制(而不是打包在模块中的 C# 类)

[编辑]
我创建了一个重现问题的模块。 https://github.com/JoeBrockhaus/AzureAutomationVsoGitSync

0 投票
0 回答
49 浏览

powershell - How can I overcome (or what leads to) empty Azure Automation Module blades?

enter image description here

I've seen this a handful of times and it's unclear why it is the case. It's not simple a matter of having not loaded yet - the Delete button, for instance, is inactive until the blade fully loads (and the little horizontal progress indicator at the top of the blade works as usual).

It is persistent across browsers/portal sessions, users, etc.

In the runbook editor(s), the Module appears to be loaded and expandable to see its members, but as this module was recently updated, I have no way of knowing if it is actually updated or if that's just the listing of the previous module. If something is so wonky with the 'provisioning' or 'importing' or 'extracting' that the portal can't even render the blade for the module, I have little faith that everything is A-OK under the covers.

Even worse, I have no way of interrogating any output from the operations in order to remediate any potential problems - as far as my code (or portal) is concerned, the module uploaded, imported, and extracted successfully, even though it didn't, actually.

I've noticed that some system-level jobs must be responsible for these imports/extractions, because the Job Statistics Monitoring Tile on the Automation Account ticks up the count when a module is being imported, yet these phantom Jobs don't actually show up in the Jobs list (and obviously, nor do the runbooks underpinning them).

0 投票
1 回答
618 浏览

powershell - Azure 自动化 - 如何将 Azure 存储程序集加载到运行手册中

在此处使用代码 https://msdn.microsoft.com/en-us/library/jj919145.aspx

我正在尝试打破 SQL 备份到 URL 创建的 blob 的租约,以便我可以使用 remove-azurestorageblob 删除旧 blob

这在本地就像一个梦想,但我想在 Azure 自动化中运行它

我需要加载存储组件,但我似乎无法得到它。

我看了这个答案

https://social.msdn.microsoft.com/Forums/en-US/45251bdb-bb20-488c-a428-3ee1094fd568/referencing-microsoftwindowsazurestoragedll-and-creating-cloud-blob-client-using?forum=azureautomation

并尝试使用 C:\modules 文件夹加载

我写了一个运行手册来搜索 dll

并尝试使用 c:\modules\global 中返回的路径进行加载,但总是得到错误找不到程序集

0 投票
2 回答
265 浏览

powershell - Azure 自动化图形运行手册 - 无法将自动化帐户中的其他运行手册作为不同的画布活动执行?

图形编辑器 UI 似乎允许添加 Workflow Runbook(仅;不显示本机 PS),但是,这会破坏 GraphRunbook 定义/执行。

当我尝试测试或发布 Runbook 时,我收到图像中的错误。(同样奇怪的是,这条错误消息的前半部分是西班牙语,后半部分是英语。)

自动化帐户中的其他运行手册在技术上是否不受支持.. 尚未?

1]

测试二代码:

0 投票
1 回答
1177 浏览

powershell - Azure 自动化 PowerShell 脚本两次运行命令

我有一个安排在每晚运行的 Azure 自动化 PowerShell 脚本。出于某种原因,工作流每隔一段时间就会运行一次,然后在正在运行的工作流的同一实例中再次从头开始运行所有命令。我没有循环整个工作流程或任何事情,所以我不知道这是如何发生的或为什么会发生。有什么想法吗?

这是代码:

这是输出。您可以看到它在完成后再次开始从脚本顶部运行命令。

0 投票
2 回答
1518 浏览

azure - Azure 自动化 - 未找到 Runbook 参数?

添加带有参数的运行手册后,无论是在测试窗格中还是在发布后作为作业,我都无法启动它。

  • 在此之前存在的 Runbook 会填充参数。
  • 无法在 ISE 中启动测试作业(又名,这不仅仅是门户/浏览器问题)。
  • 来自 ARM API 的 GET 返回具有空参数属性的运行手册。

[CmdletBinding()][编辑] 我可能应该添加它是否已指定无关紧要。[/编辑]

例子

0 投票
1 回答
2914 浏览

powershell - 在 Powershell 工作流中使用 AzureStorageContext

我正在尝试将存储帐户内的所有容器复制到另一个存储帐户上的单个容器中。我已经在我自己的机器上完成了这项工作,没有任何问题,但我想使用 Azure 自动化来自动化它。

当运行一个标准的 powershell 脚本时,所有的异步调用都是同步发生的。为了解决这个问题,我尝试添加“Powershell Workflow”运行手册。问题是我有几个调用 Azure 存储命令需要一个AzureStorageContext. 问题是我无法将上下文绑定到任何东西,因为它将被序列化为字符串。

我有以下代码:

一个标准的解决方法是使用一个InlineScript块来处理任何需要上下文对象的东西。但是,如果我这样做,我将失去并行复制 blob 的能力。

有什么方法可以在 Azure 自动化上执行此操作,同时仍然并行启动所有 blob 的复制命令?

0 投票
3 回答
2118 浏览

dsc - 在 Azure 自动化 DSC 中获取计算机名

我正在尝试使用 Azure Automation Pull 服务器将 DSC 配置添加到 VM。通常,您可以使用环境变量获取当前机器的名称$env:COMPUTERNAME- 即像这样:

但是当使用 Azure 自动化$env:COMPUTERNAME似乎总是返回CLIENT而不管当前的机器名称。使用 Azure 自动化时,在 DSC 配置中动态获取当前 VM 名称的最佳/最推荐方法是什么?

提前致谢。

此致,

托马斯

0 投票
0 回答
124 浏览

azure - 使用 Azure 存储中还原的现有 VM 的备份来配置 VM 的 Azure 自动化

我需要有关使用 Azure 存储中还原的现有 VM 备份自动配置 VM 的帮助。

这里的场景是 - 我们正在使用 PowerShell 备份一组 VM(使用 Azure 备份)并使用保留 IP 在云服务上进行恢复(我们无法使用门户将 VM 备份恢复到具有保留 IP 的云服务)。我们希望使用 Azure 自动化来自动执行此操作。

谢谢,曼莫汉·辛格

0 投票
1 回答
1665 浏览

azure - 使用 ARM 模板创建 Azure 自动化 Runbook Webhook?

我正在尝试为 Automation Runbook 创建一个 Webhook。到目前为止,我已经实现了以下目标:

  1. 创建自动化帐户
  2. 创建运行手册

这是我正在使用的模板:

我无法创建 webhook。到目前为止,在搜索之后,我也找不到用于创建 Runbook 的模板架构。任何帮助表示赞赏。

提前致谢