Using Bicep source#
PSRule for Azure also supports analyzing Azure resources contained within Bicep source files.
This topic covers how to use use PSRule for Azure to validate Azure resources within Bicep source.
Source file expansion#
Bicep source files provide an additional option to define Azure resources.
Bicep provides a abstraction layer on top of Azure Resource Manager (ARM) that is more human readable.
When Azure resources are built from Bicep source files, an ARM template is generated.
PSRule for Azure automates this in memory to allow analysis of Azure resources from
Expansion of Azure resources contained within Bicep source files is supported. For details on how this works and limitations see Using templates.
In addition, currently the following limitation apply to using Bicep source files:
- The Bicep CLI must be installed.
- PSRule for Azure will only expand Bicep source files without mandatory parameters.
To modules with mandatory parameters you can exclude files by path spec.
Expand from a
main.bicepthat is intended to be deployed directly to Azure.
- Location of issues in Bicep source files is not supported.
Expansion of Bicep source files times out after 5 seconds.
To expand Azure resources for analysis from Bicep source files the Bicep CLI is required. For details on how to configure Bicep for PSRule for Azure see Setup Bicep.