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.
Prerequisites
Prerequisites
- A Checkly Monitoring as Code project that declares secrets with
secret()andsecret: trueat 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 Userrole on the vault that contains this project’s secrets. AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_SUBSCRIPTION_ID,AZURE_KEY_VAULT, andCHECKLY_ACCOUNT_IDconfigured 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-onlyKey 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 aspayments-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 withaz 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
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.