Skip to content

Get-AzureRole does not respect -ErrorAction #124

@carlocardella

Description

@carlocardella

In my subscription I have a number of cloud services, a few of them don't have a deployment (just empty services).
If I try to collect info about the cloud service roles, even using -ErrorAction SilentlyContinue to not be blocked by the empty deployments, I still get a terminating error:

Get-AzureService | Get-AzureRole -ErrorAction SilentlyContinue

RoleName : EventSourceInfo.WebService
InstanceCount : 2
DeploymentID :
ServiceName :
OperationDescription : Get-AzureRole
OperationId :
OperationStatus : Succeeded

Get-AzureRole : ResourceNotFound: No deployments were found.
At line:1 char:20

  • Get-AzureService | Get-AzureRole -ErrorAction SilentlyContinue
  •                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-AzureRole], CloudException
    • FullyQualifiedErrorId : Microsoft.WindowsAzure.CloudException,Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureRoleCommand

Anyway if I use Get-AzureDeployment everything works as expected:

Get-AzureService | Get-AzureDeployment -ErrorAction SilentlyContinue | select DeploymentName

DeploymentName

deployment 1
deployment 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    ComputeService AttentionThis issue is responsible by Azure service team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions