![](/img/trans.png)
[英]Azure Search set ReplicaCount by Automation graphical runbook
[英]Using Azure Automation - Graphical Runbook - to backup APIM to storage
假设这是一个图形 (而不是图形PowerShell 工作流 )运行手册,那么这里应该没有序列化问题。
该问题很可能是由于您的自动化帐户中的模块版本不匹配引起的。 该错误消息表明New-AzureStorageContext需要一个类型为AzureStorageContext的参数,并且接收到一个类型为AzureStorageContext的值。 但是,不同的模块版本可以引用在不同程序集中定义的类型,并且该值不能自动转换为另一种类型。 例如,Azure.Storage(版本A)的New-AzureStorageContext可能返回与AzureRM.ApiManagement(版本B)的Backup-AzureRmApiManagement期望的类型不兼容的AzureStorageContext对象。 不幸的是,错误消息没有提供此信息。 为了确认这一点,您可以在同一自动化帐户中运行以下PowerShell Runbook:
(gcm New-AzureStorageContext).OutputType.Type.Assembly.FullName
(gcm Backup-AzureRmApiManagement).Parameters.StorageContext.ParameterType.Assembly.FullName
如果它们实际上指向不同的程序集,则可能需要将所有Azure模块的匹配版本导入到AutomationAccount中。 该脚本可以帮助您: https : //github.com/azureautomation/runbooks/blob/master/Utility/ARM/Update-ModulesInAutomationToLatestVersion.ps1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.