【问题标题】:Azure Automation - How to load Azure Storage assembly into run bookAzure 自动化 - 如何将 Azure 存储程序集加载到运行手册中
【发布时间】:2016-03-04 02:06:26
【问题描述】:

在此处使用代码 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 文件夹加载

$storageAssemblyPath = "C:\Modules\Global\Azure\Compute\Microsoft.WindowsAzure.Storage.dll"
$bytes = [System.IO.File]::ReadAllBytes($storageAssemblyPath)
[System.Reflection.Assembly]::Load($bytes)

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

workflow robs
{
Inlinescript{
cd /
pwd

get-childitem *WindowsAzure.Storage.dll -recurse
}
}

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

【问题讨论】:

    标签: powershell azure-automation


    【解决方案1】:

    奇怪的是,一旦我放下并重新创建运行手册,它现在就可以工作了,因为它没有保存我的更改。

    因此,新的 azure 门户 azure 自动化创作窗格出现了一些奇怪的情况,我相信它没有正确保存我的更改,因此不断给我错误

    【讨论】:

      猜你喜欢
      • 2022-01-07
      • 1970-01-01
      • 2022-10-21
      • 2021-12-21
      • 2020-01-18
      • 1970-01-01
      • 1970-01-01
      • 2022-11-10
      • 1970-01-01
      相关资源
      最近更新 更多