Insight Tech APAC Blog Logo

Bicep Local Deploy: Entra Entitlement Management and Access Packages

stephentulp
December 3, 2026

10 minutes to read

2026 Advent Calendar

Introduction

Bicep is normally associated with Azure Resource Manager deployments. A template is compiled, submitted to Azure, and evaluated by the control plane. Bicep Local Deploy adds a different execution model: a Bicep parameters file can invoke purpose-built extensions on the local machine without creating an Azure deployment.

In discussions comparing Bicep and Terraform for provisioning, two gaps have often come up:

  1. Managing the full lifecycle of deployed resources, similar to Terraform’s plan, apply, and destroy workflow. Deployment Stacks and What-If narrow that gap with stack-level resource management and change previews, but do not map one-to-one to Terraform’s lifecycle commands.
  2. Provisioning and configuring resources outside Azure Resource Manager’s control, such as Entra objects, GitHub repositories, and Kubernetes resources.

The Microsoft Graph extension demonstrates this pattern by allowing Bicep to manage Entra objects. Many other services could also be orchestrated through extensions. For example, provisioning a workload landing zone for a new project might involve several steps:

  • Creating Microsoft Entra identities, security groups, and users
  • Creating a new Azure subscription and landing zone through subscription vending
  • Creating Azure DevOps or GitHub repositories and configuring them for the workload
  • Performing data-plane actions in a deployed Key Vault, including reading and writing secrets

Today, Bicep can handle the first two steps natively. The remaining steps still require manual work, scripts, or a combination of both. Bicep Local Deploy can help orchestrate these tasks through extensions.

WARNING!
The Bicep Local Deploy command and the extension ecosystem are experimental. Syntax, packaging, protocol behavior, and tooling support can change. Test extensions and pin their versions before considering this approach for operational workflows.

What Local Deploy Is

A local deployment still uses a Bicep template and is evaluated locally by the configured extension rather than being submitted to Azure Resource Manager.

Bicep Local Deploy

The Bicep CLI restores and starts the configured extension. The extension exposes a gRPC endpoint over a local socket or named pipe and receives requests for the custom resource types used by the template.

The extension, not Azure Resource Manager, implements those resource operations. It might:

  • Execute a PowerShell or Bash script
  • Create a GitHub repository or secret
  • Send an HTTP request
  • Manage Kubernetes objects
  • Read or write Key Vault data-plane objects
  • Apply Desired State Configuration

Bicep provides orchestration, dependencies, parameters, outputs, validation, and editor type information. The extension provides the behavior.

Enable Local Deploy

Add the localDeploy experimental feature to bicepconfig.json. An extension can be restored from an OCI registry or loaded from a local package.

{
  "experimentalFeaturesEnabled": {
    "localDeploy": true,
    "ociEnabled": true

  },
  "extensions": {
    "entitlementmgmt": "./entitlementmgmt-ext",
    "github": "br:ghcr.io/anthony-c-martin/bicep-ext-github:0.0.1",
    "msGraph": "br:mcr.microsoft.com/bicep/extensions/microsoftgraph/v1.0:1.0.0",
    "http": "br:contoso.azurecr.io/bicep/extensions/http:0.1.1"
  },
  "implicitExtensions": []
}

The configuration key becomes the extension alias:

targetScope = 'local'

extension http

param endpoint string

resource healthCheck 'HttpRequest' = {
  name: 'readiness'
  method: 'GET'
  url: endpoint
}

The exact custom resource types and properties come from the selected extension’s generated types. Check the extension’s documentation instead of assuming its schema. An empty implicitExtensions array makes extension selection explicit, so each template declares only the extensions it needs.

Understand the Extension Contract

A local extension combines two main artifacts:

  1. An executable that implements the Bicep Extensibility Protocol over gRPC.
  2. Structured type metadata that tells Bicep which resource types, properties, identifiers, and outputs the extension supports.

The executable accepts either --socket <name> on Linux and macOS or --pipe <name> on Windows. It exposes the gRPC service, performs operations for its resource types, and responds to termination signals for graceful shutdown.

Bicep uses the type metadata to provide:

  • Compile-time property validation
  • IntelliSense and completion
  • Type checking in the template
  • Stable custom resource declarations

For extension authors, the executable and metadata are as important as the resource handler behavior. A successful deployment depends on all three.

Examples of Bicep Local Deploy Extensions

Several extensions support common local deployment scenarios, including GitHub, Azure DevOps, Fabric, and other external services.

One extension I have used frequently is the Azure Entitlement Management Bicep Local Extension, created by Ryan B with GitHub Copilot and custom chat modes. Entitlement Management is an Entra capability for managing access to resources and governing that access. After completing a large program of work that used it as part of the identity lifecycle, I found it useful for automating complex entitlement scenarios.

Extending the Azure Entitlement Management Bicep Local Extension

I was excited to manage these resources as infrastructure as code with Bicep, so I built on Ryan’s work to explore how far I could take it. This is a work in progress, and I plan to continue expanding it. Ryan’s GitHub repository includes useful examples and getting-started guidance. I focused on the Bicep templates rather than duplicating the rest of the repository. The example templates are available in the 2026 Advent Calendar repository.

  • A catalog groups resources, which can include groups and teams, applications, SharePoint sites, Azure resources, Entra roles, or resources from other custom data providers.
  • A catalog can contain one or more access packages. Each package can include some or all of these resources, which must be added to the catalog first.
  • Each access package can define policies for approval workflows, expiration, and assignment rules. Policies can be configured manually or automatically. An Entra Identity Governance license is required for automated configurations.
  • Access packages can be assigned to users according to their policies. Assignments can have an expiration date and can be subject to access reviews to confirm that users still need access.

This is a high-level overview of how catalogs and access packages work together in Entra Entitlement Management. Their implementation and configuration involve more detail, but this should provide a foundation for managing them with Bicep.

The example code builds on these basics and includes:

  • A main Bicep orchestration template and a parameters file for defining input values
  • A shared type file that defines reusable types for the template
  • A catalog with an array of associated access packages
  • An array of Entra security groups to add to the catalog
  • Policies for each access package, including approval workflows, expiration, and assignment rules

The templates include conditional logic and configuration options. Understanding the dependencies between catalogs, access packages, and policies is crucial to orchestrating them correctly with Bicep.

File Purpose
main.bicep Defines the local deployment parameters, creates the catalog, security groups, catalog resource entries, access packages, and assignment policies, and returns their IDs.
main.bicepparam Provides sample catalog, security-group, and access-package values. It reads the two access tokens from environment variables.
shared.type.bicep Defines the shared, sealed input types for catalogs, access packages, security groups, approval settings, reviews, and approver/reviewer subjects.
get_access_token.py Acquires Microsoft Graph tokens interactively with MSAL and prints PowerShell commands for setting them. Its group token also requests PIM permissions.
set-tokens.ps1 Runs the Python token helper and sets the resulting tokens in the current PowerShell session.
README.md Documents the example’s prerequisites, inputs, deployment steps, and validation.

Execute the Deployment

  • The parameters file defines the catalog, security groups, access packages, and tokens used by the deployment:

Bicep parameters defining the catalog, security groups, access packages, and token environment variables

  • Run set-tokens.ps1 in the terminal to set the token environment variables.

Terminal showing the entitlement and group user token environment variables being set

  • Run the local deployment with the Bicep CLI, using the specified parameters and tokens.
Bicep local-deploy main.bicepparam

Successful Bicep local deployment with resource statuses and output IDs

The local deployment reports the status of each resource and returns the catalog, access package, and policy IDs.

Inspect the Outputs

In the portal, you can inspect the resources created by the local deployment, including catalogs, access packages, and policies.

  • The catalog

Identity Governance catalogs showing the Platform Landing Zone catalog

  • The access packages created within the catalog

Identity Governance access packages including Security Operations and Network Operations

  • The policies associated with the access packages

Security Operations access package policy details

  • The request and approval settings for the policies

Access package policy request and approval settings

  • The expiration and access review settings for the policies

Access package policy expiration and access review settings

Final Thoughts

Bicep Local Deploy changes what Bicep can orchestrate. With a custom extension, one typed template can connect scripts, APIs, Kubernetes, GitHub, and other tools without pretending that they are Azure Resource Manager resources.

The tradeoff is a new trust boundary. The extension is executable code, the workflow runs with the user’s environment and credentials, and the feature is experimental.

Start with a small, pinned extension and a non-secret development workflow. Add platform tests, least-privilege credentials, package signing, and idempotent handlers before moving toward operational use.

References