dotnet / docs-aspire

This repository contains .NET Aspire documentation.
https://learn.microsoft.com/dotnet/aspire
MIT License
65 stars 70 forks source link

Issue in documentation for Deploying Aspire via AZDO #983

Open joseph-hungerman opened 1 month ago

joseph-hungerman commented 1 month ago

I am attempting to deploy an Aspire app to Azure. I followed the documentation and everything went as expected until I reached the provisioning step of the Pipeline. I get an error back that says: ERROR: no project exists; to create a new project, run azd init. I ran this command as stated within the documentation, which creates a set of documents that are ignored by the repo. I am assuming this config is set within the connection of the pipeline workflow and creating the pipeline using bicep. I tried running the following pwsh command, but there is a prompt to continue that has no default, so this option didn't work. I then tried exposing the .azure folder to git and that didn't work either. Some help troubleshooting this would be great. I would also expect this to be covered within the documentation.

- pwsh: | azd init --environment $(AZURE_ENV_NAME) --location $(AZURE_LOCATION) --subscription $(AZURE_SUBSCRIPTION_ID) --from-code --no-prompt

alexwolfmsft commented 1 month ago

Hello, if you run azd pipeline config before azd init it does produce the error "no project exists; to create a new project, run azd init". Did you try to run azd init before you run azd pipeline config after creating a new starter project? To complete the default flow of the tutorial you shouldn't have to run azd init with any parameters.

joseph-hungerman commented 1 month ago

This isn't for the starter project, this is for a real world project. I have 4 environments (test, dev, stg, \?\$\?\@). My command workflow:

  1. azd init (set environment to Testing during prompt) a. This created a bunch of hidden files in the .azure folder with a .gitignore for all of them Screenshot 2024-05-30 092520

  2. Created azure-dev.yml as described Screenshot 2024-05-30 092641

  3. azd pipeline config --provider azdo (set to my org with PAT)

  4. Pipeline was created in AZDO with variables, resulting file created by azd in AZDO: `trigger:

    • feature/*

pool: vmImage: ubuntu-latest

steps:

ERROR: no project exists; to create a new project, run azd init

[error]Script failed with exit code: 1

/usr/bin/az account clear Finishing: Provision Infrastructure

joseph-hungerman commented 1 month ago

Another annoyance: AZD_INITIAL_ENVIRONMENT_CONFIG is set to secret when the pipeline is pushed to my project. I can't validate whether anything in this variable is correct. This would be less problematic if it was pushed as a normal var and let the user set it as secret. Once it's a secret it can't be viewed.

IEvangelist commented 1 week ago

Hey @alexwolfmsft - any chance you could look into this one?