From 2d6ea98965eb8745a088be7d8d6227f3cdd1ca58 Mon Sep 17 00:00:00 2001 From: Leandro Prado Date: Mon, 1 Jul 2024 18:23:03 -0300 Subject: [PATCH] chore: Update Azure resource deployment workflow to use correct SQL connection string secret name --- .github/workflows/03-Deployment-Function.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/03-Deployment-Function.yml b/.github/workflows/03-Deployment-Function.yml index b30814f..9c0a168 100644 --- a/.github/workflows/03-Deployment-Function.yml +++ b/.github/workflows/03-Deployment-Function.yml @@ -9,7 +9,7 @@ on: env: CONFIGURATION: 'release' AZ_RG_NAME: 'rg-ghdashboard' - APP_NAME: 'func-ghdashboard' + AZ_FUNC_NAME: 'func-ghdashboard' CSPROJ: 'src/github-dashboard.function/github-dashboard.function.csproj' jobs: @@ -65,11 +65,24 @@ jobs: - name: 'Run Azure Functions action' uses: Azure/functions-action@v1 with: - app-name: ${{ env.APP_NAME }} + app-name: ${{ env.AZ_FUNC_NAME }} package: my-app-artifact + + - name: Set Function Settings + uses: Azure/appservice-settings@v1 + with: + app-name: ${{ env.AZ_FUNC_NAME }} + app-settings-json: | + [ + { + "name": "MyDbContext", + "value": "${{ env.AZ_SQL_CONNECTION_STRING }}", + "slotSetting": false + } + ] - name: Restart function - run: az functionapp restart --name ${{ env.APP_NAME }} --resource-group ${{ env.AZ_RG_NAME }} + run: az functionapp restart --name ${{ env.AZ_FUNC_NAME }} --resource-group ${{ env.AZ_RG_NAME }} - name: Run SQL Scripts uses: azure/sql-action@v2.2.1