-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
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