Skip to content

Commit 3595ed4

Browse files
authored
Use Azure Service Principal for authentication in odata.org publishing to Azure Web App staging slot (#350)
1 parent 9646d17 commit 3595ed4

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

.github/workflows/publish_to_staging_slot.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
22
# More on GitHub Actions for Azure: https://github.com/Azure/actions
3-
# More on OpenID Connect: https://github.com/azure/login#github-action-for-azure-login
3+
# More on GitHub Action for Azure Login: https://github.com/azure/login#github-action-for-azure-login
44

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

@@ -12,10 +12,6 @@ on:
1212

1313
jobs:
1414
build_and_deploy_job:
15-
permissions: # Required when using OpenID Connect based federated identity credentials
16-
id-token: write
17-
contents: read
18-
1915
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
2016
runs-on: ubuntu-latest
2117

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

4135
- name: Deploy to Azure Web App
4236
uses: azure/webapps-deploy@v2

0 commit comments

Comments
 (0)