Azure Devops Bicep Local Deploy banner
johnlokerse johnlokerse

Azure Devops Bicep Local Deploy

DevOps community

Description

An Azure Bicep local-deploy extension for Azure DevOps

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Azure DevOps Bicep Local Extension (Experimental)

This project demonstrates a custom Bicep Local Extension that can create Azure DevOps configuration via the Azure DevOps REST API using Bicep.

![From Bicep code to an Azure DevOps Project](BicepToProject.jpeg)

[!NOTE] This is an experimental Bicep feature and is subject to change. Do not use it in production.

Current Capabilities

Experimental / sample only. Limited functionality for now:

  • Create Azure DevOps Project
  • Create Azure DevOps Repos
  • Create Azure DevOps Artifact Feeds
  • Create Federated Service Connections
  • Assign Entra ID groups to Azure DevOps Project Permissions
  • Install Azure DevOps Marketplace Extensions
  • Create Azure DevOps Work Items
  • Trigger Azure Pipelines

See the [Sample](./Sample/main.bicep) folder for an example Bicep template.

Prerequisites

  • .NET 9 SDK
  • Bicep CLI v0.37.4+ (for local-deploy)

How to use it locally or via an Azure Container Registry (ACR)

Here are the steps to run it either locally or using an ACR.

Local build

Run script `Publish-Extension.ps1` from the folder [Infra/Scripts/](./Infra/Scripts/) to publish the project and to publish the extension locally for Bicep to use:

./Infra/Scripts/Publish-Extension.ps1 -Target ./azure-devops-extension

This creates the binary that contains the Azure DevOps API calls. Prepare your `bicepconfig.json` to refer to the binary. Set `experimentalFeaturesEnabled` -> `localDeploy` to `true` and refer the extension `azuredevops` to the binary:

{
  "experimentalFeaturesEnabled": {
    "localDeploy": true
  },
  "extensions": {
    "azuredevops": "/azure-devops-extension" // local
  },
  "implicitExtensions": []
}

Run `bicep local-deploy main.bicepparam` to test the extension locally. Also, see the example in the [Sample](./Sample/) folder.

Azure Container Registry build

If you want to make use of an Azure Container Registry