Skip to content

Add troubleshooting guidance for Azure DevOps pipeline "azd init" errors #3853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 18, 2025

This PR addresses a common issue where users encounter "ERROR: no project exists; to create a new project, run azd init" when deploying .NET Aspire projects via Azure DevOps pipelines.

Problem

Users following the Azure DevOps deployment documentation experience pipeline failures during the provisioning step because azd init generates files (azure.yaml and .azure folder) that are typically not committed to repositories. When pipelines run in clean environments, these files don't exist, causing azd commands to fail.

Solution

Added comprehensive troubleshooting documentation that provides:

  1. Root cause explanation - Why the error occurs in CI/CD environments
  2. Recommended solution - Running azd init in the pipeline with proper flags:
    - task: AzureCLI@2
      displayName: 'Initialize Azure Developer CLI'
      inputs:
        azureSubscription: '$(AZURE_SERVICE_CONNECTION)'
        scriptType: 'bash'
        scriptLocation: 'inlineScript'
        inlineScript: |
          azd init --from-code --no-prompt
          azd env new $(AZURE_ENV_NAME) --location $(AZURE_LOCATION) --subscription $(AZURE_SUBSCRIPTION_ID)
  3. Alternative approaches - Committing files to repository or using proper pipeline configuration
  4. Additional troubleshooting - Verification steps for common configuration issues

Changes Made

  • Added "Troubleshoot Azure DevOps pipeline deployment" section to aca-deployment-github-actions.md
  • Added proactive warning in pipeline configuration section with cross-reference to troubleshooting
  • Provided specific guidance for handling unexpected prompts and explained --from-code flag usage
  • Included security considerations for committing .azure folder contents

All changes follow the Microsoft Writing Style Guide and pass markdown linting.

Fixes #983.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/deployment/azure/aca-deployment-github-actions.md docs/deployment/azure/aca-deployment-github-actions

Copilot AI and others added 2 commits June 18, 2025 16:43
…sts" error

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
… prompts

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Issue in documentation for Deploying Aspire via AZDO Add troubleshooting guidance for Azure DevOps pipeline "azd init" errors Jun 18, 2025
@Copilot Copilot AI requested a review from IEvangelist June 18, 2025 16:45
Copilot finished work on behalf of IEvangelist June 18, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue in documentation for Deploying Aspire via AZDO
2 participants