From b4554716fa75821eceeaf0fd7db2c3bbd4622212 Mon Sep 17 00:00:00 2001 From: Frederic Wickert Date: Wed, 30 Oct 2024 13:33:34 +0100 Subject: [PATCH 1/3] Add Redis Cache resource to Bicep template --- src/InfrastructureAsCode/main.bicep | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/InfrastructureAsCode/main.bicep b/src/InfrastructureAsCode/main.bicep index d8e740d2..5de455d9 100644 --- a/src/InfrastructureAsCode/main.bicep +++ b/src/InfrastructureAsCode/main.bicep @@ -29,6 +29,20 @@ resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-12 } } +resource redisCache 'Microsoft.Cache/Redis@2020-06-01' = { + name: 'myRedisCachefw' // Replace with your Redis cache name + location: resourceGroup().location + sku: { + name: 'Basic' + family: 'C' + capacity: 0 + } + properties: { + enableNonSslPort: false + } +} + + resource appInsights 'Microsoft.Insights/components@2020-02-02-preview' = { name: appInsightsName location: location From bb22886e403ce395ec3e230ee423e7867ca96d0e Mon Sep 17 00:00:00 2001 From: Frederic Wickert Date: Wed, 30 Oct 2024 13:35:25 +0100 Subject: [PATCH 2/3] Remove redundant triggers for push and pull_request in .NET workflow --- .github/workflows/dotnet.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3e77d999..86c66ecb 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -4,12 +4,7 @@ name: .NET on: - push: - branches: [ "main" ] - paths: src/Application/** - pull_request: - branches: [ "main" ] - paths: src/Application/** + workflow_dispatch: jobs: From cb43f1d28b0ee0bec733db1df09c0300c7a526b0 Mon Sep 17 00:00:00 2001 From: Frederic Wickert Date: Wed, 30 Oct 2024 13:37:55 +0100 Subject: [PATCH 3/3] Add Azure Bicep workflow for ARM template deployment --- .github/workflows/Iac.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/Iac.yml diff --git a/.github/workflows/Iac.yml b/.github/workflows/Iac.yml new file mode 100644 index 00000000..fb6905d0 --- /dev/null +++ b/.github/workflows/Iac.yml @@ -0,0 +1,35 @@ +name: Azure Bicep + +on: + workflow_dispatch + +env: + targetEnv: dev + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write + steps: + # Checkout code + - uses: actions/checkout@main + + # Log into Azure + - uses: azure/login@v2.1.1 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + enable-AzPSSession: true + + # Deploy ARM template + - name: Run ARM deploy + uses: azure/arm-deploy@v1 + with: + subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + resourceGroupName: ${{ secrets.AZURE_RG }} + template: ./src/InfrastructureAsCode/main.bicep + parameters: environment=${{ env.targetEnv }} \ No newline at end of file