繁体   English   中英

自动化帐户已链接到工作区Azure

[英]Automation account is linked to a workspace Azure

我正在尝试删除Microsoft Azure中的自动化帐户。

当我在下面运行此命令时,出现以下错误:

Remove-AzureRmResource -ResourceGroupName changed_resource_group_name -ResourceType Microsoft.Automation/automationAccounts -ResourceName changed_resource_name ApiVersion 2015-10-31 -Force

我收到以下错误:

{
  "code": "Conflict",
  "message": "Automation account is linked to a workspace. SubscriptionId: changed_subscription_id AccountName: changed_automation_ac_name WorkspaceId: /subscriptions/...../providers/microsoft.operationalinsights/workspaces/...."
}

有人知道如何解决此问题吗?

如果您使用链接到工作区的自动化帐户,则需要首先在OMS中删除使用该自动化帐户的解决方案。

Azure自动化,更改跟踪和更新是使用自动化帐户的解决方案。

$automationSolutions = "Updates", "ChangeTracking", "AzureAutomation"

$enabledautomationSolutions = (Get-AzureRmOperationalInsightsIntelligencePacks -ResourceGroupName $workspace.ResourceGroupName -WorkspaceName $workspace.Name).Where({$_.Name -in $AutomationSolutions -and $_.Enabled -eq $true})

现在删除每个解决方案:

foreach ($soln in $enabledAutomationSolutions.Name) {
        Set-AzureRmOperationalInsightsIntelligencePack -ResourceGroupName $workspace.ResourceGroupName -WorkspaceName $workspace.Name -IntelligencePackName $soln -Enabled $false
    }

之后,您可以获取Azure自动化帐户的资源ID并将其删除:

$automationAccount = Get-AzureRmResource -ResourceId ($workspace.ResourceId + "/linkedServices/automation") -ErrorAction Stop

Remove-AzureRmResource -ResourceId $automationAccount.ResourceId

MSDN网站对此有解决方案。 请点击以下链接:

MSDN-如何取消链接到OMS工作区的自动化帐户的链接?

希望这可以帮助。

也有此指南,但在一月份它“即将推出”:

  1. 导航到链接到工作区的自动化帐户
  2. 选择概述节点
  3. 单击“取消链接工作区”命令(当前不可用,工具提示显示“即将推出”)

来源: https : //social.msdn.microsoft.com/Forums/en-US/cb158610-a065-4cb9-b302-6230de5ca434/how-to-unlink-an-automation-account-that-is-linked-to- an-oms-workspace?forum = opinsights

根据您的描述,您需要取消您的自动化帐户与工作空间的链接。 您可以在Azure门户上执行此操作。

在此处输入图片说明

更多信息请参考此链接

之后,您可以删除您的自动化帐户。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM