<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Azure Bicep - Medium]]></title>
        <description><![CDATA[This publication is created by Azure Bicep Microsoft MVPs to share essential knowledge about Azure Bicep, whether you are a beginner or a pro. 💪 - Medium]]></description>
        <link>https://medium.com/azure-bicep?source=rss----2c3174eeb5eb---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Azure Bicep - Medium</title>
            <link>https://medium.com/azure-bicep?source=rss----2c3174eeb5eb---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:39:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/azure-bicep" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Generate Azure Bicep Documentation with the Bicep CLI! ]]></title>
            <link>https://medium.com/azure-bicep/generate-azure-bicep-documentation-with-the-bicep-cli-ba9d0a51a711?source=rss----2c3174eeb5eb---4</link>
            <guid isPermaLink="false">https://medium.com/p/ba9d0a51a711</guid>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[bicep]]></category>
            <dc:creator><![CDATA[Brian Veldman]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 10:18:38 GMT</pubDate>
            <atom:updated>2026-11-22T10:18:38.767Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*c3vKRZaYF32rAzPKUJ_2Bg@2x.jpeg" /></figure><p>Documentation is often one of the most overlooked parts of an Infrastructure as Code (IaC) repository. We spend time designing, building, and maintaining our Azure infrastructure with Bicep, but keeping the documentation up to date can be a challenge. What if your Bicep code could document itself? With the new bicep docs generate command, the Bicep CLI allows you to automatically generate documentation directly from your Bicep files. 😍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Njk4qlYuWwtXc03Fn2grMg.gif" /></figure><p>In the first example, I have an Azure Container Apps Sandboxes Bicep deployment that is missing a README.md file. Such documentation would help others understand what the Bicep infrastructure deploys and which parameters are required. You can use the following command: bicep docs generate ./main.bicep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yqMfB4l6WAlGV_9MhqurIg.png" /></figure><p>When reviewing the README.md file, we can understand what our Bicep infrastructure deploys and which resources are included. By checking whether these resources already exist, we can identify which resources will be newly created in our Azure subscription. It also provides an overview of the available parameters, including their default values and allowed values, as well as any outputs defined in the Bicep deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9_ARduxNMc7kb6Ko2YWLtA.png" /></figure><p>Bicep documentation is generated using Scriban, a lightweight text templating language. You can create your own templates to customize how the documentation is generated. To do this, you need to create a Scriban template and reference it in your bicepconfig.json file. This tells Bicep which template to use when generating the documentation.</p><pre>{<br>  &quot;documentation&quot;: {<br>    &quot;template&quot;: {<br>      &quot;file&quot;: &quot;templates/readme.scriban&quot;<br>    }<br>  }<br>}</pre><p>Next, we have readme.scriban, which acts as our documentation template. I&#39;ve added three custom values that I want to include in the README.md generated for each Bicep module: the module owner, its version, and a support URL. These values don’t belong in the Bicep code itself. Instead, we can supply them separately through a docs-values.json file and reference them in our Scriban template using custom.&lt;key&gt;. This keeps our infrastructure code clean while allowing us to enrich the generated documentation with additional information. When we generate the documentation, Bicep Docs combines the module information with these custom values to produce a README that includes both technical details and relevant ownership and support information.</p><pre><br># {{ module.name }}<br><br>{{ module.description }}<br><br>## Parameters<br><br>{{~ if module.parameters.size &gt; 0 ~}}<br>| Name | Type | Required | Description |<br>| :-- | :-- | :-- | :-- |<br>{{~ for parameter in module.parameters ~}}<br>| `{{ parameter.name }}` | `{{ parameter.type }}` | {{ if parameter.required }}Yes{{ else }}No{{ end }} | {{ parameter.description }} |<br>{{~ end ~}}<br>{{~ else ~}}<br>No parameters are declared in this module.<br>{{~ end ~}}<br><br>## Outputs<br><br>{{~ if module.outputs.size &gt; 0 ~}}<br>| Name | Type | Description |<br>| :-- | :-- | :-- |<br>{{~ for output in module.outputs ~}}<br>| `{{ output.name }}` | `{{ output.type }}` | {{ output.description }} |<br>{{~ end ~}}<br>{{~ else ~}}<br>No outputs are declared in this module.<br>{{~ end ~}}<br><br>## Module information<br><br>| Property | Value |<br>| :-- | :-- |<br>| Owner | {{ custom.owner }} |<br>| Version | {{ custom.version }} |<br>| Support | [Get support]({{ custom.supportUrl }}) |</pre><p>The docs-values.json looks like to the following for this test;</p><pre>{<br>    &quot;owner&quot;: &quot;Azure Platform Team&quot;,<br>    &quot;version&quot;: &quot;1.2.0&quot;,<br>    &quot;supportUrl&quot;: &quot;https://cloudtips.nl&quot;<br>}</pre><p>Now, when I run the following command: bicep docs generate ./main.bicep --custom-template-value-file-path ./docs-values.json, Bicep Docs generates the README using my custom template and injects the additional values from docs-values.json. The generated README.md now includes the module owner, version, and support URL without requiring any of these details to be defined in the Bicep file itself. 😍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bZtuSSHu_nyY4YCkLc6Bvw.png" /></figure><p>The output generated by Bicep Docs doesn’t have to be Markdown. For example, you can also generate HTML, which opens up some interesting possibilities for presenting your infrastructure documentation. To demonstrate this, I’ve created a custom Scriban template that generates an HTML page containing the module description, parameters, outputs, and additional information such as the module owner, version, and support URL. I’ve also included the Microsoft Learn Bicep logo and some CSS styling to make the documentation easier to read. You can then use bicep docs generate ./main.bicep --custom-template-value-file-path ./docs-values.json --outfile ./readme.html to generate the HTML.</p><pre><br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;meta name=&quot;description&quot; content=&quot;{{ module.description }}&quot;&gt;<br>    &lt;title&gt;{{ module.name }} | Bicep Module Documentation&lt;/title&gt;<br><br>    &lt;style&gt;<br>        :root {<br>            color-scheme: light;<br>            --primary: #0078d4;<br>            --primary-dark: #005a9e;<br>            --background: #f3f6fa;<br>            --surface: #ffffff;<br>            --text: #242424;<br>            --muted: #616161;<br>            --border: #e1e5eb;<br>            --code-background: #f0f4f8;<br>        }<br><br>        * {<br>            box-sizing: border-box;<br>        }<br><br>        body {<br>            margin: 0;<br>            font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;,<br>                Arial, sans-serif;<br>            background: var(--background);<br>            color: var(--text);<br>            line-height: 1.6;<br>        }<br><br>        .container {<br>            max-width: 1100px;<br>            margin: 0 auto;<br>            padding: 40px 24px;<br>        }<br><br>        .header {<br>            background: var(--surface);<br>            border: 1px solid var(--border);<br>            border-radius: 16px;<br>            padding: 32px;<br>            margin-bottom: 24px;<br>            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);<br>        }<br><br>        .brand {<br>            display: flex;<br>            align-items: center;<br>            gap: 24px;<br>        }<br><br>        .bicep-logo {<br>            width: 100px;<br>            height: 100px;<br>            object-fit: contain;<br>            flex-shrink: 0;<br>        }<br><br>        h1 {<br>            margin: 0 0 12px;<br>            font-size: 32px;<br>            line-height: 1.25;<br>            color: var(--primary-dark);<br>            overflow-wrap: anywhere;<br>        }<br><br>        .description {<br>            margin: 0;<br>            color: var(--muted);<br>            font-size: 16px;<br>        }<br><br>        .module-info {<br>            display: flex;<br>            flex-wrap: wrap;<br>            gap: 12px;<br>            align-items: center;<br>            margin-top: 28px;<br>            padding-top: 20px;<br>            border-top: 1px solid var(--border);<br>        }<br><br>        .info-item {<br>            display: inline-flex;<br>            align-items: center;<br>            gap: 6px;<br>            padding: 8px 12px;<br>            background: var(--background);<br>            border-radius: 8px;<br>            font-size: 14px;<br>        }<br><br>        .info-label {<br>            color: var(--muted);<br>        }<br><br>        a {<br>            color: var(--primary);<br>            text-decoration: none;<br>        }<br><br>        a:hover {<br>            text-decoration: underline;<br>        }<br><br>        .section {<br>            background: var(--surface);<br>            border: 1px solid var(--border);<br>            border-radius: 16px;<br>            padding: 28px;<br>            margin-bottom: 24px;<br>            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);<br>        }<br><br>        h2 {<br>            margin: 0 0 20px;<br>            font-size: 22px;<br>            color: var(--text);<br>        }<br><br>        .section-description {<br>            margin: -12px 0 20px;<br>            color: var(--muted);<br>            font-size: 14px;<br>        }<br><br>        .table-wrapper {<br>            width: 100%;<br>            overflow-x: auto;<br>        }<br><br>        table {<br>            width: 100%;<br>            border-collapse: collapse;<br>            font-size: 14px;<br>        }<br><br>        th,<br>        td {<br>            padding: 14px 16px;<br>            text-align: left;<br>            vertical-align: top;<br>            border-bottom: 1px solid var(--border);<br>        }<br><br>        th {<br>            background: var(--background);<br>            font-weight: 600;<br>            white-space: nowrap;<br>        }<br><br>        tbody tr:last-child td {<br>            border-bottom: none;<br>        }<br><br>        tbody tr:hover {<br>            background: #f8fbff;<br>        }<br><br>        code {<br>            padding: 3px 6px;<br>            background: var(--code-background);<br>            border-radius: 4px;<br>            font-family: Consolas, &quot;Courier New&quot;, monospace;<br>            font-size: 13px;<br>            overflow-wrap: anywhere;<br>        }<br><br>        .badge {<br>            display: inline-block;<br>            padding: 3px 9px;<br>            border-radius: 20px;<br>            font-size: 12px;<br>            font-weight: 600;<br>        }<br><br>        .badge-required {<br>            background: #e8f3ff;<br>            color: #005a9e;<br>        }<br><br>        .badge-optional {<br>            background: #edf7ed;<br>            color: #216e21;<br>        }<br><br>        .empty-state {<br>            padding: 18px;<br>            background: var(--background);<br>            border-radius: 8px;<br>            color: var(--muted);<br>            font-size: 14px;<br>        }<br><br>        .footer {<br>            padding: 20px 0;<br>            text-align: center;<br>            color: var(--muted);<br>            font-size: 13px;<br>        }<br><br>        @media (max-width: 600px) {<br>            .container {<br>                padding: 20px 12px;<br>            }<br><br>            .header,<br>            .section {<br>                padding: 20px;<br>            }<br><br>            .brand {<br>                align-items: flex-start;<br>                flex-direction: column;<br>                gap: 16px;<br>            }<br><br>            .bicep-logo {<br>                width: 76px;<br>                height: 76px;<br>            }<br><br>            h1 {<br>                font-size: 26px;<br>            }<br><br>            .module-info {<br>                align-items: flex-start;<br>                flex-direction: column;<br>            }<br><br>            th,<br>            td {<br>                padding: 10px;<br>            }<br>        }<br><br>        @media print {<br>            body {<br>                background: white;<br>            }<br><br>            .container {<br>                max-width: none;<br>                padding: 0;<br>            }<br><br>            .header,<br>            .section {<br>                box-shadow: none;<br>                break-inside: avoid;<br>            }<br><br>            a {<br>                color: inherit;<br>            }<br>        }<br>    &lt;/style&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br>    &lt;main class=&quot;container&quot;&gt;<br>        &lt;header class=&quot;header&quot;&gt;<br>            &lt;div class=&quot;brand&quot;&gt;<br>                &lt;img<br>                    class=&quot;bicep-logo&quot;<br>                    src=&quot;https://learn.microsoft.com/nl-nl/training/achievements/bicep/fundamentals-bicep.svg&quot;<br>                    alt=&quot;Microsoft Learn Bicep logo&quot;<br>                    width=&quot;100&quot;<br>                    height=&quot;100&quot;<br>                &gt;<br><br>                &lt;div&gt;<br>                    &lt;h1&gt;{{ module.name }}&lt;/h1&gt;<br>                    &lt;p class=&quot;description&quot;&gt;{{ module.description }}&lt;/p&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br><br>            &lt;div class=&quot;module-info&quot;&gt;<br>                &lt;div class=&quot;info-item&quot;&gt;<br>                    &lt;span class=&quot;info-label&quot;&gt;Owner:&lt;/span&gt;<br>                    &lt;span&gt;{{ custom.owner }}&lt;/span&gt;<br>                &lt;/div&gt;<br><br>                &lt;div class=&quot;info-item&quot;&gt;<br>                    &lt;span class=&quot;info-label&quot;&gt;Version:&lt;/span&gt;<br>                    &lt;span&gt;{{ custom.version }}&lt;/span&gt;<br>                &lt;/div&gt;<br><br>                &lt;div class=&quot;info-item&quot;&gt;<br>                    &lt;a href=&quot;{{ custom.supportUrl }}&quot;&gt;Get support&lt;/a&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>        &lt;/header&gt;<br><br>        &lt;section class=&quot;section&quot;&gt;<br>            &lt;h2&gt;Parameters&lt;/h2&gt;<br>            &lt;p class=&quot;section-description&quot;&gt;<br>                Configure the module by supplying the following parameters.<br>            &lt;/p&gt;<br><br>            {{~ if module.parameters.size &gt; 0 ~}}<br>            &lt;div class=&quot;table-wrapper&quot;&gt;<br>                &lt;table&gt;<br>                    &lt;thead&gt;<br>                        &lt;tr&gt;<br>                            &lt;th&gt;Name&lt;/th&gt;<br>                            &lt;th&gt;Type&lt;/th&gt;<br>                            &lt;th&gt;Required&lt;/th&gt;<br>                            &lt;th&gt;Description&lt;/th&gt;<br>                        &lt;/tr&gt;<br>                    &lt;/thead&gt;<br>                    &lt;tbody&gt;<br>                        {{~ for parameter in module.parameters ~}}<br>                        &lt;tr&gt;<br>                            &lt;td&gt;&lt;code&gt;{{ parameter.name }}&lt;/code&gt;&lt;/td&gt;<br>                            &lt;td&gt;&lt;code&gt;{{ parameter.type }}&lt;/code&gt;&lt;/td&gt;<br>                            &lt;td&gt;<br>                                {{~ if parameter.required ~}}<br>                                &lt;span class=&quot;badge badge-required&quot;&gt;Required&lt;/span&gt;<br>                                {{~ else ~}}<br>                                &lt;span class=&quot;badge badge-optional&quot;&gt;Optional&lt;/span&gt;<br>                                {{~ end ~}}<br>                            &lt;/td&gt;<br>                            &lt;td&gt;{{ parameter.description }}&lt;/td&gt;<br>                        &lt;/tr&gt;<br>                        {{~ end ~}}<br>                    &lt;/tbody&gt;<br>                &lt;/table&gt;<br>            &lt;/div&gt;<br>            {{~ else ~}}<br>            &lt;div class=&quot;empty-state&quot;&gt;<br>                This module does not declare any parameters.<br>            &lt;/div&gt;<br>            {{~ end ~}}<br>        &lt;/section&gt;<br><br>        &lt;section class=&quot;section&quot;&gt;<br>            &lt;h2&gt;Outputs&lt;/h2&gt;<br>            &lt;p class=&quot;section-description&quot;&gt;<br>                The following outputs are exposed by this module.<br>            &lt;/p&gt;<br><br>            {{~ if module.outputs.size &gt; 0 ~}}<br>            &lt;div class=&quot;table-wrapper&quot;&gt;<br>                &lt;table&gt;<br>                    &lt;thead&gt;<br>                        &lt;tr&gt;<br>                            &lt;th&gt;Name&lt;/th&gt;<br>                            &lt;th&gt;Type&lt;/th&gt;<br>                            &lt;th&gt;Description&lt;/th&gt;<br>                        &lt;/tr&gt;<br>                    &lt;/thead&gt;<br>                    &lt;tbody&gt;<br>                        {{~ for output in module.outputs ~}}<br>                        &lt;tr&gt;<br>                            &lt;td&gt;&lt;code&gt;{{ output.name }}&lt;/code&gt;&lt;/td&gt;<br>                            &lt;td&gt;&lt;code&gt;{{ output.type }}&lt;/code&gt;&lt;/td&gt;<br>                            &lt;td&gt;{{ output.description }}&lt;/td&gt;<br>                        &lt;/tr&gt;<br>                        {{~ end ~}}<br>                    &lt;/tbody&gt;<br>                &lt;/table&gt;<br>            &lt;/div&gt;<br>            {{~ else ~}}<br>            &lt;div class=&quot;empty-state&quot;&gt;<br>                This module does not declare any outputs.<br>            &lt;/div&gt;<br>            {{~ end ~}}<br>        &lt;/section&gt;<br><br>        &lt;footer class=&quot;footer&quot;&gt;<br>            Generated using Bicep Docs and Scriban.<br>        &lt;/footer&gt;<br>    &lt;/main&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>When opening our HTML Bicep documentation, the result is impressive!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6JJwWTwDY-A9Tew3VWoyag.png" /></figure><p>By now, you can see why the new bicep docs generate command is such a useful addition to our Infrastructure as Code workflow. It provides a simple and effective way to automatically generate documentation, keep our README files consistent, and include additional metadata without having to embed it in our Bicep code. By combining custom Scriban templates with custom values, we can tailor our documentation to fit the needs of our team and project. That’s all for today! Feel free to clap for this story if you found it helpful. I’d love to hear your feedback and how you’re planning to use Bicep Docs in your own projects. I look forward to seeing you in the next session. Until then, take care! ⭐️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba9d0a51a711" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-bicep/generate-azure-bicep-documentation-with-the-bicep-cli-ba9d0a51a711">Generate Azure Bicep Documentation with the Bicep CLI! 💪🏻</a> was originally published in <a href="https://medium.com/azure-bicep">Azure Bicep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Deployment Stacks: Zero to Hero ❤️]]></title>
            <link>https://medium.com/azure-bicep/azure-deployment-stacks-zero-to-hero-%EF%B8%8F-a62e73ebfc15?source=rss----2c3174eeb5eb---4</link>
            <guid isPermaLink="false">https://medium.com/p/a62e73ebfc15</guid>
            <category><![CDATA[azure-bicep]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[azure-deployment-stacks]]></category>
            <dc:creator><![CDATA[Dan]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 14:49:41 GMT</pubDate>
            <atom:updated>2026-09-01T14:49:41.647Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is deployment stacks?</h3><p>Azure Deployment Stacks allow you to manage a set of resources under one roof by defining a Bicep file within stack management. Deployment Stacks build upon and enhance the current deployment methods. Additionally, Deployment Stacks represent the evolution of Azure Blueprints — something many of you may already be familiar with and might still be using today.</p><p>Ironically, Deployment Stacks introduce a concept similar to a state file. This means you can now automatically delete resources, much like a <strong><em>Terraform Destroy</em></strong>. However, this state file is managed by Microsoft and abstracted away from the end user. By managing resources via the stack, you can streamline and guardrail your deployments using a much more feature-rich solution than ever before.</p><p>In this blog, I’ll dive into the details of Deployment Stacks: what they are, how they can benefit your deployment strategy, and some real-world insights from using stacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WmPpBZdUzi-X0qZD.png" /></figure><h3>Azure Blueprints evolution</h3><p>Azure Blueprints went into public preview over seven years ago; however, it never progressed beyond the preview phase and, as a result, did not reach general availability. Typically, any Azure product that remains in preview for more than 12 months is at significant risk of being retired, so you should expect it to be deprecated.</p><p>Deployment Stacks are designed as the successor to Azure Blueprints and, as of mid-2024, have already reached General Availability. This means you can expect ongoing features, improvements, and support from Microsoft. If you are still using Blueprints today, <strong><em>you should start planning your migration to Deployment Stacks as soon as possible.</em></strong></p><p>The focus for the Bicep team moving forward will be heavily centred on Deployment Stacks and their continuous development. Therefore, I strongly recommend transitioning your new and existing deployments into stacks. By doing so, you can enjoy the benefits they offer while also contributing to shaping future features through real-world feedback to the product team.</p><h3>Where to start?</h3><p>As always by the teams at Microsoft, there is an abundance of fantastic documentation and learning path modules you can freely leverage to upskill onto the latest and greatest. Deployment stacks is no different, here’s a list of material I would recommend checking out:</p><ul><li><a href="https://learn.microsoft.com/en-us/training/modules/introduction-to-deployment-stacks/">Introduction to Deployment Stacks — Learn Path</a></li><li><a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deployment-stacks?tabs=azure-powershell">Microsoft Learn Documentation</a></li><li><a href="https://www.youtube.com/watch?v=d1AE8qLwBYw">Deployment Stacks — Deep Dive by John Savill</a></li><li><a href="https://www.youtube.com/watch?v=aNAVrd1GJJE">Running with Deployment Stacks by Bernie White</a></li><li><a href="https://www.youtube.com/watch?v=6Cmz5ESdkCM">Deployment Stacks by Sam Cogan</a></li><li><a href="http://awood.tech/azure-deployment-stacks-deny-settings-move-gap/">Deployment Stacks &amp; Some Gotchas by Andrew Wood</a></li></ul><h3>Modes</h3><p>You can change any of the modes in your deployment stack at a later stage and the stack will update the settings. There is also two <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deployment-stacks?tabs=azure-powershell#built-in-roles">Deployment Stack built-in RBAC</a> roles that allow granular control of the stack itself.</p><h3>Action on unmanage</h3><p>In deployment stacks you can define an “action on unmanage” setting which sets what happens to the resources that are updated or deleted within the stack. There’s three key modes to select in this area and I’ll detail each and how they work.</p><h4>detachAll</h4><p>When you delete a resource from your Bicep template in this mode, the resource will no longer be tracked by the deployment stack, but it will still exist in Azure. For instance, if my Bicep template includes a Key Vault module and I delete this module block — or simply give the resource a new name in my Bicep parameters the previous Key Vault resource will remain in the resource group but will no longer be managed by the stack. Instead, the new resource will now be (deployed) and tracked by the stack.</p><pre>az stack sub create \<br>--name &#39;az-stack-uks-demo&#39; \<br>--location &#39;uksouth&#39; \<br>--template-file &#39;main.bicep&#39; \<br>--parameters &#39;main.bicepparam&#39; \<br>--action-on-unmanage &#39;detachAll&#39; \<br>--deny-settings-mode &#39;denyWriteAndDelete&#39; \<br>--deny-settings-apply-to-child-scopes</pre><h4>deleteResources</h4><p>Following on from above, defining deleteResources means the deployment stack will delete the Azure resource if it becomes unmanaged. For example, if I accidentally deploy a storage account with the wrong name, I can update my parameter or variable to reflect the correct name. Upon deployment, the stack will delete the original storage account and create the new one, managing it within the deployment stack. This behaviour applies to any resource tracked by the stack, but only for resources within the resource group (<strong><em>and not the resource group itself</em></strong> <strong><em>in this mode</em></strong>).</p><p>The deployment stack will make multiple attempts (retries) to delete a resource in a best effort approach. However, some resources simply cannot be deleted. For instance, removing a Data Collection Rule resource from your Bicep template will fail if it has associated VMs, due to external resource dependencies. This type of scenario applies to other resources with similar dependencies on linked resources:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r9mE2f3N46uaKKsl.png" /></figure><p>In addition, if you want to increase a subnet size with connected resources stacks also seems to struggle. So it does have some nuances with the deleteResources mode that hopefully will improve in the near future.</p><p>For the most part the clean-ups should work nicely, and you’ll be able to review what resources have been deleted from the last deployment in the stacks management overview:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WICgHTj-Jq5NMxES.png" /></figure><p>The deployment stack overview shows the deleted resources:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TVLjXA8fcE1v4DKA.png" /></figure><pre>azcli<br>az stack sub create \<br>--name &#39;az-stack-uks-demo&#39; \<br>--location &#39;uksouth&#39; \<br>--template-file &#39;main.bicep&#39; \<br>--parameters &#39;main.bicepparam&#39; \<br>--action-on-unmanage &#39;deleteResources&#39; \<br>--deny-settings-mode &#39;denyWriteAndDelete&#39; \<br>--deny-settings-apply-to-child-scopes</pre><h4>deleteAll</h4><p>The same as deleteResources, except the deleteAll setting will also remove resource groups themselves, if the stack is managing them. For example, I delete the resource group(s) resource from my bicep file, on stack deployment it’s going to delete the resource group(s) including all the resources.</p><pre>azcli<br>az stack sub create \<br>--name &#39;az-stack-uks-demo&#39; \<br>--location &#39;uksouth&#39; \<br>--template-file &#39;main.bicep&#39; \<br>--parameters &#39;main.bicepparam&#39; \<br>--action-on-unmanage &#39;deleteAll&#39; \<br>--deny-settings-mode &#39;denyWriteAndDelete&#39; \<br>--deny-settings-apply-to-child-scopes</pre><p>A quick way to visually view the different unmanage options and what they will do is in the portal, when you click ‘delete stack’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q1AdvxjPOtJQomoK.png" /></figure><h3>Deny Settings</h3><p>In deployment stacks you can also define deny settings. These deny options help prevent resource and property changes that you do not authorise and intend to protect as part of the stack management for the resources.</p><p>Deny settings only work on explicitly created resources as part of the deployment stack. If a user or principal creates a resource within in the portal, it will not be managed by the stack and therefore not subject to deny settings. <strong>They also do not apply to data plane actions.</strong></p><p>The documentation does a really great job at explaining the different deny settings and their consequences. So in the interest of not repeating them in my own words, here’s a quote directly from the <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deployment-stacks?tabs=azure-cli#protect-managed-resources">docs</a>:</p><ul><li>deny-settings-mode: Defines the operations that are prohibited on the managed resources to safeguard against unauthorized security principals attempting to delete or update them. This restriction applies to everyone unless they&#39;re explicitly granted access. The values include: none, denyDelete, and denyWriteAndDelete.</li><li>deny-settings-apply-to-child-scopes: When specified, the deny setting mode configuration also applies to the child scope of the managed resources. For example, a Bicep file defines a <em>Microsoft.Sql/servers</em> resource (parent) and a <em>Microsoft.Sql/servers/databases</em> resource (child). If a deployment stack is created using the Bicep file with the deny-settings-apply-to-child-scopes setting enabled and the deny-settings-mode set to denyWriteAndDelete, you can&#39;t add any additional child resources to either the <em>Microsoft.Sql/servers</em> resource or the <em>Microsoft.Sql/servers/databases</em> resource.</li><li>deny-settings-excluded-actions: List of RBAC management operations excluded from the deny settings. Up to 200 actions are allowed.</li><li>deny-settings-excluded-principals: List of Microsoft Entra principal IDs excluded from the lock. Up to five principals are allowed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jegRy2roilgYHPaT.png" /></figure><p><strong>Here’s some observations to call out about deny settings from my experiences so far are:</strong></p><ul><li>If you have deployIfNotExist (DINE) Azure Policies then when need to remediate resource properties where a deny setting is set to DenyWriteAndDelete it will get blocked and not remediate. By defining the remediation principals objectId you can exclude it from the deny settings using the deny-settings-excluded-principals switch but this is likely not very viable for a lot of tenants.</li><li>You can review what principals are excluded from the deny settings by reviewing the deployment stack in the Portal:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x5gbfo7W6wwGdrDe.png" /></figure><ul><li>As above from the documentation quote, if you do not include the <strong><em>deny-settings-apply-to-child-scopes</em></strong> then child scopes are subject to modifications and deletions. For example, a network security group rule can be deleted if you do not specify this deny setting. This may be a consideration for some of your stacks where you wish teams to be able to manage rules, but not modify the parent resource itself.</li><li>Consider GitOps and other DevOps processes when using deny settings. For example, if you leverage APIOps for API Management API lifecycle then a DenyWriteAndDelete setting may block this process unless you exclude the pipeline principal as part of the excluded principals switch.</li></ul><p>You can exclude objectIds from the deployment stacks deny settings (only up to a maximum of 5):</p><pre>az stack sub create \<br>....<br>--deny-settings-excluded-principals &#39;8ce39efa-ec33-4ed7-9c3a-07521316e953 ... &#39;</pre><p>However you can also exclude RBAC actions from the deny settings too, and you can specify up to 200:</p><pre>az stack sub create \<br>....<br>--deny-settings-excluded-actions &#39;Microsoft.Consumption/budgets/delete&#39;</pre><p><strong>Resources deployed outside of your Bicep template (and therefore not managed by the deployment stack) are NOT subject to stack management (deny/deletes)!</strong></p><h3>Outputs</h3><p>An interesting part of the stack metadata is it will show your Bicep templates outputs in the stack overview:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x40SXH4pBAWSMm5V.png" /></figure><p>With the output properties you’re able to reference these in other templates and modules, even in different subscriptions/resource groups. By using the existing function for a deployment stack you can pull in the outputs to any templates. This is fantastic for reusability and referencing a central bicep stack for example (think hub virtual network id, etc).</p><p><strong><em>If you want to see this in action, please check out my Bicepify project where I dive into this example in more detail (that you can try for free!) here: </em></strong><a href="https://github.com/riosengineer/Bicepify/tree/main/bicep-examples/deployment-stacks-outputs"><strong><em>Bicepify/bicep-examples/deployment-stacks-outputs at main · riosengineer/Bicepify</em></strong></a></p><p>TLDR:</p><pre>@description(&#39;The subscription ID where the referenced stack exists.&#39;)<br>param stackSubscriptionId string<br><br>@description(&#39;Your Deployment Stack name that you want to pull outputs from.&#39;)<br>var stackName = &#39;az-bicepify-stack-output&#39;<br><br>resource existingStack &#39;Microsoft.Resources/deploymentStacks@2024-03-01&#39; existing = {<br>  name: stackName<br>  scope: subscription(stackSubscriptionId)<br>}<br><br>var stackOutputs = existingStack.properties.outputs<br>var stackOutputsUserAssignedIdentityId string = stackOutputs.userAssignedIdentityId.value // We get no intellisense here, so you have to know the output name and append the `.value` on the end for the string value.<br><br>module modStorageAccount &#39;br/public:avm/res/storage/storage-account:0.26.0&#39; = {<br>  // ...existing code...<br>  managedIdentities: {<br>    userAssignedResourceIds: [<br>      stackOutputsUserAssignedIdentityId<br>    ]<br>  }<br>}</pre><h3>Adoption</h3><p>If you’re already deploying Bicep (or ARM templates), <strong><em>adoption will likely be far more straightforward than you might think</em></strong>. There’s <strong><em>no need to make any changes to your Bicep templates to prepare them for stacks</em></strong>. This is because Deployment Stacks are essentially an extension built on top of the existing deployment mechanisms we use today for Azure deployments.</p><p>With this in mind, adoption is more about updating your deployment scripts, pipelines, or similar processes to use the Deployment Stacks commands, actions, or tasks. You’ll then be able to bring your existing Bicep templates and, therefore, the resources they deploy under Deployment Stacks management, using your defined modes.</p><p>TIP: Consider adding a hidden-title tag into your Azure tag deployment so you can easily track which resources are managed by deployment stacks and which are not (yet) adopted or (deployed) outside of a stack.</p><pre>FROM THIS:<br>az deployment sub create -l uksouth -f main.bicep -p main.bicepparam<br><br>New-AzSubscriptionDeployment -Location uksouth -TemplateFile main.bicep -TemplateParameterFile main.bicepparam<br><br>TO THIS:<br>az stack sub create --name &#39;azstack&#39; --location &#39;uksouth&#39; --template-file &#39;main.bicep&#39; --parameters &#39;main.bicepparam&#39; --action-on-unmanage &#39;deleteResources&#39; --deny-settings-mode &#39;denyWriteAndDelete&#39; --deny-settings-apply-to-child-scopes<br><br>New-AzSubscriptionDeploymentStack -Name &quot;azstack&quot; -Location &quot;uksouth&quot; -TemplateFile &quot;main.bicep&quot; -ActionOnUmanage &quot;detachAll&quot; -DenySettingsMode &quot;none&quot;</pre><p>I would recommend deploying your stacks at least at the subscription level for better flexibility and to allow control of multiple resource groups if required. In addition, it keeps the stack settings out of reach for teams who may have RBAC on the resource groups enforcing your stack modes.</p><h3>GitHub</h3><p>The (somewhat) new Bicep Deploy GitHub Action already has good support for Deployment stacks — making CI/CD in GitHub very painless to shift from your current setup.</p><p><a href="https://github.com/marketplace/actions/bicep-deploy">Bicep Deploy · Actions · GitHub Marketplace</a></p><pre>- name: Deployment<br>        uses: azure/bicep-deploy@v2.1.0<br>        with:<br>          type: deploymentStack<br>          operation: create<br>          name: riosengineer<br>          location: uksouth<br>          scope: subscription<br>          subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}<br>          template-file: ./main.bicep<br>          parameters-file: ./main.bicepparam<br>          action-on-unmanage-resources: delete<br>          deny-settings-mode: denyWriteAndDelete</pre><p>With some more examples here: <a href="https://github.com/Azure/bicep-deploy/blob/main/examples/STACKS.md">bicep-deploy/examples/STACKS.md at main · Azure/bicep-deploy</a></p><h3>Azure DevOps</h3><p>Azure DevOps now has a dedicated built-in Bicep deployment task, similar to GitHub Actions, with native support for deploy, validate, What-If, and deployment-stack scenarios: <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/bicep-deploy-v0?view=azure-pipelines">https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/bicep-deploy-v0?view=azure-pipelines</a></p><h3>What-If for Stacks now GA!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9CRo0yum1ocZQr8_.png" /><figcaption>Stacks What-if Output</figcaption></figure><p>This is a huge announcement, and a long time coming, especially given the numerous enhancements and fixes made to What-if, including noise reduction and short-circuit elimination.</p><p>Because Deployment Stacks maintain deployment state metadata, the What-if output provides a 1:1 change log of the deployment, similar to a Terraform plan. It also highlights which resources managed by the stack will be updated or deleted. The output has also been visually improved and reordered to surface the most impactful changes first, making it much easier to review before deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pwO9inBNDu7qNyZv.png" /></figure><p>Check out the Azure CLI cmdlets: <a href="https://learn.microsoft.com/en-us/cli/azure/stack-whatif?view=azure-cli-latest">https://learn.microsoft.com/en-us/cli/azure/stack-whatif?view=azure-cli-latest</a></p><h3>Try it out!</h3><p>I’ve put together a really simple Bicep template, if you just want to quickly copy/paste and try things out for yourself:</p><h3>Conclusion</h3><p>Thanks if you made it this far, and I trust the blog had useful insights into Deployment Stacks! It’s the future of Bicep deployments and so it’s critical you look to try and adopt it as your go to deployment and management mechanism for your Azure resources! I’m excited how stacks will evolve and keen to see how what-if enhances the robustness of the tooling, which should be coming any month now.</p><p>What’s your thoughts on stacks so far? Are you using it? Enjoying it? Think it has some gaps?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a62e73ebfc15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-bicep/azure-deployment-stacks-zero-to-hero-%EF%B8%8F-a62e73ebfc15">Azure Deployment Stacks: Zero to Hero 🦾❤️</a> was originally published in <a href="https://medium.com/azure-bicep">Azure Bicep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A first look at Azure Bicep’s new documentation generator]]></title>
            <link>https://medium.com/azure-bicep/a-first-look-at-azure-biceps-new-documentation-generator-436ac84d4ab7?source=rss----2c3174eeb5eb---4</link>
            <guid isPermaLink="false">https://medium.com/p/436ac84d4ab7</guid>
            <category><![CDATA[azure-bicep]]></category>
            <category><![CDATA[code-documentation]]></category>
            <category><![CDATA[technical-documentation]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Gijs Reijn]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 07:27:23 GMT</pubDate>
            <atom:updated>2026-09-01T07:27:21.852Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TXjz-bOzIPsypyXU.png" /></figure><p>Every Bicep module author faces the same chore as anyone else:</p><p><em>Keeping a README file in sync with all parameters, outputs, and types the compiler already knows everything about.</em></p><p>I’ve been there myself. When bicep local deploy released, I published <a href="https://github.com/Gijsreyn/bicep-local-docgen?ref=idontlikeai.dev">bicep-local-docgen</a> to take some of the heavy lifting away from Bicep&#39;s own compiler.</p><p>But there’s finally some light at the end of the tunnel. With the following <a href="https://github.com/Azure/bicep/pull/20183?ref=idontlikeai.dev">pull request</a> by one of the members of the AVM project, it seems that the Bicep CLI gets its own command: bicep docs generate.</p><p>In this post, I’ll walk you through the five-year history behind that command, the tooling the community built to fill the gap, and why the AVM project finally pushed documentation generation into the Bicep CLI itself. Then, we go to the actual command itself.</p><h3>Five years of asking</h3><p>The idea to get native support for documentation generation is not new. Back in October 2021, Ben Wilkinson opened <a href="https://github.com/Azure/bicep/issues/4935?ref=idontlikeai.dev">4395</a>, “Auto generated documentation e.g. Markdown and schema”, asking for exactly this: a built-in way to turn a Bicep module into readable documentation. Nearly five years later, that issue was still open, parked on the team’s backlog while thumbs-ups and workarounds accumulated underneath it.</p><p>The thread also captured why it stayed open so long. Bicep maintainer Anthony Martin observed early on that the hard part isn’t producing Markdown; it’s that everyone wants their documentation in some different way. A built-in generator would either be too opinionated to be useful, or collapse under a pile of formatting options.</p><p>But it was Jared Holgate, one of the core maintainers of AVM, who broke the deadlock. Jared opened a proposal, which led to a design document: <a href="https://github.com/Azure/bicep-reps/blob/main/active/0025-module-documentation-generation.md?ref=idontlikeai.dev">REP 0025, “Module documentation generation commands”</a>. And as you’ll soon learn, it answers a lot of the formatting objections.</p><h3>What the community built in the meantime</h3><p>While the issue sat open, the community didn’t sit still either. It built its own tooling, so it’s good to look back at the tools that fall roughly into three generations.</p><p>The first generation worked around the problem by not parsing Bicep at all. This was <a href="https://github.com/Azure/PSDocs.Azure?ref=idontlikeai.dev">PSDocs.Azure</a>. PSDocs.Azure consumed ARM template JSON, so the recipe was straightforward in most blog posts: run bicep build first, then hand the compiled output to PSDocs. It worked, but anything that didn&#39;t survive compilation was lost along the way, and <a href="https://github.com/Azure/PSDocs.Azure/issues/106?ref=idontlikeai.dev">native Bicep support</a>, requested back in 2021, never arrived.</p><blockquote><em>The latest stable release dates from May 2021.</em></blockquote><p>A second tool targeted Bicep more directly and was developed by Christos Galanopoulos. It was fully written as Go CLI and was simply named <a href="https://github.com/christosgalano/bicep-docs?ref=idontlikeai.dev">bicep-docs</a>. It’s still an active project maintained today and takes more of a hybrid approach: it compiles your file to ARM JSON, but additionally scans the Bicep source for the things compilation obscures. Think about declarations and decorators.</p><p>The PSBicep module went one step further and embedded the <a href="https://github.com/PSBicep/PSBicep/blob/main/Docs/Bicep/New-BicepMarkdownDocumentation.md?ref=idontlikeai.dev">New-BicepMarkdownDocumentation</a> cmdlet to the actual Bicep .NET assembly. This way, it parses your file with the real compiler (and even in-process as well).</p><p>My own <a href="https://www.nuget.org/packages/bicep-local-docgen?ref=idontlikeai.dev">bicep-local-docgen</a> sits in a different lane and doesn&#39;t document Bicep modules at all. Instead, it documents Bicep Local Deploy extensions by reading the C# resource models an extension author writes and generating Markdown reference documentation from them. Just complementary rather than competing. But it taught me the same lesson every tool in this list learned the hard way: documentation tooling really wants to live next to the thing it documents.</p><blockquote><em>There are other abandoned attempts too. Joachim Dalen created a </em><a href="https://github.com/joachimdalen/bicepdocs?ref=idontlikeai.dev"><em>C# generator built on Bicep’s own libraries</em></a><em>, but was archived early in 2025.</em></blockquote><h3>AVM: the straw that broke the camel’s back</h3><p>If there’s any Bicep project out there that knows the pain at such a scale, it’s the Azure Verified Modules (AVM) project. The AVM specification even mandates it in a <a href="https://azure.github.io/Azure-Verified-Modules/spec/BCPNFR2/?ref=idontlikeai.dev">specification document</a> to produce proper documentation. It specifies that every module produces a README.md file.</p><p>To make it easier for authors, the AVM created its own tooling, and oh boy, this PowerShell script has grown to become a beast, which is roughly 2400 lines. That tool is known as <a href="https://github.com/Azure/bicep-registry-modules/blob/main/utilities/pipelines/sharedScripts/Set-ModuleReadMe.ps1?ref=idontlikeai.dev">Set-ModuleReadMe.ps1</a>. It parses the ARM JSON, and rebuilds the README section by section. It even calls out to Microsoft Learn at generation time to validate reference links, which means generating documentation requires an internet connection.</p><p>The script works. I think it documents more than 570 modules in the public registry today. But it’s held together by conventions. Parameters land in the <em>Required </em>or <em>Optional </em>based on the prefix of their description text. Hand-written content only survives in a handful of locations. And every time the Bicep language grows a new feature, someone has to teach the script about it from the outside.</p><p>The design proposal states the motivation bluntly: the AVM script is “non-trivial PowerShell that has to be maintained outside of the Bicep compiler, despite depending on Bicep’s compiled output.”</p><p>And here’s the kicker: the pull request’s author, Jared Holgate, is a core team member of the AVM project, and <a href="https://github.com/Azure/bicep-reps/blob/main/active/0025-module-documentation-generation.md?ref=idontlikeai.dev">REP 0025</a> explicitly names Set-ModuleReadme.ps1 as the prior art the new feature is &quot;intended to replace for most consumers.&quot;</p><p>This isn’t the Bicep team guessing what a docs generation should look like. It comes directly from the team with the largest generated-docs estate in the ecosystem, moving that into the compiler itself.</p><h3>Meet bicep docs</h3><p>The pull request is merged into main and introduces something the Bicep CLI has never had before: a command <em>group</em>.</p><p>Instead of a flat bicep generate-docs, you get a docs verb with two subcommands underneath. It&#39;s a deliberate choice in the design document because it leaves room for future additions like docs validate or docs-init-template.</p><pre># Generate a README.md next to the module<br>bicep docs generate ./main.bicep<br><br># Bulk generation across a module tree<br>bicep docs generate --pattern &#39;./modules/**/main.bicep&#39;<br><br># Render to stdout without writing anything<br>bicep docs output ./main.bicep</pre><p>docs generate writes a README.md next to your module (the file name is configurable with --output-file), and the --pattern variant follows the same glob convention that build, format, and lint already use for bulk operations. docs output renders the same documentation to stdout without touching disk.</p><p>So what ends up in the generated README file? Rather than describing the output here, let me show it. I wrote a small storage account module that exercises the features I care about, like file-level metadata, decorated parameters, and a discriminated union type:</p><pre>metadata name = &#39;Storage Account&#39;<br>metadata description = &#39;Deploys an Azure Storage Account with optional blob containers.&#39;<br><br>@description(&#39;The name of the storage account. Must be globally unique.&#39;)<br>@minLength(3)<br>@maxLength(24)<br>param name string<br><br>@description(&#39;The storage account SKU.&#39;)<br>@allowed([&#39;Standard_LRS&#39;, &#39;Standard_GRS&#39;, &#39;Premium_LRS&#39;])<br>param skuName string = &#39;Standard_LRS&#39;<br><br>@description(&#39;Network access configuration for the storage account.&#39;)<br>param networkAccess networkAccessType = { kind: &#39;public&#39; }<br><br>@description(&#39;Defines how the storage account can be reached.&#39;)<br>@discriminator(&#39;kind&#39;)<br>type networkAccessType = publicAccess | restrictedAccess<br><br>@description(&#39;Publicly accessible from all networks.&#39;)<br>type publicAccess = {<br>  kind: &#39;public&#39;<br>}<br><br>@description(&#39;Restricted to a set of allowed CIDR ranges.&#39;)<br>type restrictedAccess = {<br>  kind: &#39;restricted&#39;<br><br>  @description(&#39;The CIDR ranges allowed to access the storage account.&#39;)<br>  allowedCidrs: string[]<br>}<br><br>// ...plus the storage resources, a location and containers parameter, and two outputs</pre><p>Next to it sits an examples/basic/main.bicep showing how to consume the module (sounds familiar, right?). Running the bicep docs generate main.bicep and the generated README opens with the title and description from the metadata statements, a navigation block, a table of the resource types, the module deploys, and my example file rendered as a numbered, ready-to-copy usage example (discovered by the examples/ folder).</p><p>And here’s the part where all the decorators you’ve been adding finally pay off:</p><pre>## Parameters<br><br>| Name | Type | Required | Description |<br>| :-- | :-- | :-- | :-- |<br>| `containers` | `array` | No | Blob containers to create in the storage account. |<br>| `location` | `string` | No | The Azure region to deploy to. |<br>| `name` | `string` | Yes | The name of the storage account. Must be globally unique. |<br>| `networkAccess` | `object` | No | Network access configuration for the storage account. |<br>| `skuName` | `string` | No | The storage account SKU. |<br><br>### `networkAccess`<br><br>- Default value: `{ kind: &#39;public&#39; }`<br><br>- Discriminator: `kind`<br>  - `public`:<br>    - `kind` (`string`), required<br>      - Allowed values: `public`<br>  - `restricted`:<br>    - `allowedCidrs` (`array`), required: The CIDR ranges allowed to access the storage account.<br>    - `kind` (`string`), required<br>      - Allowed values: `restricted`</pre><p>Every parameter gets a detail section with its default value, allowed values, and length or value constraints ( name shows its min and max length; secure parameters render as securestring). But the networkAccess breakdown is my favorite part: the discriminated union is expanded recursively, case by case, with required flags and descriptions. You don&#39;t have to guess what shape it has through the source itself.</p><p>Stepping a bit back. Remember Anthony Martin’s objection that everyone wants their documentation formatted differently? The answer turns out to be templates. The built-in output is a sensible default, but pass --template-file with your own <a href="https://github.com/scriban/scriban?ref=idontlikeai.dev">Scriban template</a>, and you can reshape the entire document. And if you want to inject values from the outside, use --custom-template-value.</p><p>The command is going to be shipped as an experimental feature. But don’t worry for this one, you don’t have to turn on any flag in your bicepconfig.json. The full command and template references lives in <a href="https://github.com/Azure/bicep/blob/main/docs/experimental/docs-commands.md?ref=idontlikeai.dev">docs/experimental/docs-commands.md</a>.</p><h3>What this means</h3><p>The real differentiator of every tool from the middle of the post comes down to one thing: <em>architectural</em>.</p><p>bicep docs reads the compiler&#39;s semantic model, not the compiled JSON. Everything the community had to do is reverse-engineer from the outside. Now, every user-defined type, decorator, and exported function just flows into the documentation for free as the language (Bicep) evolves. A module with compile errors is refused outright rather than half-documented. And the output is deterministic: the same module with the same template produces the same README, byte for byte.</p><p>That claim on determinism isn’t theoretical. If you look at the original PR, Jarod ran the tool across the entire public module registry. Those were 573 AVM module entry points in about seven and a half minutes, with all the READMEs matching the checked-in ones (at least, it was 572, as there was a single failure a module with compile errors).</p><p>So where does that leave you? If you author modules, the wrapper scripts, or the other tooling that you’ve used can now have a retirement date. If you contribute to AVM, so does the 2400-line PowerShell script. And lastly, this one is even better. The engine is also exposed over JSON-RPC and through the Azure.Bicep.RpcClient .NET package, so a pipeline can document hundreds of modules in a single process instead of shelling out per file.</p><p>One honest caveat before you wire anything into a production pipeline. Even though the pull request has been merged to main, it’s still labeled as experimental. It’s now your time to give feedback!</p><p><em>Originally published at </em><a href="https://www.idontlikeai.dev/a-first-look-at-azure-biceps-new-documentation-generator/"><em>https://www.idontlikeai.dev</em></a><em> on August 19, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=436ac84d4ab7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-bicep/a-first-look-at-azure-biceps-new-documentation-generator-436ac84d4ab7">A first look at Azure Bicep’s new documentation generator</a> was originally published in <a href="https://medium.com/azure-bicep">Azure Bicep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One less pre-flight validation using Bicep’s extension configuration]]></title>
            <link>https://medium.com/azure-bicep/one-less-pre-flight-validation-using-biceps-extension-configuration-558cfd13c8d0?source=rss----2c3174eeb5eb---4</link>
            <guid isPermaLink="false">https://medium.com/p/558cfd13c8d0</guid>
            <category><![CDATA[azure-bicep]]></category>
            <category><![CDATA[bicep]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Gijs Reijn]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 07:50:36 GMT</pubDate>
            <atom:updated>2026-07-31T07:50:34.656Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0kNLJXaTr3nMgSW7.png" /></figure><p>Every platform team that delivers Azure subscriptions to teams encounters the reported issue at least once in their lifetime:</p><pre>Code: MissingSubscriptionRegistration<br>Message: The subscription is not registered to use namespace &#39;Microsoft.ContainerService&#39;.</pre><p>The template is fine by the teams that created it. But the subscription hasn’t been told that it needs the resource provider. So somebody adds a fix in the pipeline by using az provider register or Register-AzResourceProvider, or they simply make a wiki page titled: &quot;things to do before you deploy.&quot;</p><p>That above-mentioned error has changed with a new experimental feature and keeping everything in a single template. Your <em>Bicep </em>template. Let me show you in this blog post about the experimental feature azExtensionConfig with providers.</p><h3>What will be shipped</h3><p>Bicep hasn’t officially released a version with this experimental feature in it. But as you’ll see in the next section, you can already use it with the nightly builds.</p><p>The azExtensionConfig lets a template pass configuration to the built-in az extension using the extension ... with { ... } syntax you already use for third-party extensions:</p><pre>extension az with {<br>  providers: [<br>    &#39;Microsoft.Compute&#39;<br>    &#39;Microsoft.Storage&#39;<br>  ]<br>}</pre><p>The one property the configuration type declares today is providers. Here you declare a list of Azure resource provider namespaces to register at the beginning of your deployment. This differentiates the pre-step that most do as an extra step in their pipeline and instead, now sits within the template.</p><h3>Testing it out</h3><p>Bicep’s team provides a nightly build of both the CLI and VS Code extension. To install the nightly CLI:</p><pre>iex &quot;&amp; { $(irm https://aka.ms/bicep/nightly-cli.ps1) }&quot;</pre><p>For the VS Code extension, it would be:</p><pre>iex &quot;&amp; { $(irm https://aka.ms/bicep/nightly-vsix.ps1) }&quot;</pre><p>You can now turn on the experimental feature in your bicepconfig.json:</p><pre>{<br>  &quot;experimentalFeaturesEnabled&quot;: {<br>    &quot;azExtensionConfig&quot;: true<br>  }<br>}</pre><p>That’s the only flag that’s required. You don’t need the moduleExtensionConfigs for authoring or type checking. So, whilst the backend service is still pending, it&#39;s still possible to take a quick peek at what is happening already. Take, for example, the scenario from the top of the post, written as a template.</p><p>A subscription-scoped deployment creates a resource group and hands off to an AKS module. AKS needs Microsoft.ContainerService, its monitoring add-on needs Microsoft.OperationalInsights, and the node subnet needs Microsoft.Network:</p><pre>targetScope = &#39;subscription&#39;<br><br>extension az with {<br>  providers: [<br>    &#39;Microsoft.ContainerService&#39;<br>    &#39;Microsoft.OperationalInsights&#39;<br>    &#39;Microsoft.Network&#39;<br>  ]<br>}<br><br>param location string = &#39;westeurope&#39;<br><br>resource rg &#39;Microsoft.Resources/resourceGroups@2025-04-01&#39; = {<br>  name: &#39;rg-platform-aks&#39;<br>  location: location<br>}<br><br>module aks &#39;modules/aks.bicep&#39; = {<br>  scope: rg<br>  name: &#39;deploy-aks&#39;<br>  params: {<br>    location: location<br>  }<br>}</pre><p>In the first lines, you can exactly tell what this deployment is assuming, especially at the subscription level. That’s worth something even before the backend catches up. When you compile the above template to ARM, you notice that the config rides along the class imports path:</p><pre>&quot;imports&quot;: {<br>    &quot;az&quot;: {<br>      &quot;provider&quot;: &quot;AzureResourceManager&quot;,<br>      &quot;version&quot;: &quot;0.2.891&quot;,<br>      &quot;config&quot;: {<br>        &quot;providers&quot;: [<br>          &quot;Microsoft.ContainerService&quot;,<br>          &quot;Microsoft.OperationalInsights&quot;,<br>          &quot;Microsoft.Network&quot;<br>        ]<br>      }<br>    }<br>  },</pre><h3>IntelliSense in the editor</h3><p>This is the part that I like and works right now when you go through the provider(s): IntelliSense.</p><p>Bicep has always been profound with IntelliSense. So, Inside the with {} block, property-key completion suggest providers pop up that you want to enable.</p><p>All of these members are sourced and shipped in the bicep-typez-az, so that&#39;s why when you type in Micro, you&#39;ll find all the providers from Microsoft. Those are roughly 280 namespaces, and you can pick from the list you need.</p><p>Array-item completions also got fixed for three cursor positions that previously stayed silent: an empty array ( providers: []), an empty string literal ( providers: [&#39;&#39;], which is the shape VS Code auto-inserts the moment you type a quote), and an unterminated string. Small fix, but it removes the &quot;why isn&#39;t IntelliSense firing&quot; moment.</p><h3>Wrapping up</h3><p>It’s great to see that azExtensionConfig moves a piece of the deployment prerequisite, and you&#39;re able to just configure it in a Bicep template. The headline only at this time: <strong>the deployment engine does not act on this configuration yet.</strong></p><p>You can compile it, check it out, commit it behind the flag if you liked it, but keep your existing registration step until backend support ships. You have to keep an eye out for the official Bicep release.</p><p>For more information, the feature is documented under the <a href="https://github.com/Azure/bicep/blob/main/docs/experimental-features.md?ref=idontlikeai.dev">experimental-features.md</a> file in the repository.</p><p><em>Originally published at </em><a href="https://www.idontlikeai.dev/one-less-pre-flight-validation-using-biceps-extension-configuration/"><em>https://www.idontlikeai.dev</em></a><em> on July 29, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=558cfd13c8d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-bicep/one-less-pre-flight-validation-using-biceps-extension-configuration-558cfd13c8d0">One less pre-flight validation using Bicep’s extension configuration</a> was originally published in <a href="https://medium.com/azure-bicep">Azure Bicep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Publish Azure Bicep Modules to GitHub Container Registry ]]></title>
            <link>https://medium.com/azure-bicep/publish-azure-bicep-modules-to-github-container-registry-a596a892e767?source=rss----2c3174eeb5eb---4</link>
            <guid isPermaLink="false">https://medium.com/p/a596a892e767</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Brian Veldman]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 08:08:03 GMT</pubDate>
            <atom:updated>2026-07-20T08:08:03.500Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*jrDL3MwfUeqc5dNw.png" /></figure><p>Azure Bicep has supported publishing modules to Azure Container Registry for quite some time, making it easy to share and version reusable Infrastructure as Code across teams. By default, Bicep publishes and restores modules and extensions by using the Azure Container Registry SDK. Starting with Azure Bicep v0.45.6, the experimental ociEnabled feature extends this capability by allowing Bicep to work with any OCI compliant registry. Instead of being limited to Azure Container Registry, you can now publish to and restore modules from registries such as GitHub Container Registry (GHCR), Docker Hub, or self hosted registries like Harbor. Under the hood, Bicep uses the ORAS transport together with standard Docker credentials, making it compatible with the broader OCI ecosystem. In this blog, we will keep things simple by creating a reusable Virtual Network module and publishing it to GitHub Container Registry (GHCR). You will learn how to package the module, publish it to an OCI registry, and consume it directly from another Bicep deployment. This approach enables you to centrally manage versioned modules by using a platform that many developers already rely on for source control and CI/CD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HPN6IjN0cdcIOyH7pOpxQQ.png" /></figure><p>To start using this new experimental feature, we need to update Azure Bicep on our local machine to the latest version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HVw0BpDDB6mIeO8t_GUYPQ.png" /></figure><p>The first step to start is to add the feature flag to your bicepconfig.json.</p><pre>{<br>  &quot;experimentalFeaturesEnabled&quot;: {<br>    &quot;ociEnabled&quot;: true<br>  }<br>}</pre><p>For example, I want my Infrastructure team to always use the following. To make it easier, I want them to only define the name, location, address prefixes, and the required subnets.</p><pre>@description(&#39;Virtual Network Name&#39;)<br>param parName string<br><br>@description(&#39;Deployment Location&#39;)<br>param parLocation string = resourceGroup().location<br><br>@description(&#39;Virtual Network Address Prefix&#39;)<br>param parAddressPrefixes array<br><br>@description(&#39;Subnets&#39;)<br>param parSubnets array<br><br>@description(&#39;Defining our Virtual Network&#39;)<br>#disable-next-line BCP081<br>resource virtualNetwork &#39;Microsoft.Network/virtualNetworks@2025-07-01&#39; = {<br>  name: parName<br>  location: parLocation<br>  properties: {<br>    addressSpace: {<br>      addressPrefixes: parAddressPrefixes<br>    }<br>    subnets: [<br>      for parSubnet in parSubnets: {<br>        name: parSubnet.name<br>        properties: {<br>          addressPrefix: parSubnet.addressPrefix<br>        }<br>      }<br>    ]<br>  }<br>}<br><br>@description(&#39;Defining our outputs&#39;)<br>output outVnetId string = virtualNetwork.id<br>output outVnetName string = virtualNetwork.name</pre><p>To be able to publish the package to GitHub, you must first sign in to the GitHub Container Registry by running docker login ghcr.io.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVAtqhE5T0cZmjsyeX5qRQ.png" /></figure><p>Once you are signed in, you can publish the package to GitHub Container Registry (GHCR) by using the bicep publishcommand.</p><pre>bicep publish \<br>  ./vnet.bicep \<br>  --target br:ghcr.io/brianveldman/bicep/network/virtual-network:v1 \</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UOnLC4Mw_YD8kULWQkN1yg.png" /></figure><p>We can now see the published package in our GitHub repository, where it is correctly marked as private. Now it’s time to see how we can consume this private Bicep module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q487UO_A-YluQPYY2lwdTA.png" /></figure><h4>How can we consume the Bicep module?</h4><p>Before publishing to an OCI registry, it is worth mentioning how Azure Bicep handles authentication. To help protect your credentials, Bicep only communicates with registries that it considers trusted. If a registry is not on the trusted list, Bicep blocks the request before attempting to authenticate or establish a connection. Fortunately, GitHub Container Registry (ghcr.io) is already included as a trusted registry out of the box, so there is nothing extra to configure. If you plan to use another OCI registry, you can review the <a href="https://github.com/Azure/bicep/blob/main/docs/experimental/oci-registries.md">official documentation</a> to learn how trusted registries are configured.</p><p>Now it’s time to consume the Virtual Network module in our Bicep deployment.</p><pre>module vnet &#39;br:ghcr.io/brianveldman/bicep/network/virtual-network:v1&#39; = {<br>  params: {<br>    //<br>  }<br>}</pre><p>When filling in the parameters section, we can see the required properties. Once these have been provided, we can deploy the virtual network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DH8I6tWAZTcSfAP_qYMWhA.png" /></figure><p>Let’s deploy the Bicep template and verify the result in the Azure portal!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ll-g4gnIycNDvdZehWjqtg@2x.png" /></figure><p>After the deployment completes, we can verify the result in the Azure portal. As expected, the Virtual Network has been successfully deployed to the target resource group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CE_NU4KdbdB9wurKzOCZTA@2x.png" /></figure><p>We can see the two subnets as part of the Azure Virtual Network! 😍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yY7akZY1W6WDi72541feKg@2x.png" /></figure><h4>Troubleshooting with ORAS</h4><p>If you run into any issues while publishing or consuming your Bicep modules, ORAS provides a convenient way to inspect the OCI artifact stored in your registry. By examining the manifest, you can verify that the module was published successfully and review the metadata associated with the artifact. Since Azure Bicep already includes built in support for publishing and consuming OCI artifacts, installing ORAS is not required for day to day use. It is only needed when you want to inspect or troubleshoot the contents of an OCI artifact directly. For those who want to take a deeper look under the hood, let’s use ORAS to inspect the OCI manifest and explore the metadata that Azure Bicep stores alongside the published module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yEF5CP_48SR6CijBxyNyEg@2x.png" /></figure><p>We can verify that the manifest was published successfully by using the oras manifest fetch command. The output displays the OCI manifest, allowing us to inspect the metadata associated with the published Bicep module.</p><pre>oras manifest fetch --pretty ghcr.io/brianveldman/bicep/network/virtual-network:v1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kT5qc1dzd385M8MrqRcvEQ@2x.png" /></figure><p>We can also list the tags available in the repository by using the following command. As you can see, the repository currently contains a single published version of the module.</p><pre>oras repo tags ghcr.io/brianveldman/bicep/network/virtual-network</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4mRFB2hAQT2wztHJoItDPw@2x.png" /></figure><p>As you can see, publishing Azure Bicep modules to OCI compatible registries such as GitHub Container Registry provides a flexible way to share and version reusable Infrastructure as Code across your organization. By taking advantage of the new experimental OCI support, you are no longer limited to Azure Container Registry and can integrate Bicep modules with the container registries that best fit your development and CI/CD workflows. Whether you are using GitHub Container Registry, Docker Hub, Harbor, or another OCI compatible registry, this approach makes it easier to centrally manage versioned modules, encourage reuse, and maintain consistency across projects and environments. If you enjoyed this blog, feel free to give it a round of applause. It really helps and is greatly appreciated. Take care, and see you next time! ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a596a892e767" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-bicep/publish-azure-bicep-modules-to-github-container-registry-a596a892e767">Publish Azure Bicep Modules to GitHub Container Registry 😍</a> was originally published in <a href="https://medium.com/azure-bicep">Azure Bicep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplifying role assignments in Bicep with roleDefinitions()]]></title>
            <link>https://medium.com/azure-bicep/simplifying-role-assignments-in-bicep-with-roledefinitions-76e49bc6126e?source=rss----2c3174eeb5eb---4</link>
            <guid isPermaLink="false">https://medium.com/p/76e49bc6126e</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-bicep]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Dan]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 09:59:22 GMT</pubDate>
            <atom:updated>2026-04-07T09:59:22.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2zy0gJ9yLs_z-Kck7FAqWg.png" /></figure><p>Role assignments in Bicep have always meant tedious GUID hunting: trawling <a href="https://www.azadvertizer.net/azrolesadvertizer_all.html">AzAdvertizer</a> or maintaining a shared import file for common RBAC GUIDs. A bit clunky.</p><p>Back in September I wrote about using the <a href="https://rios.engineer/using-shared-variable-file-pattern-to-simplify-azure-roles-in-bicep/">shared variable file pattern to simplify Azure roles in Bicep</a> as a workaround and in that post I flagged:</p><blockquote>“Soon, this feature will be built-in to Bicep as a function… I will update this post when it’s live!”</blockquote><p>Bicep <a href="https://github.com/Azure/bicep/releases/tag/v0.42.1">v0.42.1</a> ships roleDefinitions() as a built-in function bringing a nice QoL addition to community. 💪</p><h3>Before</h3><p>The old way meant hardcoded GUIDs. You may have done something like:</p><pre>var contributorRoleId = &#39;b24988ac-6180-42a0-ab88-20f7382dd24c&#39;<br>resource roleAssignment &#39;Microsoft.Authorization/roleAssignments@2022-04-01&#39; = {<br>  name: guid(resourceGroup().id, identity.principalId, contributorRoleId)<br>  properties: {<br>    roleDefinitionId: subscriptionResourceId(&#39;Microsoft.Authorization/roleDefinitions&#39;, contributorRoleId)<br>    principalId: identity.principalId<br>    principalType: &#39;ServicePrincipal&#39;<br>  }<br>}</pre><h3>After</h3><p>Now you can reference roles by name directly:</p><pre>resource roleAssignment &#39;Microsoft.Authorization/roleAssignments@2022-04-01&#39; = {<br>  name: guid(resourceGroup().id, identity.principalId, roleDefinitions(&#39;Contributor&#39;).id)<br>  properties: {<br>    roleDefinitionId: roleDefinitions(&#39;Contributor&#39;).id<br>    principalId: identity.principalId<br>    principalType: &#39;ServicePrincipal&#39;<br>  }<br>}</pre><p>No GUIDs. The intent is right there in the template: clear, clean, and readable without the overhead.</p><h3>Why it matters</h3><p>The shared variable file pattern was a neat workaround, it centralised common roles and gave you VS Code IntelliSense. But it was overhead to maintain.</p><p>roleDefinitions() removes all of that:</p><ul><li>Self-documenting templates — the role name is inline</li><li>No GUID lookups or external file dependencies</li><li>Less copy/paste across templates</li><li>Full IntelliSense support in VS Code</li></ul><p>This has been a long-awaited QoL Bicep feature. A small change that makes a big difference day-to-day.</p><p>Full release notes: <a href="https://github.com/Azure/bicep/releases/tag/v0.42.1">Bicep v0.42.1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76e49bc6126e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-bicep/simplifying-role-assignments-in-bicep-with-roledefinitions-76e49bc6126e">Simplifying role assignments in Bicep with roleDefinitions()</a> was originally published in <a href="https://medium.com/azure-bicep">Azure Bicep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Subnetting in Azure Bicep]]></title>
            <link>https://medium.com/azure-bicep/subnetting-in-azure-bicep-94b4e41bc23d?source=rss----2c3174eeb5eb---4</link>
            <guid isPermaLink="false">https://medium.com/p/94b4e41bc23d</guid>
            <category><![CDATA[azure-bicep]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[John Lokerse]]></dc:creator>
            <pubDate>Fri, 27 Mar 2026 21:47:34 GMT</pubDate>
            <atom:updated>2026-03-27T21:47:34.675Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DfbWPKaO8t-CAVu1" /></figure><p>In this blog, I am writing about Bicep CIDR functions and will show a practical example on how to use this. With these CIDR functions subnetting in Bicep has been made easier. We can now create subnets programmatically.</p><h3>What is CIDR?</h3><p>CIDR stands for Classless Inter-Domain Routing and it is a method of allocating IP addresses and routing internet protocol packets. CIDR uses prefix a notation to represent IP address blocks. In this notation, an IP address is followed by a forward slash and a number that indicates the length of the network prefix. For example, 192.168.1.0/24 represents a block of IP addresses where the first 24 bits are the network prefix, and the remaining 8 bits are available for host addresses.</p><h3>Bicep CIDR functions</h3><p>There are three CIDR functions available:</p><p><strong>parseCidr()</strong></p><p>Let’s take a look at the first function: parseCidr(). This function parses an IP address range to get various properties of the specified address range. This function expects one parameter, namely: parseCidr(<strong>network</strong>). The network parameter is the IP address range to parse.</p><p>For example, to get information about the following IP address range 192.168.1.0/24 call the parseCidr function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bc28439d71fb9bd1a3ead667c56a759/href">https://medium.com/media/2bc28439d71fb9bd1a3ead667c56a759/href</a></iframe><p>Outputs:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0378f4c3560889b1f9d20804afeafec/href">https://medium.com/media/d0378f4c3560889b1f9d20804afeafec/href</a></iframe><p><strong>cidrSubnet()</strong></p><p>The cidrSubnet() function splits the specified IP address range into subnets with a new CIDR value and returns the IP address range of the subnet with the specified index. This function expects three parameters: cidrSubnet(<strong>network</strong>, <strong>cidr</strong>, <strong>subnetIndex</strong>).</p><p>The first parameter is the IP address space to split, the second parameter is the CIDR of the subnet and the last parameter is used to output the desired subnet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fb76f62bf0c1a9c0f07bfcf8bba0efd/href">https://medium.com/media/7fb76f62bf0c1a9c0f07bfcf8bba0efd/href</a></iframe><p>Outputs:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf3c8fc7ec0c3fd1cf7a97987bd9f5ec/href">https://medium.com/media/cf3c8fc7ec0c3fd1cf7a97987bd9f5ec/href</a></iframe><p>The output is the first subnet with CIDR /25 created from the address space. If we changed the subnetIndex from 0 to 1 it would have outputted the second subnet 192.168.1.128/25.</p><p><strong>cidrHost()</strong></p><p>The cidrHost() function calculates the usable IP addresses of the given address space. of the host with the specified index on the specified IP address range in CIDR notation. This function expects two parameters: cidrHost(<strong>network</strong>, <strong>hostIndex</strong>).</p><p>The first parameter is the IP address space and the second parameter is to output the desired host. For example, if cidrHost is called with host index 0 using address space 192.168.1.0/24 the output will be 192.168.1.1. If host index 1 is used the output will be 192.168.1.2 and so on.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/761b291ab6c24ebc1618dec248ecb012/href">https://medium.com/media/761b291ab6c24ebc1618dec248ecb012/href</a></iframe><p>Outputs:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c92436bfcff163f6466720599284e0b/href">https://medium.com/media/1c92436bfcff163f6466720599284e0b/href</a></iframe><p>This function can be valuable, for example, allowing the creation of programmatic whitelists for specific IP address ranges within a network security group or firewall. Notably, it excludes reserved IP addresses from its results.</p><h3>Subnetting a virtual network with cidrSubnet()</h3><p>Let’s put the function cidrSubnet() to the test. We aim to create a virtual network with address space 192.168.1.0/24. As we have observed in the parseCidr range output, the /24 prefix can accommodate 256 IP addresses.</p><p>To begin, we need to determine the number of subnets required. In this scenario, we’ll be working with 2 subnets, each capable of accommodating 128 addresses, denoted by a CIDR notation of /25. You can use parseCidr to calculate the amount hosts for the subnet, or you can calculate it manually using the following equation: 2^(32-25) = 2^7, which equals 128. There are various methods to calculate subnets, but this is the approach I find most straightforward.</p><p>Now let’s create the Bicep file to deploy the virtual network and two subnets with the cidrSubnet() function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44ee2d1cfd0b990ab176efb50b35dd0f/href">https://medium.com/media/44ee2d1cfd0b990ab176efb50b35dd0f/href</a></iframe><p>Let’s walk through the provided Bicep code. First, I’ve defined several parameters: parAddressSpace, parSubnetCidr, and parAmountOfSubnets. These parameters serve as inputs that can be customised when deploying the virtual network. For instance, parAddressSpace allows you to specify the preferred IP address space in CIDR notation, while parSubnetCidr lets you define the subnet CIDR prefix length, and parAmountOfSubnets sets the number of subnets to be created.</p><p>Following the parameter definitions, I’ve created a variable called varSubnetCalculations. This variable utilises the map function to generate an array of objects, each representing the properties of a subnet expected by the virtual network resource. This approach enhances code readability and simplifies the configuration of multiple subnets within the virtual network. It iterates through the specified number of subnets and computes the corresponding address prefixes using the cidrSubnet function. These subnet property objects are then used in the subnets property of the resVirtualNetwork resource, facilitating the creation of the virtual network with the desired subnets.</p><p>For clarity, this is the output of varSubnetCalculations:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/64f58babdd2c08117c3172baee3a918b/href">https://medium.com/media/64f58babdd2c08117c3172baee3a918b/href</a></iframe><p>If you want to know more about the map() function or other lambda’s check out my “ <a href="https://johnlokerse.dev/2022/09/26/azure-bicep-lambda-expressions">Azure Bicep Lambda Expressions</a> “ blog post.</p><p>When we deploy the Bicep code to Azure it creates the virtual network including the subnets:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/0*x9a7lUQmm6vA9h2L" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fjqky802iZh_AX3F" /></figure><h3>Conclusion</h3><p>This is how to leverage the Bicep CIDR functions to create subnets for your Azure networks. In this blog, I used IPv4 addresses, but the CIDR functions also work with IPv6. Subnetting has been made easier with these functions, but you will still need to think about the CIDR for the subnets.</p><p><em>Originally published at </em><a href="https://johnlokerse.dev/2023/08/21/subnetting-in-azure-bicep/"><em>http://johnlokerse.dev</em></a><em> on August 21, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94b4e41bc23d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-bicep/subnetting-in-azure-bicep-94b4e41bc23d">Subnetting in Azure Bicep</a> was originally published in <a href="https://medium.com/azure-bicep">Azure Bicep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>