Skip to content

Commit

Permalink
Use Azure Service Principal for authentication in odata.org publishin…
Browse files Browse the repository at this point in the history
…g to Azure Web App staging slot (#350)
  • Loading branch information
gathogojr authored Aug 7, 2023
1 parent 9646d17 commit 3595ed4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/publish_to_staging_slot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More on GitHub Actions for Azure: https://github.com/Azure/actions
# More on OpenID Connect: https://github.com/azure/login#github-action-for-azure-login
# More on GitHub Action for Azure Login: https://github.com/azure/login#github-action-for-azure-login

name: Publish OData org website to Azure Web App staging slot

Expand All @@ -12,10 +12,6 @@ on:

jobs:
build_and_deploy_job:
permissions: # Required when using OpenID Connect based federated identity credentials
id-token: write
contents: read

if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest

Expand All @@ -31,12 +27,10 @@ jobs:
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
jekyll/builder:stable /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"
- name: Log in with Azure # Using OpenID Connect
- name: Log in with Azure # Using Azure Service Principal
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'

- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
Expand Down

0 comments on commit 3595ed4

Please sign in to comment.