Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Azure Managed Redis
Firewall rules (preview) restrict access to the public endpoint of your Azure Managed Redis instance to specific IPv4 addresses, IPv4 CIDR ranges, or Azure service tags. Configure rules on the cluster resource, Microsoft.Cache/redisEnterprise, rather than on an individual database. Each rule specifies a name and a source address prefix that identifies which sources can connect to the Redis database ports.
These rules apply to public endpoint traffic only. They don't affect connections through Azure Private Link.
Use this feature for:
- Known application sources: Allow the IPv4 addresses or CIDR ranges used by your applications.
- Network-based access control: Maintain a complete collection of allowed sources as your network requirements change.
- Azure service sources: Use an Azure service tag instead of specifying individual address prefixes.
Important
With public network access enabled, an empty firewall rule set allows all public traffic. Removing every rule doesn't block public access. To block public endpoint traffic, disable public network access.
Limitations
- Public network access must be enabled for a non-empty rule set.
- A cluster supports up to 250 firewall rules.
- Supported sources are IPv4 addresses, IPv4 CIDR prefixes, and Azure service tags.
- Rules apply to the public endpoint and they don't restrict Private Link traffic.
- You can't combine firewall rule changes with scaling or encryption changes in the same update request. Submit those changes separately.
- Rule updates are asynchronous. Don't assume the new configuration takes effect immediately after submitting a request.
Prerequisites
- An Azure Managed Redis instance. This feature applies to Azure Managed Redis.
- Permissions to read and update the cluster through Azure Resource Manager.
- An authenticated REST client and the subscription ID, resource group name, and cluster name of your instance.
- If public network access is disabled, enable it in the same update request that supplies the non-empty firewall rule set, rather than enabling it in a separate request.
- The IPv4 addresses, CIDR ranges, or Azure service tags you want to allow.
Note
The examples use the preview REST API version 2026-10-01-preview.
How to use firewall rules
- Read the cluster's current configuration and identify every source that must retain access.
- Send a cluster update containing public network access settings and the complete desired firewall rule set.
- Wait for the update operation to complete.
- Retrieve the cluster configuration and test connectivity from your intended sources.
The following examples use the Azure public cloud Resource Manager endpoint. Replace {subscriptionId}, {resourceGroupName}, and {clusterName} with your resource details. Authenticate requests with an Azure Resource Manager access token.
Configure firewall rules
Use PATCH to configure an existing instance:
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}?api-version=2026-10-01-preview
Authorization: Bearer <access-token>
Content-Type: application/json
Supply the following JSON request body:
{
"properties": {
"publicNetworkAccess": "Enabled",
"firewallRules": [
{
"name": "allowApplicationNetwork",
"sourceAddressPrefix": "203.0.113.0/24"
},
{
"name": "allowApplicationHost",
"sourceAddressPrefix": "198.51.100.10"
}
]
}
}
The IP addresses in this article are illustrative. Replace them with the actual source addresses for your clients.
| Setting | Purpose |
|---|---|
properties.publicNetworkAccess |
Must be Enabled for a non-empty firewall rule set. |
properties.firewallRules |
The complete desired collection of rules for the cluster. |
name |
The name of a rule. |
sourceAddressPrefix |
An IPv4 address, IPv4 CIDR prefix, or Azure service tag. |
In each rule, sourceAddressPrefix is a sibling of name; it is not nested inside a rule-level properties object.
Example: Allow an Azure service tag
To use a service tag, place its name in sourceAddressPrefix. For example, this request body includes an IP-based rule and the AzureCloud service tag:
{
"properties": {
"publicNetworkAccess": "Enabled",
"firewallRules": [
{
"name": "allowApplicationNetwork",
"sourceAddressPrefix": "203.0.113.0/24"
},
{
"name": "allowAzureSources",
"sourceAddressPrefix": "AzureCloud"
}
]
}
}
Choose sources that match your access requirements. The AzureCloud example is broader than an application-specific IP address or CIDR range.
Update existing rules
Send another PATCH request to the same cluster endpoint with the complete rule collection you want to keep.
To retain one rule and replace another, for example:
{
"properties": {
"firewallRules": [
{
"name": "allowApplicationNetwork",
"sourceAddressPrefix": "203.0.113.0/24"
},
{
"name": "allowNewApplicationHost",
"sourceAddressPrefix": "198.51.100.20"
}
]
}
}
Important
A supplied firewallRules array replaces all existing rules. Rules omitted from that array are deleted. Include every rule you want to retain, not just the rules you want to add or change.
The behavior differs depending on the operation:
| Request | Result |
|---|---|
PATCH without firewallRules |
Preserves existing rules. |
PATCH with a non-empty firewallRules array |
Replaces all existing rules with the supplied collection. |
PATCH with "firewallRules": [] |
Removes all rules. |
PUT with a non-empty firewallRules array |
Replaces all existing rules with the supplied collection. |
PUT without firewallRules, or with an empty array |
Removes all rules. |
When creating a cluster through PUT, include firewallRules and publicNetworkAccess in the cluster's properties, along with the other required creation settings. The PATCH bodies in this article aren't complete cluster creation requests.
Verify the configuration
Firewall rule changes are asynchronous. A 202 Accepted response means the request was accepted, not that the rules are already applied. Follow the operation URL returned in the Azure-AsyncOperation header and respect Retry-After, when provided. Wait for a successful terminal operation status before checking connectivity.
Retrieve the cluster using the same API version:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}?api-version=2026-10-01-preview
Authorization: Bearer <access-token>
Verify that properties.publicNetworkAccess is Enabled and that properties.firewallRules contains the entire intended collection. A GET verifies the stored configuration; also open a new client connection from an allowed source to check public endpoint connectivity.
For connectivity checks, see Troubleshoot connectivity. Use your application's normal authentication and TLS settings, and ensure the test uses the public endpoint rather than a private endpoint.
Remove rules or block public access
Important
Disabling public network access deletes all existing firewall rules. Before disabling it, save any rules you might need to restore and ensure your applications have a working private connectivity path. If you later enable public access and need source restrictions, supply the desired rules again. See Azure Managed Redis with Azure Private Link.
To remove a specific rule, send a PATCH request containing all remaining rules.
To remove every rule, send this body to the same cluster endpoint:
{
"properties": {
"firewallRules": []
}
}
If public network access remains enabled, this removes the source restrictions and allows all public traffic.
To block public endpoint traffic instead, send:
{
"properties": {
"publicNetworkAccess": "Disabled"
}
}