Open joseph-hungerman opened 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.
This isn't for the starter project, this is for a real world project. I have 4 environments (test, dev, stg, \?\$\?\@). My command workflow:
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
Created azure-dev.yml as described
azd pipeline config --provider azdo (set to my org with PAT)
Pipeline was created in AZDO with variables, resulting file created by azd in AZDO: `trigger:
pool: vmImage: ubuntu-latest
steps:
task: setup-azd@0 displayName: Install azd
pwsh: |
azd config set auth.useAzCliAuth "true"
displayName: Configure azd
to Use AZ CLI Authentication.
task: Bash@3 displayName: Install .NET Aspire workload inputs: targetType: 'inline' script: | dotnet workload install aspire
task: AzureCLI@2 displayName: Provision Infrastructure inputs: azureSubscription: azconnection scriptType: bash scriptLocation: inlineScript inlineScript: | azd provision --no-prompt --no-state --environment $(AZURE_ENV_NAME) env: AZD_INITIAL_ENVIRONMENT_CONFIG: $(AZD_INITIAL_ENVIRONMENT_CONFIG) AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID) AZURE_ENV_NAME: $(AZURE_ENV_NAME) AZURE_LOCATION: $(AZURE_LOCATION)
task: AzureCLI@2 displayName: Deploy Application inputs: azureSubscription: azconnection scriptType: bash scriptLocation: inlineScript inlineScript: | azd deploy --all --no-prompt --environment Testing env: AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID) AZURE_ENV_NAME: $(AZURE_ENV_NAME) AZURE_LOCATION: $(AZURE_LOCATION) ASPNETCORE_ENVIRONMENT: $(AZURE_ENV_NAME)`
ERROR: no project exists; to create a new project, run azd init
/usr/bin/az account clear Finishing: Provision Infrastructure
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.
Hey @alexwolfmsft - any chance you could look into this one?
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