Cloudflare
Manage Cloudflare DNS records, WAF custom rules and URL redirect rules from Bicep.
Community Maintained
| Version | 0.1.58 |
| Artifact | br:cloudflarebicep.azurecr.io/cloudflare:0.1.58 |
| Source | github.com/riosengineer/cloudflare-bicep-deploy |
| Publisher | riosengineer |
| Category | Networking |
Installation
Register the extension in bicepconfig.json:
{
"experimentalFeaturesEnabled": {
"localDeploy": true,
"ociEnabled": true
},
"implicitExtensions": [],
"extensions": {
"Cloudflare": "br:cloudflarebicep.azurecr.io/cloudflare:0.1.58"
}
}
Then reference it from your Bicep file:
extension Cloudflare
Configuration
Configuration is supplied using extension Cloudflare with { ... }.
| Property | Type | Attributes | Description |
|---|---|---|---|
apiKey | string | Cloudflare API Key (legacy) | |
apiToken | string | Cloudflare API Token (recommended) | |
baseUrl | string | Base URL for Cloudflare API | |
email | string | Cloudflare account email (required with API Key) |
Authentication
Set CLOUDFLARE_API_TOKEN to a Cloudflare API token before running the
deployment. Give the token only the permissions needed by the resources in the
template, such as Zone DNS Edit for DNS records or Zone Rulesets Edit for WAF
custom rules.
Example
Create a DNS record in a Cloudflare zone:
targetScope = 'local'
extension Cloudflare
param zoneId string
param domainName string
resource record 'DnsRecord' = {
name: 'www'
zoneName: domainName
zoneId: zoneId
type: 'A'
content: '192.0.2.1'
ttl: 300
proxied: true
}
Notes
- Security rules use Cloudflare WAF custom rules through the Rulesets API.
- Redirect rules use Page Rules and are subject to the limits of the Cloudflare plan associated with the zone.
- This extension is experimental and its publisher advises against production use.
Samples
3 example Bicep files are available under Samples.
Resource types
This extension exposes 4 resource types, documented under Reference.
Reference generated from cloudflarebicep.azurecr.io/cloudflare:0.1.58 on 2026-08-24.