https://github.com/felsokning/automation-server
The Terraform Pipeline Used to Deploy the Octopus Deploy Server to Azure via Azure Container Group.
https://github.com/felsokning/automation-server
Last synced: 2 months ago
JSON representation
The Terraform Pipeline Used to Deploy the Octopus Deploy Server to Azure via Azure Container Group.
- Host: GitHub
- URL: https://github.com/felsokning/automation-server
- Owner: felsokning
- License: agpl-3.0
- Created: 2025-01-19T18:09:55.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-19T18:44:10.000Z (4 months ago)
- Last Synced: 2025-01-19T19:28:49.298Z (4 months ago)
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# automation-server
The Terraform Pipeline Used to Deploy the Octopus Deploy Server to Azure via Azure Container Group.🄯 2025 Felsökning/Felsokning. All rights reserved.
# TODO:
- Need to implement optional state file storage in an Azure Storage Account
* Terraform state is only being maintained via files generated from the process and stored in this root folder (ignored in `.gitignore`).
* State will be important for production scenarios.
- Need to investigate using Traefik (replacing NGINX), given they can retrive certificates from Let's Encrypt.
* This will deprecate the certificate steps; so not a small change.# Cost Implications
Deploying an Octopus Deploy Server via this means costs an average of 3.24SEK/day (or €0.03/day); however, the larget cost implications will come from the SQL Server.
## SQL SKU
The SQL SKU can be changed/modified to reduce the costs of the SQL server.- vCore: https://learn.microsoft.com/en-us/azure/azure-sql/database/resource-limits-vcore-single-databases?view=azuresql
- DTU: https://learn.microsoft.com/en-us/azure/azure-sql/database/resource-limits-dtu-single-databases?view=azuresql# Building Your Own Octopus Deploy Server in Azure with this Terraform definition
These are the steps required to build your own Octopus Deploy Server in Azure using this pipeline.## Azure Subscription
You will need a subscription in Azure to target the deployments against.## Execution Context
You will need to use a docker container that contains all of the tools (e.g.: az cli, docker, etc.) to perform the deployment. You can also use a GitHub Runner or you own local machine.At minimum, you will need:
- Terraform 1.10.4
* Used to run the terraform commands
- az cli (any version)
* Used to login to Azure and for the file-copy operations
- docker cli (any version)
* Used to pull docker images from docker hub and push them to the ACR (Azure Container Registry)
- openssl
* Used to create a certificate request - and then used to create a self-signed certificate, based on the certificate request.### Docker Container
I provide worker-tools docker containers that can used for this scenario.To use the container that I publish, run `.\Load-WorkerToolsContainer.ps1` in PowerShell from this repository's root folder.
This is a screenshot showing the process.

## Terraform Process
### TFVars Files
You will need to create a tfvars file that contains values for all of the variables.### Terraform Init
You will need to run `terraform init -upgrade` to download the providers.### Terraform Plan
To plan the changes, run `terraform plan --var-file -out plan.tfplan`, or whatever you want to call the out-file.### Terraform Apply
To apply the changes, using the plan created above, run `terraform apply "plan.tfplan"` and this will immediately start the apply process.### Terraform Destory
To remove all of the changes that terraform applies, first plan the destructive actions `terraform plan --var-file -destroy -out plan.destroy.tfplan`, and then apply the destructive actions `terraform apply "plan.destroy.tfplan"`.