Skip to content

Resource IDs containing spaces can't be consumed by other az commands #12885

@mattcuk

Description

@mattcuk

I've been trying to use a command to list all the Logic App IDs which have an Alert set up for them. To do this, I'm running 2 commands; az resource list, and az resource show. However, since az resource list returns IDs that contain spaces, az resource show will then fail.

Command Name
az resource show --ids $(az resource list --resource-type Microsoft.Insights/metricAlerts --query [].id --output tsv) --query properties.scopes

Errors:
az resource: error: argument --ids: invalid ResourceId value: 'failed'

To Reproduce:

Create an alert against any Logic App.. make sure the Alert Name has a space in it, like 'logic-app-test-la failed'.

Run the command above.

Expected Behavior

It should really be able to handle the encoding of the spaces so that az resource show can ingest the result of az resource list without having to resort to a Bash script to work round the problem.

Environment Summary

Linux-4.15.0-1075-azure-x86_64-with-debian-stretch-sid
Python 3.6.5

azure-cli 2.2.0 *

Extensions:
interactive 0.4.4

Additional Context

Metadata

Metadata

Assignees

Labels

Service AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestneeds-team-attentionThis issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions