Discover how to efficiently filter JSON output in Azure CLI commands using the ‘–query’ argument, optimizing data retrieval and command chaining for enhanced productivity in Azure administration.
Table of Contents
Question
Most Azure commands return JSON by default. Sometimes this dataset can be large, which makes it difficult to read and tricky to use the result of one command as input to another command. What can you use with Azure CLI to filter the results to get only the data that you need?
A. You can use the ‘–query’ argument.
B. You can use the ‘–filter’ argument.
C. You can pipe the results to a JSON parsing utility and use filtering capability there.
Answer
A. You can use the ‘–query’ argument.
Explanation
All Azure commands support the ‘–query’ argument, which lets you select the useful data in any Azure command response.
B is incorrect. Azure CLI doesn’t have a ‘–filter’ argument.
C is incorrect. This might work, but is more complex than using Azure CLI’s built-in query support.
Microsoft Azure Administrator AZ-104 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Azure Administrator AZ-104 exam and earn Microsoft Azure Administrator AZ-104 certification.