Bicep Local Extensions

By Jani Nevalainen

Exploring the new local extensions feature in Azure Bicep for infrastructure as code.
Bring Pipeline Logic into Your Bicep Templates
Azure Bicep's new local extensions feature lets you embed custom logic directly in your IaC files -- no more juggling separate scripts or pipeline tasks. By authoring a small .NET "extension" that runs on your workstation or server, you can call HTTP APIs, manipulate data, or even read/write local files as part of bicep local-deploy.
Why It's a Game-Changer
Consolidate your tooling -- Everything lives in one declarative file. You no longer need to maintain parallel Bash, PowerShell, or YAML scripts just to fetch configuration, transform strings, or glue together pipeline stages. This is especially useful if you have Windows and Mac users, and you want to be able to test your Biceps before deploying.
Faster Dev & Demos -- Spin up end-to-end scenarios (e.g. creating GitHub repos, querying external services, or managing local state) in mere minutes -- without waiting for remote deployments or pipeline queues.
Flexibility & Extensibility -- Build your own libraries under any namespace, target multiple platforms by publishing native binaries, and evolve your logic in C# or another .NET language you already know.
What You Can Do
Fetch Live Data -- Call any public or internal HTTP endpoint (for example, get your current public IP) and surface the result as a Bicep output.
String & Parameter Magic -- Normalize names, generate slugs, or compute dynamic defaults without ever leaving your template.
Local State Management -- Read/write tiny JSON files on disk so subsequent runs can pick up persisted counters, tokens, or configs -- no external key-value store required.
For a step-by-step guide -- complete with all code snippets, project setup, and deployment commands -- check out the full article: Building a Bicep Local Extension to Fetch Your Public IP (https://j4ni.com/blog/2025/08/07/bicep-local-extension-public-ip/)
Dive in and see how easy it is to supercharge your Bicep workflows with local extensions!
Related insights

Custom Metrics with Application Insights
How to leverage custom metrics in Application Insights for better observability.


Azure Change Analysis
Using Azure Change Analysis to track infrastructure changes.


Copy Key Vault Secrets
A practical approach to copying secrets between Azure Key Vaults.
