| title | Bicep functions overview | ||
|---|---|---|---|
| description | Learn about the functions that can be used in a Bicep file to retrieve values, work with strings and numerics, and retrieve deployment information. | ||
| ms.topic | reference | ||
| ms.date | 09/11/2025 | ||
| ms.custom |
|
This article describes all of the functions that you can use in a Bicep file. To define custom functions, see User-defined functions. For a description of the sections in a Bicep file, see Bicep file structure and syntax.
Most functions work the same when deployed to a resource group, subscription, management group, or tenant. A few functions can't be used in all scopes. They're noted in the lists below.
All Bicep functions are contained within two namespaces - az and sys. Typically, you don't need to specify the namespace when you use the function. You specify the namespace only when the function name is the same as another item you've defined in the Bicep file. For example, if you create a parameter named range, you need to differentiate the range function by adding the sys namespace.
// Parameter contains the same name as a function
param range int
// Must use sys namespace to call the function.
// The second use of range refers to the parameter.
output result array = sys.range(1, range)The az namespace contains functions that are specific to an Azure deployment. The sys namespace contains functions that are used to construct values. The sys namespace also includes decorators for parameters and resource loops. The namespaces are noted in this article.
The any function is available in Bicep to help resolve issues around data type warnings. This function is in the sys namespace.
The following functions are available for working with arrays. All of these functions are in the sys namespace.
- array
- concat
- contains
- empty
- indexOf
- first
- flatten
- intersection
- last
- lastIndexOf
- length
- min
- max
- range
- skip
- take
- union
The following functions are available for working with CIDR. All of these functions are in the sys namespace:
The following functions are available for working with dates. All of these functions are in the sys namespace:
The following functions are available for getting values related to the deployment. All of these functions are in the az namespace:
The following functions are available for loading the content from external files into your Bicep file. All of these functions are in the sys namespace:
The following function is available for influencing execution flow. This function is in the sys namespace:
The following functions are available for working with lambda expressions. All of these functions are in the sys namespace:
The following function is available for working with logical conditions. This function is in the sys namespace:
The following functions are available for working with integers. All of these functions are in the sys namespace:
The following functions are available for working with objects. All of these functions are in the sys namespace:
The following functions are available to be used in Bicep parameters files. All of these functions are in the sys namespace:
The following functions are available for getting resource values. Most of these functions are in the az namespace. The list and getSecret functions don't have namespace qualifiers since they're named directly in the resource type:
- extensionResourceId
- getSecret
- listAccountSas
- listKeys
- listSecrets
- list*
- managementGroupResourceId
- pickZones
- providers (deprecated)
- reference
- resourceId - This can be used at any scope, but the valid parameters change depending on the scope.
- subscriptionResourceId
- tenantResourceId
- toLogicalZone
- toLogicalZones
- toPhysicalZone
- toPhysicalZones
The following functions are available for getting scope values. All of these functions are in the az namespace:
- managementGroup
- resourceGroup - This can only be used in deployments to a resource group.
- subscription - This can only be used in deployments to a resource group or subscription.
- tenant
Bicep provides the following functions for working with strings. All of these functions are in the sys namespace:
- base64
- base64ToJson
- base64ToString
- buildUri
- concat
- contains
- dataUri
- dataUriToString
- empty
- endsWith
- first
- format
- guid
- indexOf
- join
- last
- lastIndexOf
- length
- newGuid
- padLeft
- parseUri
- replace
- skip
- split
- startsWith
- string
- substring
- take
- toLower
- toUpper
- trim
- uniqueString
- uri
- uriComponent
- uriComponentToString
- To iterate a specific number of times when creating a type of resource, see Iterative loops in Bicep.
- To learn how to deploy the Bicep file you've created, see Deploy Bicep files with the Azure CLI and Azure PowerShell.