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