Skip to content

use oidc with sync action#686

Merged
tomjemmett merged 4 commits into
mainfrom
use_oidc_with_sync_action
Jun 11, 2026
Merged

use oidc with sync action#686
tomjemmett merged 4 commits into
mainfrom
use_oidc_with_sync_action

Conversation

@tomjemmett

Copy link
Copy Markdown
Member

switches from using sas tokens to OIDC.

this has the benefit that we use a managed identity in azure with specifically scoped access to the data, and through OIDC we get a fresh token as needed.

there were some aditional setup steps, detailed below:

  1. create a new managed identity in the same azure resource group as our storage account
  2. grant this managed identity storage blob data contributor to the container we use for the inputs app. do not grant it access to any more containers in the account.
  3. set up federated credentials in the managed identity. set this to github, to this org/repo, and the production environment
  4. in this repos settings, in the production environment, create 3 new secrets: AZURE_SUBSCRIPTION_ID, AZURE_TENANT_ID, AZURE_CLIENT_ID. The client id is found on the managed identity created in step 1.

We have manaually tested that his action works using the workflow dispatch.

@tomjemmett
tomjemmett requested a review from a team as a code owner June 2, 2026 15:25
Copilot AI review requested due to automatic review settings June 2, 2026 15:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the sync-data GitHub Actions workflow to authenticate to Azure Blob Storage using OIDC + a managed identity instead of SAS tokens, reducing long-lived credentials and enabling scoped access via Azure RBAC.

Changes:

  • Adds azure/login@v3 and enables OIDC (permissions: id-token: write) for Azure authentication.
  • Removes SAS-token based azcopy URLs and switches azcopy to use Azure CLI auth (AZCOPY_AUTO_LOGIN_TYPE=AZCLI).
  • Pins the job to the production GitHub environment to match the federated credential configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/sync-data.yaml Outdated
Comment thread .github/workflows/sync-data.yaml Outdated
Comment thread .github/workflows/sync-data.yaml Outdated
Comment thread .github/workflows/sync-data.yaml Outdated
@matt-dray
matt-dray requested review from matt-dray and removed request for a team June 10, 2026 13:48

@matt-dray matt-dray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers, you demoed this for @StatsRhian and me yesterday along with #624. You and I also walked through it last week.

@tomjemmett
tomjemmett merged commit 89b3d33 into main Jun 11, 2026
3 checks passed
@tomjemmett
tomjemmett deleted the use_oidc_with_sync_action branch June 11, 2026 17:35
@matt-dray matt-dray added this to the v5.2.0 milestone Jun 15, 2026
@matt-dray matt-dray added enhancement New feature or request should MoSCoW priority labels Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request should MoSCoW priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants