Я не могу удалить лазурное оповещение - PullRequest
0 голосов
/ 07 июня 2019

У меня есть следующее предупреждение в Azure:

PS C:\> Get-AzResource -Name "alert for rg"

Name              : alert for rg ResourceGroupName : plaz-rg2 ResourceType      : Microsoft.AlertsManagement/actionRules Location    : global ResourceId        : /subscriptions/XXXX/resourceGroups/plaz-rg2/providers/Microsoft.Alerts
                    Management/actionRules/alert for rg

Я удалял его раньше, но он все еще виден.

Я не могу удалить группу ресурсов из-за этого.

PS C:\> Remove-AzResourceGroup -name "plaz-rg2"

Confirm
Are you sure you want to remove resource group 'plaz-rg2'
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y
Remove-AzResourceGroup : Long running operation failed with status 'Conflict'.
At line:1 char:1
+ Remove-AzResourceGroup -name "plaz-rg2"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : CloseError: (:) [Remove-AzResourceGroup], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.RemoveAzureResourceGroupCmdlet

Когда я пытаюсь удалить оповещение в одиночку, это невозможно

PS C:\> Remove-AzResource -Name "alert for rg" -ResourceType Microsoft.AlertsManagement/actionRules

Confirm
Are you sure you want to delete the following resource:
/subscriptions/XXXX/providers/Microsoft.AlertsManagement/actionRules/alert%20for%20rg
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y
Remove-AzResource : ResourceNotFound : The Resource 'Microsoft.AlertsManagement/actionRules/alert for rg' under resource gr
oup '<null>' was not found.
At line:1 char:1
+ Remove-AzResource -Name "alert for rg" -ResourceType Microsoft.Alerts ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : CloseError: (:) [Remove-AzResource], ErrorResponseMessageException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.RemoveAzureResourceCmdlet

Есть идеи, как от этого избавиться?

1 Ответ

0 голосов
/ 09 июня 2019

Я вижу это поведение, если мы не передаем ResourceGroupName в качестве входного параметра вместе с Remove-AzResource.

GetAzResource

RemoveAzResource-Error

Однако, если вы передадите ResourceGroupName, оно будет успешно выполнено. Пожалуйста, попробуйте это.

enter image description here

Дополнительная ссылка на документацию для удаления AlertRule.

Надеюсь, это поможет.

...