简体   繁体   English

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

[英]Automation account is linked to a workspace Azure

I am trying to delete an automation account in Microsoft Azure. 我正在尝试删除Microsoft Azure中的自动化帐户。

When I run this command below, I get the error below : 当我在下面运行此命令时,出现以下错误:

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

I get the following error : 我收到以下错误:

{
  "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/...."
}

Anybody know how to fix this issue? 有人知道如何解决此问题吗?

If you are using a linked automation account to a Workspace, you need to first remove the solutions in OMS that use the Automation Account. 如果您使用链接到工作区的自动化帐户,则需要首先在OMS中删除使用该自动化帐户的解决方案。

Azure Automation, Change Tracking and Updates are the solutions that use Automation account. Azure自动化,更改跟踪和更新是使用自动化帐户的解决方案。

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

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

Now remove each of the solutions: 现在删除每个解决方案:

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

After that, you can get the Resource ID of the Azure Automation account and delete it: 之后,您可以获取Azure自动化帐户的资源ID并将其删除:

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

Remove-AzureRmResource -ResourceId $automationAccount.ResourceId

The MSDN website has a solution to this. MSDN网站对此有解决方案。 Kindly follow the link given below: 请点击以下链接:

MSDN - How to unlink an automation account that is linked to an OMS workspace? MSDN-如何取消链接到OMS工作区的自动化帐户的链接?

Hope this helps. 希望这可以帮助。

There is also this guidance, but in January it was "coming soon": 也有此指南,但在一月份它“即将推出”:

  1. Navigate to the Automation Account that is linked to a workspace 导航到链接到工作区的自动化帐户
  2. Select the Overview node 选择概述节点
  3. Click the Unlink Workspace command (this is currently not available and the tool tip shows 'coming soon') 单击“取消链接工作区”命令(当前不可用,工具提示显示“即将推出”)

Source: 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 来源: 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

According to your description, you need unlink your Automation account with workspace. 根据您的描述,您需要取消您的自动化帐户与工作空间的链接。 You could do it on Azure Portal. 您可以在Azure门户上执行此操作。

在此处输入图片说明

More information please refer to this link . 更多信息请参考此链接

After do it, you could remove your Automation account. 之后,您可以删除您的自动化帐户。

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

相关问题 获取Azure自动化帐户的Sku - Get the Sku of Azure automation account Azure 自动化帐户 Webhook 响应 - Azure Automation Account Webhook Response 使用“运行方式”帐户与来自 Azure 自动化的团队联系 - Connect with teams from an Azure Automation with “run as” account 在 Azure 自动化账户(powershell)中将字符串转换为日期时间 - Convert string to datetime in Azure automation Account (powershell) 从 Azure 自动化帐户 Powershell 上传数据 - Upload data from Azure Automation Account Powershell Azure 自动化帐户中的绑定重定向 PowerShell Runbook - Binding Redirection in Azure Automation Account PowerShell Runbook Powershell PSPKI 模块在 azure 自动化帐户中不起作用 - Powershell PSPKI module is not working in azure automation account 在没有用户凭据的情况下登录 Azure 自动化帐户到 Azure AD - Login Azure Automation account, without user credential, to Azure AD 白名单 Azure Azure 存储中的自动化帐户以从 blob 读取压缩模块并上传到 azure 自动化模块 - Whitelist Azure Automation account in Azure Storage to read zipped module from blob and upload in azure automation module 如何在 Azure 自动化帐户中将 AzureRM 模块替换为 Az - How to Replace the AzureRM module with Az in Azure Automation Account
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM