{"id":3730,"date":"2026-04-20T17:38:49","date_gmt":"2026-04-21T00:38:49","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sdk\/?p=3730"},"modified":"2026-04-20T17:38:49","modified_gmt":"2026-04-21T00:38:49","slug":"azd-copilot-integration","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sdk\/azd-copilot-integration\/","title":{"rendered":"GitHub Copilot meets Azure Developer CLI: AI-assisted project setup and error troubleshooting"},"content":{"rendered":"<p>The Azure Developer CLI (<code>azd<\/code>) now integrates with GitHub Copilot in two ways: AI-assisted project scaffolding during <code>azd init<\/code> and intelligent error troubleshooting when commands fail. Both features keep you in the terminal and use Copilot&#8217;s reasoning to reduce manual work.<\/p>\n<h2>Prerequisites<\/h2>\n<p>To use these features, you need:<\/p>\n<ul>\n<li><strong>azd 1.23.11 or later<\/strong>\u2014Run <code>azd version<\/code> to check, or <code>azd update<\/code> to get the latest<\/li>\n<li><strong>GitHub Copilot access<\/strong>\u2014An active GitHub Copilot subscription (Individual, Business, or Enterprise)<\/li>\n<li><strong>GitHub CLI (<code>gh<\/code>)<\/strong>\u2014<code>azd<\/code> automatically checks and prompts for login if needed<\/li>\n<\/ul>\n<h2>Copilot-powered project setup with <code>azd init<\/code><\/h2>\n<p>Running <code>azd init<\/code> now presents a &#8220;Set up with GitHub Copilot (Preview)&#8221; option. Select it, and Copilot analyzes your codebase to scaffold the project, which includes: generating <code>azure.yaml<\/code>, infrastructure templates, and deployment configuration based on your code&#8217;s language, framework, and dependencies.<\/p>\n<p>This approach works whether you&#8217;re starting fresh or bringing an existing app to Azure. Building a new project? Copilot can help you create it from scratch with the right Azure infrastructure. Have an existing project you want to deploy? Copilot can analyze your codebase and generate the configuration needed to deploy it with <code>azd<\/code> with no need to rewrite or restructure your project.<\/p>\n<p>Before making any changes, the flow runs preflight checks. It verifies your git working directory is clean so no uncommitted work is at risk. It also prompts for Model Context Protocol (MCP) server tool consent upfront, so you know exactly what Copilot can access before it starts.<\/p>\n<p>To use Copilot-powered init:<\/p>\n<pre><code class=\"language-bash\">azd init\r\n# Select: \"Set up with GitHub Copilot (Preview)\"<\/code><\/pre>\n<p>The Copilot agent examines your project structure, proposes an <code>azure.yaml<\/code> configuration, and generates the necessary infrastructure files. You review and approve the changes before anything is written to disk.<\/p>\n<h3>Example: scaffolding a Node.js app<\/h3>\n<p>Say you have an Express API with a <code>package.json<\/code>, a <code>src\/<\/code> directory, and a PostgreSQL dependency. Normally you&#8217;d need to:<\/p>\n<ol>\n<li>Reference the docs to determine the right <code>host<\/code> type (Container App vs App Service vs Function)<\/li>\n<li>Write an <code>azure.yaml<\/code> with the correct <code>language<\/code>, <code>host<\/code>, and <code>build<\/code> settings<\/li>\n<li>Author Bicep modules for the app, the database, and any networking<\/li>\n<\/ol>\n<p>With Copilot-powered init, Copilot detects your Express framework and PostgreSQL dependency, then generates the <code>azure.yaml<\/code>, a Bicep module for Azure Container Apps, and a Bicep module for Azure Database for PostgreSQL, which is then ready for you to review.<\/p>\n<h2>AI-assisted error troubleshooting<\/h2>\n<p>Deployment errors happen. A missing parameter, a permissions issue, a misconfigured resource, and, in these cases, the error message doesn&#8217;t always make the fix obvious.<\/p>\n<h3>Troubleshooting with and without Copilot<\/h3>\n<p>Without Copilot, when <code>azd provision<\/code> or <code>azd up<\/code> fails, the steps to fix it look something like this:<\/p>\n<ol>\n<li>Copy the error message from the terminal<\/li>\n<li>Search Azure docs or Stack Overflow for the error code<\/li>\n<li>Read through troubleshooting guides to find the relevant fix<\/li>\n<li>Run one or more <code>az<\/code> CLI commands to apply the fix<\/li>\n<li>Rerun the original <code>azd<\/code> command and hope it works<\/li>\n<\/ol>\n<p>With Copilot, <code>azd<\/code> can handle that loop for you. When any <code>azd<\/code> command fails, it offers an interactive troubleshooting flow powered by Copilot. You can jump straight to a fix or explore the error first. You choose from four options:<\/p>\n<ul>\n<li><strong>Explain<\/strong>\u2014Get a plain-language explanation of what went wrong<\/li>\n<li><strong>Guidance<\/strong>\u2014Receive step-by-step instructions to fix the issue<\/li>\n<li><strong>Diagnose and Guide<\/strong>\u2014Get troubleshooting steps on what happened, why the error happened, and how to fix it. Let Copilot apply a fix (with your approval), then optionally retry the failed command<\/li>\n<li><strong>Skip<\/strong>\u2014Dismiss and handle it yourself<\/li>\n<\/ul>\n<p>The troubleshooting runs entirely in your terminal. There&#8217;s no need to switch to a browser, search docs, or paste error messages into a chat window. Copilot has context about your project configuration, the command that failed, and the error details, so its suggestions are specific to your situation.<\/p>\n<h3>Set a default error handling behavior<\/h3>\n<p>If you find yourself always choosing the same option, you can skip the interactive prompt by setting a default with <code>azd config<\/code>:<\/p>\n<pre><code class=\"language-bash\">azd config set copilot.errorHandling.category troubleshoot<\/code><\/pre>\n<p>Available values for <code>copilot.errorHandling.category<\/code>:<\/p>\n<table>\n<thead>\n<tr>\n<th>Value<\/th>\n<th>Behavior<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>explain<\/code><\/td>\n<td>Automatically get a plain-language explanation<\/td>\n<\/tr>\n<tr>\n<td><code>guidance<\/code><\/td>\n<td>Automatically get step-by-step fix instructions<\/td>\n<\/tr>\n<tr>\n<td><code>troubleshoot<\/code><\/td>\n<td>Automatically diagnose and guide<\/td>\n<\/tr>\n<tr>\n<td><code>fix<\/code><\/td>\n<td>Automatically apply a fix<\/td>\n<\/tr>\n<tr>\n<td><code>skip<\/code><\/td>\n<td>Always skip Copilot troubleshooting<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>You can also enable auto-fix and retry, so Copilot applies the fix and reruns the failed command automatically:<\/p>\n<pre><code class=\"language-bash\">azd config set copilot.errorHandling.fix allow<\/code><\/pre>\n<p>To reset to the default interactive prompt, unset the config:<\/p>\n<pre><code class=\"language-bash\">azd config unset copilot.errorHandling.category<\/code><\/pre>\n<h3>Common Azure deployment errors where Copilot helps<\/h3>\n<p>Here are a few common Azure errors that developers run into and how Copilot-assisted troubleshooting turns a wall of text into an actionable fix.<\/p>\n<h4><code>MissingSubscriptionRegistration<\/code>\u2014resource provider not registered<\/h4>\n<p>A first-time deployment to a subscription often fails with:<\/p>\n<pre><code>ERROR: deployment failed: MissingSubscriptionRegistration:\r\nThe subscription is not registered to use namespace 'Microsoft.App'.<\/code><\/pre>\n<p>Azure requires resource providers to be registered before you can create certain resource types. If this Container App deployment is the first deployment in a given subscription, <code>Microsoft.App<\/code> isn&#8217;t registered yet. Copilot&#8217;s <strong>Troubleshoot<\/strong> option can register the provider for you and run the deployment automatically.<\/p>\n<h4><code>SkuNotAvailable<\/code> \/ <code>OperationNotAllowed<\/code>\u2014SKU or quota limits<\/h4>\n<p>You pick a region and hit:<\/p>\n<pre><code>ERROR: deployment failed: SkuNotAvailable:\r\nThe requested VM size 'Standard_D2s_v3' is not available in location 'westus'.<\/code><\/pre>\n<p>Or a quota variant:<\/p>\n<pre><code>ERROR: deployment failed: OperationNotAllowed:\r\nOperation results in exceeding quota limits of Core.\r\nMaximum allowed: 4, Current in use: 4, Additional requested: 2.<\/code><\/pre>\n<p>These errors are common when a region is capacity-constrained or your subscription hits its vCPU limit. Copilot&#8217;s <strong>Explain<\/strong> option clarifies which SKU or quota is blocked, and <strong>Guidance<\/strong> suggests alternative regions or Virtual Machine (VM) sizes that are available or shows you how to request a quota increase.<\/p>\n<h4><code>StorageAccountAlreadyTaken<\/code>\u2014globally unique name collision<\/h4>\n<pre><code>ERROR: deployment failed: StorageAccountAlreadyTaken:\r\nThe storage account named 'myappstorage' is already taken.<\/code><\/pre>\n<p>Storage account names must be unique across all of Azure. Copilot suggests updating your Bicep parameter or <code>azure.yaml<\/code> environment variable with a unique name, often by appending your environment name or a random suffix, and then retrying the deployment.<\/p>\n<h2>What&#8217;s next<\/h2>\n<p>This integration is just the beginning of Copilot features in <code>azd<\/code>. The team is working on deeper agent capabilities including Copilot-assisted infrastructure customization and smarter multi-service orchestration. If you want to influence what gets built next, <a href=\"https:\/\/aka.ms\/azd-user-research-signup\">sign up for user research<\/a>, reach out to us by filing an issue, or start a discussion in the repo.<\/p>\n<h2>Try it out<\/h2>\n<p>To check your current version, run:<\/p>\n<pre><code class=\"language-bash\">azd version<\/code><\/pre>\n<p>To update to the latest version:<\/p>\n<pre><code class=\"language-bash\">azd update<\/code><\/pre>\n<p>For a fresh install, see <a href=\"https:\/\/learn.microsoft.com\/azure\/developer\/azure-developer-cli\/install-azd\">Install azd<\/a>. For more details on the March 2026 release, read the <a href=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/azure-developer-cli-azd-march-2026\/\">full release blog post<\/a>.<\/p>\n<h2>Feedback<\/h2>\n<p>Have questions or ideas? File an issue or start a discussion on <a href=\"https:\/\/github.com\/Azure\/azure-dev\">GitHub<\/a>. Want to help shape the future of <code>azd<\/code>? <a href=\"https:\/\/aka.ms\/azd-user-research-signup\">Sign up for user research<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Azure Developer CLI (azd) now integrates with GitHub Copilot for AI-assisted project scaffolding and intelligent deployment error troubleshooting, helping you resolve common Azure errors like MissingSubscriptionRegistration, SkuNotAvailable, and StorageAccountAlreadyTaken without leaving the terminal.<\/p>\n","protected":false},"author":107449,"featured_media":3732,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[908,973,864,947,975,972,791,974],"class_list":["post-3730","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sdk","tag-azd","tag-azure-deployment","tag-azure-developer-cli","tag-bicep","tag-copilot-agent","tag-github-copilot","tag-infrastructure-as-code","tag-troubleshooting"],"acf":[],"blog_post_summary":"<p>The Azure Developer CLI (azd) now integrates with GitHub Copilot for AI-assisted project scaffolding and intelligent deployment error troubleshooting, helping you resolve common Azure errors like MissingSubscriptionRegistration, SkuNotAvailable, and StorageAccountAlreadyTaken without leaving the terminal.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3730","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\/107449"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/comments?post=3730"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3730\/revisions"}],"predecessor-version":[{"id":3731,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3730\/revisions\/3731"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media\/3732"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media?parent=3730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/categories?post=3730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/tags?post=3730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}