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

Merging into one branch causes all environments to restart #1880

Closed
angela-tran opened this issue Feb 7, 2024 · 3 comments · Fixed by #2111
Closed

Merging into one branch causes all environments to restart #1880

angela-tran opened this issue Feb 7, 2024 · 3 comments · Fixed by #2111
Assignees
Labels
actions Related to GitHub Actions workflows bug Something isn't working infrastructure Terraform, Azure, etc.

Comments

@angela-tran
Copy link
Member

angela-tran commented Feb 7, 2024

The expected behavior is for only the environment corresponding to the branch to restart.

See Slack discussions:

We want to avoid restarting the app when it's not necessary, since it can sometimes cause a little bit of downtime.

@angela-tran angela-tran added the bug Something isn't working label Feb 7, 2024
@angela-tran
Copy link
Member Author

This is from the Slack thread, but gonna put here too:

Maybe it would be better to have the deploy GitHub workflow tell Azure to restart the specific app service
This section has somewhat of an example: https://learn.microsoft.com/en-us/azure/app-service/app-service-sql-github-actions#build-push-and-deploy-your-image

@angela-tran
Copy link
Member Author

Looked briefly into what we'd need to use the Azure Login action, but I don't have access to Microsoft Entra ID in the CDT directory so currently cannot make any progress on that

@thekaveman
Copy link
Member

thekaveman commented May 21, 2024

I think we can use the azure/webapps-deploy action step with a Publish Profile per environment, avoiding the need to authenticate with a service principal and getting involved with Microsoft Entra ID.

Plan so far

dev

  • Turn off webhook deploys (e.g. the Container Registry option) in the Azure App Service "Deployment Center"; instead choose the GitHub Actions option
  • Fill in details for GitHub Actions deploy; don't generate a workflow file, we'll use the existing one
    image
  • Create an environment variable to hold the name of the Azure App Service, AS-CDT-PUB-VIP-CALITP-D-001
  • Create an environment secret to hold the contents of the Publish Profile for this App Service
  • Add a step in the deploy workflow that uses azure/webapps-deploy with the above config
  • Deactivate the webhooks for dev, test, and prod

See #2111 for post-merge follow-up steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions Related to GitHub Actions workflows bug Something isn't working infrastructure Terraform, Azure, etc.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants