{"id":3597,"date":"2026-02-17T10:19:18","date_gmt":"2026-02-17T18:19:18","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sdk\/?p=3597"},"modified":"2026-02-17T10:19:18","modified_gmt":"2026-02-17T18:19:18","slug":"azd-jmespath-query-support","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sdk\/azd-jmespath-query-support\/","title":{"rendered":"JMESPath support comes to azd JSON output"},"content":{"rendered":"<h1>JMESPath support comes to azd JSON output<\/h1>\n<p><em>Now you can filter and transform azd JSON output using JMESPath queries<\/em><\/p>\n<hr \/>\n<h2>What&#8217;s new?<\/h2>\n<p>The Azure Developer CLI (<code>azd<\/code>) now supports <a href=\"https:\/\/jmespath.org\/\">JMESPath<\/a> queries on JSON output, including error messages. Pass <code>--query<\/code> to extract exactly what you need.<\/p>\n<h2>Why it matters<\/h2>\n<p>Being able to filter and transform JSON output directly in your terminal reduces the need for external tools or manual parsing, enhancing developer productivity. Whether you&#8217;re building scripts, automation, or need to inspect a specific part of your noisy config, JMESPath queries offer a simple solution right within the <code>azd<\/code> toolset.<\/p>\n<h2>How to use it<\/h2>\n<p>In <code>azd<\/code> versions 1.23.4 or later, <code>--query<\/code> can be used alongside <code>-o json<\/code>, but only with commands that return JSON output.<\/p>\n<h3>Examples<\/h3>\n<ol>\n<li>Show a subsection of the configuration:\n<pre><code>azd config show -o json --query \"template.sources\"<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<pre><code class=\"language-json\">{\r\n  \"awesome-azd\": {\r\n    \"key\": \"awesome-azd\",\r\n    \"location\": \"https:\/\/aka.ms\/awesome-azd\/templates.json\",\r\n    \"name\": \"Awesome AZD\",\r\n    \"type\": \"awesome-azd\"\r\n  }\r\n}<\/code><\/pre>\n<\/li>\n<li>Get the default environment name in a script:\n<pre><code>ENV_NAME=$(azd env list -o json --query \"[?IsDefault].Name | [0]\")\r\necho \"Deploying to $ENV_NAME\"<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<pre><code>production<\/code><\/pre>\n<\/li>\n<li>In <code>azd<\/code> versions 1.23.5 or later, you can extract error messages in automation. For example, when not authenticated and running this command:\n<pre><code>azd auth token -o json --query \"data.message\"<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<pre><code>\"\\nERROR: not logged in, run `azd auth login` to login\\n\"<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>Explore more query options in the <a href=\"https:\/\/jmespath.org\/tutorial.html\">JMESPath documentation<\/a>.<\/p>\n<h2>Feedback<\/h2>\n<p>Questions or ideas? <a href=\"https:\/\/github.com\/Azure\/azure-dev\/issues\">File an issue<\/a> or <a href=\"https:\/\/github.com\/Azure\/azure-dev\/discussions\">start a discussion<\/a>. Want to help shape <code>azd<\/code>? <a href=\"https:\/\/aka.ms\/azd-user-research-signup\">Sign up for user research<\/a>.<\/p>\n<hr \/>\n<p><em>Introduced in <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/6664\">PR #6664<\/a>. Expanded in <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/6735\">PR #6735<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Run JMESPath queries on azd JSON output, including error messages.<\/p>\n","protected":false},"author":63456,"featured_media":3598,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[908,864],"class_list":["post-3597","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sdk","tag-azd","tag-azure-developer-cli"],"acf":[],"blog_post_summary":"<p>Run JMESPath queries on azd JSON output, including error messages.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/users\/63456"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/comments?post=3597"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3597\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media\/3598"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media?parent=3597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/categories?post=3597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/tags?post=3597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}