Added terraform for SQL Managed Instance #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy MessageQueueProcessor to Dev | |
| on: | |
| push: | |
| branches: | |
| - CI | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| terraform: | |
| runs-on: windows-latest | |
| environment: dev | |
| name: 'Terraform MessageQueueProcessor' | |
| env: | |
| ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_wrapper: false # Skip wrapper script installation | |
| - name: 'Terraform init' | |
| id: init | |
| run: | | |
| cd LearningHub.Nhs.MessageQueueProcessor/Terraform | |
| terraform init "-backend-config=backend-dev.tfvars" | |
| - name: 'Terraform apply' | |
| id: apply | |
| run: | | |
| cd LearningHub.Nhs.MessageQueueProcessor/Terraform | |
| terraform apply -auto-approve ` | |
| -var="ResourceGroupName=${{ vars.AZURE_RESOURCE_GROUP_NAME }}" ` | |
| -var="ResourceGroupLocation=${{ vars.AZURE_RESOURCE_GROUP_LOCATION }}" ` | |
| -var="SqlmiName=${{ vars.SQLMI_NAME }}" ` | |
| -var="SQLAdministratorLogin=${{ vars.SQL_ADMINISTRATOR_LOGIN }}" ` | |
| -var="SQLAdministratorLoginPassword=${{ secrets.SQL_ADMINISTRATOR_LOGIN_PASSWORD }}" ` | |
| -var="SQLSkuName=${{ vars.SQL_SKU_NAME }}" ` | |
| -var="SQLStorageSize=${{ vars.SQL_STORAGE_SIZE }}" ` | |
| -var="SQLVcores=${{ vars.SQL_VCORES }}" ` | |
| -var="Environment=Development" | |
| build_and_deploy: | |
| needs: terraform | |
| runs-on: windows-latest | |
| environment: dev | |
| name: 'Build and deploy the MessageQueueProcessor' | |
| env: | |
| AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Add Azure artifact | |
| run: dotnet nuget add source 'https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json' --name 'LearningHubFeed' --username 'colin.beeby' --password ${{ secrets.AZURE_DEVOPS_PAT }} --store-password-in-clear-text | |
| - name: Restore dependencies | |
| run: | | |
| cd LearningHub.Nhs.MessageQueueProcessor | |
| dotnet restore | |
| - name: Build project | |
| run: dotnet build | |
| - name: Publish Project | |
| run: dotnet publish --configuration Development --output ./publish | |
| # - name: Deploy to Azure Function App | |
| # uses: Azure/Functions-action@v1 | |
| # with: | |
| # app-name: 'MessageQueueProcessorApp' | |
| # package: './publish' | |
| # publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} |