dotnet / docs-aspire

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

.NET 8 Aspire GitHub Actions to just deploy to existing Azure resources. Do not provision #1117

Open vishipayyallore opened 2 weeks ago

vishipayyallore commented 2 weeks ago

Describe the issue or suggestion

Team, I was trying the .NET 8 Aspire GitHub actions. It was working when we have single job. I wanted to split into three jobs, that is when it started failing.

Error Message:

Run azd deploy --environment dev --no-prompt
Analyzing Aspire Application (this might take a moment...)

Deploying services (azd deploy)

Deploying service apiservice
Deploying service apiservice (Logging in to registry)
Deploying service apiservice (Pushing container image)
Deploying service apiservice (Updating container app)
  (x) Failed: Deploying service apiservice

ERROR: failed deploying service 'apiservice': failed executing template file: template: containerApp.tmpl.yaml:2:[1](https://github.com/ViswanathaSwamy-PK-TechSkillz-Academy/simple-dotnet-aspire/actions/runs/9551637934/job/26326472684#step:9:1)7: executing "containerApp.tmpl.yaml" at <.Env.AZURE_LOCATION>: map has no entry for key "AZURE_LOCATION"

GitHub URL: https://github.com/ViswanathaSwamy-PK-TechSkillz-Academy/simple-dotnet-aspire

image

image

davidfowl commented 2 weeks ago

cc @vhvb1989

vishipayyallore commented 2 weeks ago

@vhvb1989 CC: @davidfowl Victor, Thank you so much. Your updated code works. One small change I made was added --no-prompt. Many thanks.

      - name: Refresh azd env (pulls latest infrastructure provision)
        run: azd env refresh --no-prompt
        env:
          AZURE_LOCATION: ${{ env.AZURE_LOCATION }}

image

vhvb1989 commented 2 weeks ago

@vishipayyallore Yeah, since the provision and deploy operations are happening in separated stages, the azd env refresh is required there to make the connection. :)

vishipayyallore commented 2 weeks ago

@vishipayyallore Yeah, since the provision and deploy operations are happening in separated stages, the azd env refresh is required there to make the connection. :)

Really appreciate your help Sir @vhvb1989 .

davidfowl commented 2 weeks ago

@vhvb1989 Do we need to update docs?