This repository contains Terraform code and a configured CI/CD pipeline to deploy infrastructure on Azure for the StorageMailNotifier. The StorageMailNotifier is an Azure Function that triggers when a file is uploaded to a Blob Storage container, sending an email with the file information.
Ensure you have the following installed before proceeding:
To deploy the infrastructure locally, follow these steps:
-
Initialize Terraform:
terraform init
This command prepares your working directory for other Terraform commands.
-
Plan the Deployment:
terraform plan
This command displays the changes required by the current configuration. It provides a preview of what will be added, modified, or deleted in your infrastructure.
-
Apply the Deployment:
terraform apply
This command creates or updates the infrastructure. You will need to type
yes
and press enter to confirm the changes.
To deploy the infrastructure using the CI/CD pipeline, follow these steps:
-
Create Azure Credentials: Ensure you have created and configured your Azure credentials. This typically involves creating a service principal and setting the necessary environment variables (
AZURE_CLIENT_ID
,AZURE_TENANT_ID
,AZURE_SUBSCRIPTION_ID
). -
Modify Configuration: Edit the
resource_group.tf
file to specify the name of your Azure resource group. -
Pipeline Execution: The CI/CD pipeline configuration is set up to use these credentials and deploy the infrastructure. Ensure your pipeline is configured to use these environment variables and that it triggers on the necessary events (e.g., push to the main branch).
This project is licensed under the MIT License. See the LICENSE file for details.