Skip to content

If Set-AzureRmResource fails, script should continue #2

@benformosa

Description

@benformosa

An error such as this should not cause the script to stop:

VERBOSE: Starting RESOURCEID
VERBOSE:     Found 4 tags
Set-AzureRmResource : The pipeline has been stopped.
At Set-AzureRMResourceTag.ps1:87 char:21
+ ...             Set-AzureRmResource -ResourceId $AzureResource.ResourceID ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Set-AzureRmResource], PipelineStoppedException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.SetAzureResourceCmdlet

Set-AzureRmResource : OperationNotAllowed : Operation 'PUT' is not allowed on VM extension 'Microsoft.Insights.VMDiagnosticsSettings' since it is marked for deletion. You can only retry the Delete operation (or wait for an ongoing one to
complete).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions