Layla-P / HacktoberfestProject

Log your Hacktoberfest .NET PRs at prtracker.net
Other
8 stars 17 forks source link

Feature: GitHub Actions Build - Difficulty specifying Azure AppService Staging Slot as deployment target, instead of Production slot #12

Closed SiliconOrchid closed 4 years ago

SiliconOrchid commented 4 years ago

Description:

We currently have a working GitHub Actions pipeline that provides a starting-point of functionality

This pipeline, defined as "main.yaml", currently draws from 'main' branch, builds and deploys to the "production" slot on the Azure AppService.

https://github.com/Layla-P/HacktoberfestProject/blob/main/.github/workflows/main.yaml

We want to be able to specify the deployment target as being a staging/test slot on the appservice.

I do not know the correct AZURE_WEBAPP_NAME to use.

"prtrackerweb" works just fine for the production slot

I have tried these combinations without success

"test (prtrackerweb/test)" "prtrackerweb/test" "prtrackerweb-test"

Steps:

Modify /.github/workflows/main.yaml Edit "env" (environment setting) vale "AZURE_WEBAPP_NAME" Commit and push.

Additional Info

This code was created using video tutorial https://www.youtube.com/watch?time_continue=937&v=tQv6Y5jLUlM&feature=emb_logo as a reference. The appropriate credentials have been created in Azure and are stored within GitHub in the "Settings -> Secrets" section (this will only be visible to repo admin). These credentials are applicable to the entire Azure Resource Group. They have currently been demonstrated as working ok, when used for deployment to the production slot ( so are anticipated to not be the cause of the problem.)

CrypticEnigma00 commented 4 years ago

@SiliconOrchid on lines 35 - 39 try the below asuming that the slot name is test

  - name: Deploy to Azure App Service
        uses: azure/webapps-deploy@v2
        with:
          app-name: ${{ env.AZURE_WEBAPP_NAME }}
          slot-name: 'test'
          package: '${{ env.AZURE_WEBAPP_PATH }}/prtrackerweb_artifacts'
SiliconOrchid commented 4 years ago

@CrypticEngima Worked first time! Thank you! 👍

Main branch will now be deployed to Azure WebApp "Test" deployment slot, which can be viewed at

https://prtrackerweb-test.azurewebsites.net