簡體   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