Skip to main content
Use GitHub OpenID Connect (OIDC) to give a trusted deployment job short-lived access to Azure Key Vault. The job maps each Key Vault secret to the CHECKLY_SECRET_* name expected by your Checkly constructs, then runs checkly deploy. For the scoping model and operational guidance behind this workflow, read Manage secrets at scale.
  • A Checkly Monitoring as Code project that declares secrets with secret() and secret: true at group or check scope.
  • An Azure Key Vault that uses the Azure role-based access control (RBAC) permission model.
  • A Microsoft Entra application or user-assigned managed identity with a federated identity credential for GitHub Actions.
  • The identity has the Key Vault Secrets User role on the vault that contains this project’s secrets.
  • AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID, AZURE_KEY_VAULT, and CHECKLY_ACCOUNT_ID configured as GitHub Actions variables.
  • The Checkly API key stored in Key Vault as checkly-api-key, alongside the secrets required by this project.
This guide uses a fictional payments service; replace its names and URL with your own application values. Checkly requires CHECKLY_API_KEY and CHECKLY_ACCOUNT_ID; the AZURE_* variables configure this workflow.

Configure Azure access

Follow Microsoft’s GitHub OIDC setup guide to create a federated identity for the repository and GitHub environment that deploy Checkly. Assign the identity the read-only Key Vault Secrets User role at the narrowest practical scope. The GitHub Actions runner must be able to reach the vault.

Map Key Vault secrets to Checkly

The following example assumes your application uses two credentials stored in Key Vault as payments-api-key and payments-admin-token. These are example names, not Azure or Checkly requirements. Reference their deployment environment names in your constructs:
__checks__/payments.check.ts
secret('PAYMENTS_API_KEY') reads CHECKLY_SECRET_PAYMENTS_API_KEY when the CLI loads the project. The Key Vault name and the Checkly environment name do not need to match.

Deploy from GitHub Actions

This workflow installs project dependencies before authenticating to Azure. It retrieves named secrets with az keyvault secret show, masks each retrieved value, exports it only in the deployment shell, and does not write it to GITHUB_ENV.
.github/workflows/deploy-checkly.yml
The job grants only contents: read and id-token: write. The latter lets azure/login request a GitHub OIDC token; it does not grant repository write access. AZURE_CORE_OUTPUT: none prevents accidental Azure CLI output, while --output tsv explicitly returns only each requested value to the shell.
Do not print or persist fetched values. This example assumes token-like, single-line secret values.

Rotate a secret

Rotating a value in Azure Key Vault does not automatically update the copy stored by Checkly. Run this trusted deployment workflow again after rotation. The next deployment fetches the current value returned by Key Vault and updates the scoped Checkly secret.