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

Make Azure location configurable #476

Merged
merged 7 commits into from
May 27, 2024
Merged

Conversation

tjementum
Copy link
Member

@tjementum tjementum commented May 24, 2024

Summary & Motivation

Remove the hardcoded West Europe location when deploying Azure resources, making the location configurable using GitHub variables. This change allows for more flexible and dynamic deployment configurations and addresses the AKSCapacityError triggered by the West Europe region running out of capacity for Azure Container Apps.

Include a curated list of Azure Data Centers with names and acronyms that can be used for naming Azure resources (e.g., EastUs/eus and Germany West Central/gwc).

Update the GitHub configuration to support different Azure subscriptions, splitting the Azure Service Principal used for deploying resources into separate ones for Staging and Production. This enhances security and management of deployment environments.

Grant the Service Principal for Staging and Production different permissions, e.g., only the Staging Service Principal can be used when detecting changes to infrastructure on pull requests, while the Production Service Principal can only be used when triggered from the main branch.

Remove deployment bash scripts like production-west-europe.sh, consolidating all configurations into GitHub variables. This includes moving soft secrets like TENANT_ID and SERVICE_PRINCIPAL_ID to the variables page. Now there are 2 shared variables (TENANT_ID and UNIQUE_PREFIX), 5 environment variables (like PRODUCTION_SUBSCRIPTION_ID, PRODUCTION_SERVICE_PRINCIPAL_ID, PRODUCTION_SHARED_LOCATION, PRODUCTION_SQL_ADMIN_OBJECT_ID, and PRODUCTION_DOMAIN_NAME), and 3 cluster variables (like PRODUCTION_CLUSTER1_LOCATION, PRODUCTION_CLUSTER1_LOCATION_ACRONYM, and PRODUCTION_CLUSTER1_ENABLED). The ENABLED flag defaults to true for the Staging environment and false for the Production environment.

Extract a reusable GitHub workflow for deploying infrastructure, making adding new clusters as simple as duplicating one job in the cloud-infrastructure.yml file and _deploy-container.yml and adding 3 GitHub variables like PRODUCTION_CLUSTER2_LOCATION, PRODUCTION_CLUSTER2_LOCATION_ACRONYM, and PRODUCTION_CLUSTER2_ENABLED.

Major update to the configure-continuous-deployments CLI command to collect the new information, making it more resilient to errors. It will no longer continue triggering GitHub actions if the previous workflow failed, and in case of errors, a clear message will be shown. Additionally, on success, it will now report how long the full deployment took.

Checklist

  • I have added a Label to the pull-request
  • I have added tests, and done manual regression tests
  • I have updated the documentation, if necessary

@tjementum tjementum added the Enhancement New feature or request label May 24, 2024
@tjementum tjementum self-assigned this May 24, 2024
@tjementum tjementum force-pushed the make-azure-location-configurable branch from ed60aab to 59cd7ac Compare May 24, 2024 19:50
@tjementum tjementum force-pushed the make-azure-location-configurable branch 2 times, most recently from f8c1485 to 61a3f38 Compare May 24, 2024 20:18
@tjementum tjementum force-pushed the make-azure-location-configurable branch from 61a3f38 to 2228010 Compare May 24, 2024 20:23
@tjementum tjementum force-pushed the make-azure-location-configurable branch 13 times, most recently from cef2545 to 6c88c59 Compare May 27, 2024 10:04
tjementum added 2 commits May 27, 2024 17:28
…rces to accept location as a parameter, deleting preconfigured scripts for West Europe
…, removing hardcoded West Europe location, making it configurable with GitHub environment variables
@tjementum tjementum force-pushed the make-azure-location-configurable branch from 6c88c59 to fa809bc Compare May 27, 2024 16:03
tjementum added 2 commits May 27, 2024 18:05
…cated configuration and prepare for easy addition of additional clusters
@tjementum tjementum force-pushed the make-azure-location-configurable branch from fa809bc to d156527 Compare May 27, 2024 16:10
@tjementum tjementum force-pushed the make-azure-location-configurable branch from c78689a to ae7f611 Compare May 27, 2024 19:24
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@tjementum tjementum marked this pull request as ready for review May 27, 2024 19:29
@tjementum tjementum requested a review from a team as a code owner May 27, 2024 19:29
@tjementum tjementum merged commit 4e58349 into main May 27, 2024
16 checks passed
@tjementum tjementum deleted the make-azure-location-configurable branch May 27, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants