GC
← All work

Project 02 · Architecture

Serverless webhook automation

A push to GitHub starts an Azure Function. It proves the request really came from GitHub, then hands the job to Azure DevOps, which deploys the infrastructure with Terraform.

Azure Functions · Python · Key Vault · Managed Identity · Azure DevOps · Terraform

Trigger
Push to main
Check
HMAC signature
Secrets
Key Vault, no keys in code
Runs on
Self-hosted agent in Docker

The flow

From a commit to running infrastructure.

signed POSTmanaged identitycheck HMACinvalidvalidGitHubpush to mainAzure FunctionHTTP triggerKey Vaultwebhook secret?403 rejectedAzure DevOpspipelineAgentself-hostedin DockerTerraformplan · applyAzureresources12345signed POSTcheck HMACvalididentityinvalidGitHubpush to mainAzure FunctionHTTP trigger1?Azure DevOpspipeline4Agentself-hosted · DockerTerraformplan · apply5AzureresourcesKey Vaultwebhook secret23403 rejected
  1. 1A push to main makes GitHub send a webhook signed with an HMAC.
  2. 2The function reads the shared secret from Key Vault with its managed identity, so there are no keys in the code.
  3. 3If the signature doesn't match, the request gets a 403 and nothing runs.
  4. 4If it matches, the function starts the Azure DevOps pipeline.
  5. 5A self-hosted agent in Docker runs Terraform and deploys the infrastructure.

Security

Only GitHub can start a deployment.

  • Signed requests. Every webhook carries an HMAC signature. The function recomputes it with the shared secret and rejects anything that doesn't match with a 403.
  • No secrets in code. The webhook secret lives in Key Vault. The function reads it with its managed identity, so there is no connection string or key to leak.