Releases: Azure/bicep
v0.37.4
Highlights
- [Experimental] Bicep MCP server (#17519, #17572, #17607, #17712). See Using Bicep MCP Server in VS Code (Preview!) for usage information.
- [Experimental] Simplified C# authoring experience for Local Deploy extensions (#17557, #17616) - thanks @samirbanjanovic !
- See Creating a Local Extension with .NET for a minimal quickstart guide.
- GA release for the
externalInput()
function (#17470) - [Requires the
localDeploy
Experimental feature] Simplify publishing process by supporting type discovery via gRPC (#17665) - Add "format" capability to
bicep jsonrpc
(#17567) - [Requires the
moduleExtensionConfigs
Experimental feature] Extension config assignment syntax updates and module aware extension config assignment (#17389)
Breaking Changes
bicep generate-params
now preserves the specified output file extension
The command no longer overrides the output file extension when --outfile
is specified.
Previously, the command would change the output file’s extension even if one was explicitly provided. For example:
bicep generate-params main.bicep --outfile main
bicep generate-params main.bicep --outfile main.txt
would all produce main.parameters.json
, which was an unintentional behavior.
Starting with this release, the command preserves the file name exactly as specified:
bicep generate-params main.bicep --outfile main
bicep generate-params main.bicep --outfile main.txt
bicep generate-params main.bicep --outfile main.params.json
now produces main, main.txt, and main.params.json respectively.
Bugs and Features
- Use language version 2.0 for extensibility (#17714)
- Update short-circuiting linter to use nested deployment expander (#17334)
- Emit an error diagnostic when a secure output is dereferenced indirectly (#17453)
- Improve
reduce
type inference (#17574) - Add stacks extensibility linting rule. Restrict syntax on config assignments. (#17654)
- Add control bar for visual designer (#17518)
- Remove deprecated CLI arguments (#17564)
Community Contributions
- Update params-file-grammar.md (#17510) - thanks @rgant !
- Add linter rule to warn on usage of outdated AzPowerShell version in deployment scripts (#17556) - thanks @guimatheus92 !
- Added references to the Azure Verified Module website and bicep-registry-module repository (#17664) - thanks @johnlokerse !
v0.36.177
Highlights
- Add Identity Snippets for Resources (#17335)
- Update Bicep linter diagnostics to point to https://aka.ms/bicep/linter-diagnostics (#17390)
- Mark conditional resources as nullable for the purposes of property access (#16987)
- Typing improvements for extensions (#17242)
Features and Bug Fixes
- Handle union type properly in use-secure-value-for-secure-inputs rule (#17372)
- Update Azure.Deployments.Templates to latest (#17375)
- Fix extension collection reference codegen (#17381)
- Detect usage of fully-qualified non-deterministic functions in resource identifiers (#17505)
- Remove auxiliary file size limit for local deploy (#17506)
- Add (WIP) visual designer and resource type explorer apps (#17503)
- Add DeployTimeConstant Flag for Module Identity (#17383)
- Support ES target for highlight.js (#17285)
- Only use
listOutputsWithSecureValues
to dereference secure outputs (#17423)
Snapshot command
- Add support for null-valued parameters to snapshot command (#17291)
- Use the target scope of the template file as the target scope of a params file (#17292)
- Surface cross-module validation errors in snapshot command as messages, not unhandled exceptions (#17378)
- Enable speculative reference evaluation in snapshot helper (#17512)
Community Contributions
- Correct Param & Var Declarations (#17511) - thanks @rgant !
- Add Dependabot configuration for .NET SDK updates (#17424) - thanks @JamieMagee !
- Type definition code base and associated unit tests (#17391) - thanks @samirbanjanovic !
v0.36.1
Highlights
- GA release for optional types in variables (#17055)
// current variable syntax var foo = 'hello' // new variable syntax with optional type var foo string = 'hello'
- Add
userPrincipalName
todeployer()
function return type (#17099)
Example usage:var myUser = deployer().userPrincipalName
- [Experimental] New CLI command group
bicep snapshot
for snapshot validation. See Using thesnapshot
command for usage information. - [Experimental] Local Deploy: Various improvements to support end-to-end scenarios (#17048, #17195, #17234, #17235, #17095)
- [Requires the
moduleIdentity
Experimental feature] Support identity assignments on modules (#17150, #17233)
Example usage:Note that this is introduced for future capabilities, and is not currently supported by the backend service.param identityId string module mod './module.bicep' = { identity: { type: 'UserAssigned' userAssignedIdentities: { '${identityId}': {} } } }
- Bicep Extensibility feature flag has been removed (#17094)
Documentation available at Use Bicep Extensions
Fixes
- Fix completions for function arguments (#17146)
- Enable decompilation of KV reference in parameters json (#17196)
- Allow outer variable completions in user-defined functions (#17198)
- Handle case insensitive name clashes for imported variable, func, and type symbols (#17200)
- Add value bounds to loop index variable (#17201)
- Raise error diagnostic on ambiguous scope (#17202)
- Fix F12 for imported symbols from oci modules (#16941)
use-secure-value-for-secure-inputs
linter rule: Remove some false positives (#17107)- adding cases to handle user defined typed params (#16864)
- adding completion support for 'extends' keyword (#17194)
- Fix F12 for imported symbols from oci modules (#16941)
Community Contributions
- Add linter rule to warn on unused compile-time imports (#16990) - thanks @GABRIELNGBTUC !
- Disable linter rule "Maximum number of variables used" when the file does not contain declarations used in files meant to deployed and variables are exported (#17149) - thanks @GABRIELNGBTUC !
v0.35.1
Highlights
-
GA release for the
@secure()
decorator on module outputs! You can now output secure values from a child module and read them in a parent module. (#16796) -
Visual Studio Bicep extension support for
.bicepparam
files! (#16861) -
New functions for working with URIs -
parseUri()
andbuildUri()
(#16802)
Example usage:/* Returns { scheme: 'https' host: 'example.com' port: 1234 path: '/foo/bar' } */ output parsedUri object = parseUri('https://example.com:1234/foo/bar') /* Returns: 'https://example.com:1234/foo/bar' */ output builtUri string = buildUri({ scheme: 'https' host: 'example.com' port: 1234 path: 'foo/bar' })
-
New functions for working with Availaiblity Zones (#16985)
toLogicalZone()
- converts physical zones to logical zonestoPhysicalZone()
- converts logical zones to physical zones- Array versions for bulk conversions (toLogicalZones() & toPhysicalZones())
var subscriptionId = subscription().subscriptionId var location = 'westus2' /* Returns the physical AZ corresponding to the specified logical AZ in the specified subscription and location. For westus2 location, this will be one of 'westus2-az1', 'westus2-az2', 'westus2-az3' depending on the subscription. */ output singlePhysicalZone string = toPhysicalZone(subscriptionId, location, '1') /* Returns an array of physical AZs corresponding to the specified logical AZs in the specified subscription and location. */ output physicalZones string[] = toPhysicalZones(subscriptionId, location, ['1', '2']) /* Returns the logical AZ corresponding to the specified physical AZ in the specified subscription and location. Returns '1', '2', or '3' depending on the subscription. */ output singleLogicalZone string = toLogicalZone(subscriptionId, location, 'westus2-az2') /* Returns an array of logical AZs corresponding to the specified physical AZs in the specified subscription and location. */ output logicalZones string[] = toLogicalZones(subscriptionId, location, [ 'westus2-az1' 'westus2-az2' ])
-
use-secure-value-for-secure-inputs
linter rule: Use resource type information to catch more unsafe passing of non-secure values (#16873) -
[requires the
onlyIfNotExists
experimental feature] Resource Existence Checks using@onlyIfNotExists()
decorator (#16655)
Attaching this decorator to a resource declaration means deployment of the resource will only take place if it hasn't already been deployed. Example usage:@onlyIfNotExists() resource onlyDeployIfNotExists 'Microsoft...' = { name: 'example' location: 'eastus' properties: { ... } }
-
[requires the
typedVariables
experimental feature] Support importing and declaring types in .bicepparam files with typedVariables decorator (#16929)- Allow usage of the type keyword in .bicepparam files
- Allow importing types from .bicep files in .bicepparam files
- Allow usage of inline types in .bicepparam files
-
[requires the
externalInputFunction
experimental feature] External Input function -externalInput
function to allow reading input that will be resolved later by external tooling in order to inject values at deployment time. (#16726)
Bugs and Features
- Decompiler support for user-defined functions (#16883)
use-parent-property
linter rule: Fix incorrect warning with blobContainer and fileShare (#16738)- Raise diagnostic for unsupported usage of spread (#16739)
- Add friendly name to Playground link (#16803)
- Revert #16442 - Fixed bug VSCode extension does not read values from parameter file (#16789)
no-hardcoded-env-urls
linter rule: Remove URLs not present inenvironment()
function output (#16863)- Fix for intellisense of symbols inside import statement (#16936)
- fixing
dotnet format
issues, and addressingIDE0305: Collection initialization can be simplified
errors/warnings (#16808) - Use symbolic name for list function calls (#16862)
- Enhance
substring
type inference - updated parameter types for substring to infer acceptable ranges based on the other arguments provided to the function. (#16859) - Prevent infinite recursion during type narrowing (#17028)
- Fix command binding comment in bicepconfig.json (#16807)
use-resource-id-functions
linter rule: Set to off by default (#16869)
.bicepparam Bug Fixes
- Suggest the experimental feature on the extends keyword for extendableparamfiles (#16744)
- adding checks to ensure the given file exists before building the bicepparam file (#16742)
- Clarifying parameter file generation logic and error message (#16662)
Local Deploy
- Local Deploy: process kill should be best-effort only (#16786)
- Local Deploy: Support deploying Azure modules (#16752)
- Local Deploy: Support long-running operations for local and Azure modules (#16797)
- Documentation: Replace deploy pane content with link to MSDocs (#16736)
- Local deploy: ensure languageversion 2.2-experimental emitting is enabled (#16945)
Community Contributions
v0.34.44
Features and Bug Fixes
- Use languageVersion 2.0 when an existing resource has an explicit dependency (#16670)
- Validate regex patterns against non-backtracking engine (#16687)
- Generate deterministic dependsOn (#16668)
- Add more detailed information about local-deploy (#16677)
- Add more info on implementing extensions for local-deploy (#16678)
- Add name pattern validation for modules (#16680)
- Add Desired State Configuration target scope and experimental feature flag (#16389) - thanks @andyleejordan !
v0.34.1
Highlights
- Optional Module Names GA (#16518)
module storage 'storageaccount.bicep' = { // no need to specify a name here! scope: rg params: { location: location sku: skuProd } }
- Experimental support for typed variables (#16451) using the feature flag "typedVariables"
// an optional type can be added to a variable declaration statement. // current syntax var foo = 'hello' // with optional type var foo string = 'hello'
- Resource Derived Types GA (#16517)
param storageSkuName resourceInput<'Microsoft.Storage/storageAccounts@2024-01-01'>.sku.name output storageEndpoints resourceOutput<'Microsoft.Storage/storageAccounts@2024-01-01'>.properties.primaryEndpoints = ...
- ACR Private Module Completions (#16051)
- Add Notepad++ Bicep Syntax Highlighting Information (#16506) - thanks @richardsondev !
Bug Fixes and Features
secure-secrets-in-params
: Flag insecure references to secure params (#16251)- Add code action to suggest multi-line strings (#16296)
- Handle decompilation of variable-defined API version correctly (#16384)
- Support dark + light mode in the Bicep playground (#16388)
- Support for validating inputs in deploy pane (#16442)
- Add the --pattern CLI argument for faster batch operations on multiple files (#16456)
# build all .bicep files under current path bicep build --pattern './**/*.bicep' # build all .bicepparam files under current path bicep build-params --pattern './**/*.bicepparam' # format all .bicep files under current path bicep format --pattern './**/*.bicep*' # lint all .bicep files under current path bicep lint --pattern './**/*.bicep' # restore modules for all .bicep files under current path bicep restore --pattern './**/*.bicep'
- Fix for completions inside object (#16558)
- Imported functions invoked in .bicepparam files can refer to variables from their source template (#16322)
- Emit an info-level diagnostic on safe access of undeclared property (#16327)
- Forward base-type errors when accessing type properties (#16394)
- Allow duplicated resources (by name) if at most one is unconditional (#15909)
- Index from end operator (
[^]
) (#16104)param foo string[] var lastElement = foo[^1] var secondLastElement = foo[^2]
- Partially parse function calls with no closing paren (#16508)
- Fix 13606, stuck in ext-src loop (#16381)
v0.33.93
Highlights
- Address v0.33.13 language server crash/stack overflow (#16235)
- Address v0.33.13 deployment failures when depending on looped resources in non-symbolic name templates (#16236)
- Release Deployment Pane as a non-experimental feature (#16173)
Other bugs and features
- Offer code fix to fully qualify function call for shadowed decorator functions (#16116)
v0.33.13
Highlights
-
Add
resourceInput<>
andresourceOutput<>
utility types (#15825)
We've added two new utility types (resourceInput<> and resourceOutput<>), which deprecates the existing resource<> utility types. These three utility types are all closely related but differ in which property flags they surface:resource<>
has the flags that were originally defined in the RP types artifact. This is generally not what people want.resourceInput<>
strips out all WriteOnly flags. This means that template authors can access properties on a resourceInput<>-typed parameter that would have previously raised a BCP077 diagnostic.resourceOutput<>
strips out all ReadOnly flags.
-
Expose
fail
function (#15958) This function takes a single string argument, whose value is the message of the error that will be raised.
param storageAccountData object
resource a 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: !empty(storageAccountData.?name) ? toLower(storageAccountData.name) : fail('No storage account name was provided')
Other bugs and features
- extendable param files add a warning when referencing to a non-existent .bicepparam file (#15338)
- adding support for variables, objects and arrays in extended param files (#15834)
- Refactor and simplify handling of single quotes in module completions (#15913)
use-safe-access
linter rule: Expand to check for nullable properties (#15838)- Fix for WhatIf results not showing up properly in the deploy pane (#16048)
- Support object property name completions in lambda body syntax (#16055)
- MS Graph type provider warns on property mismatch (#15824)
- Fix unhandled exception in import closure calculation (#15833)
- Validate type clauses in UDFs (#15842)
- Allow exports of symbols that share a name with an output (#15899)
- Catch recursion in parameterized type invocations (#15903)
- Use fully qualified symbolic name as copy loop name (#15910)
- Include imported variables in max variables check (#15956)
- Rename Bicep.IO package to Azure.Bicep.IO (#16046)
- Validate that type expressions that will be compiled to ARM schema nodes can be expressed in ARM's type system prior to compilation (#15901)
- SecureOutput Feature Bug Fix (#16108)
- Allow accessing generated module names (#16058)
- Deprecate the term
provider
(#16107) - Fix linter discrepancies when optional module name is enabled (#16106)
- Emit symbolic name template when an optional module name is enabled. (#16114)
- Fix BCP159 to check existence of any nested resources (#15988)
- Decompile-params: Resolve bicep file path relative to current directory (#15986)
- Add AdditionalPropertiesDescription property to ObjectType (#15990)
v0.32.4
Highlights
- New
deployer()
function to retrieve ObjectId of the principal that is deploying the Bicep file (#15340)
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
// can be used to help make GUID unique
name: guid(deployer().objectId, readerRoleDefinitionId, resourceGroup().id)
properties: {
principalId: deployer().objectId // easily retrieve objectId
roleDefinitionId: readerRoleDefinitionId
}
}
- Support partial public registry completions (#15646). Previously, if typing the entire module reference, you would lose completions after typing a
/
Other bugs and features
Bicep team:
- Support deploying to other clouds in Deploy Pane (#15635) - thank you @alaskascooter for filing
- Only add an explicit dependency on an existing resource when the deployments engine will use the GET response (#15693) - thank you @AleksandrKomarov for filing
- Move all indexing expressions when calculating
dependsOn
expressions (#15580) - thank you @slavizh for filing - Local Deploy: Support null for InnerError field (#15583)
- InsertResource - correctly strip read-only properties (#15689)
- MS Graph type loader accepts resource identifier property flag (#15518)
- Fixed stack overflow when requesting completion in an object literal (#15579)
- Use vscode authentication instead of Azure Account extension (#15403)
- Move deploy-pane to
vscode-bicep-ui
(#15584) - Emit type and apiVersion separately for local and v2 ext resources (#15762)
- Update
jsonrpc.test.ts
reference (#15657)
- Add case-insensitive equality operators to grammar (#15640)
v0.31.92
Features and bug fixes
- Revert "Only add an explicit dependency on an existing resource when the deployments engine will use the GET response" (#15524)
- Don't collapse scope references or namespaces into objects (#15570)
- allow
using none
statements in bicepparam files atbuild-params
command (#15107) -- thanks @polatengin!