Skip to content
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

Custom domains settings drop after each deployment #1243

Closed
2 tasks
relounge opened this issue Jul 31, 2024 · 7 comments
Closed
2 tasks

Custom domains settings drop after each deployment #1243

relounge opened this issue Jul 31, 2024 · 7 comments
Labels
Needs: triage 🔍 Pending a first pass to read, tag, and assign

Comments

@relounge
Copy link

This issue is a: (mark with an x)

  • [x ] bug report -> please search issues before submitting
  • documentation issue or request
  • regression (a behavior that used to work and stopped in a new release)

Issue description

We're trying to work with .NET Aspire. We built a system on it and now try to deploy it from github via GitHub Actions to Azure. We did everything as in the instructions and it worked. But One thing started to annoy critically. Every time we deploy the new version - custom domain settings are just gone. The same is about Ingress settings. My changes drop after each release.

Steps to reproduce

  1. Deploy .NET Aspire app via GitHub Actions
  2. Set up custom domains
  3. Deploy again

Expected behavior
New version is running but previous network and domains settings are the same

Actual behavior
Ingress settings of the app and custom domain settings are dropped.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 Pending a first pass to read, tag, and assign label Jul 31, 2024
@simonjj
Copy link
Collaborator

simonjj commented Jul 31, 2024

@relounge thank you for raising this with us. Could you share the repo or Bicep you're using. The issue may need updating of the boilerplate Bicep to include the custom domain.

@simonjj
Copy link
Collaborator

simonjj commented Jul 31, 2024

Please see here for guidance on how you can add the custom domain to your Bicep file (found in infra/resources). https://learn.microsoft.com/en-us/azure/templates/microsoft.app/containerapps?pivots=deployment-language-bicep#customdomain

@relounge
Copy link
Author

relounge commented Aug 1, 2024

@simonjj sorry, I cannot share the repo as it's our production repo. As for the Bicep file - I did not have it until you mentioned it. I deployed our aspire app using the instructions I found in the MS documentation and used this file as a workflow file for Github actions.
Then I started digging and found "next-steps.md" file. As I understand I need to run "azd infra synth" to generate 3 infra files including the one you mentioned and set it up, right? I must confess I never worked with Bicep and when I looked into resources.bicep file I didn't understand how to set up custom domains. I also noticed other created files after "synth" command in the AppHost project inside "infra". All of the files are yaml. Still not sure how it works, but we'll try to set it up, deploy and see what happens next

@relounge
Copy link
Author

relounge commented Aug 1, 2024

I don't get it. All of the examples here are in Bicep/JSON or Terraform syntax, but the files generated for containerized services by "synth" command were yaml files. This adds a bit of complexity. Will try to guess how it works

@relounge
Copy link
Author

relounge commented Aug 1, 2024

So I:

  • ran "azd infra synth" command and got bicep and yaml files in return
  • modified the services with domian bindings I needed (I hope it was correct)
  • added those new files to the repo and ran the deployement again
    ...and nothing has changed.

Here is how I changed the service yaml file:
ingress:
external: true
targetPort: {{ targetPortOrDefault 8080 }}
transport: http
allowInsecure: true
customDomains:
- bindingType: SniEnabled
certificateId: [ here I added the certificate name (not id) I found in azure]
name: [ here I added my domain]

I think I need some help. We choose Aspire to get rid of docker files hell. Now I see we got bicep and yaml hell instead.

@relounge
Copy link
Author

relounge commented Aug 1, 2024

Found a solution for custom domains from here Azure/azure-dev#1765
This command helped: azd config set alpha.aca.persistDomains on

Removed everything about costom domains from yaml files and set ingress external to true. It seems to be working now. I didn't have to do any manula settings after the latest deployment.

@relounge relounge closed this as completed Aug 1, 2024
@simonjj
Copy link
Collaborator

simonjj commented Aug 1, 2024

thanks for updating us @relounge. i will share your feedback with the appropriate teams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: triage 🔍 Pending a first pass to read, tag, and assign
Projects
None yet
Development

No branches or pull requests

2 participants