Creates or updates the specified FirewallPolicyRuleCollectionGroup.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}?api-version=2026-01-01
URI Parameters
| Name |
In |
Required |
Type |
Description |
|
firewallPolicyName
|
path |
True
|
string
|
The name of the Firewall Policy.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
The name of the resource group. The name is case insensitive.
|
|
ruleCollectionGroupName
|
path |
True
|
string
|
The name of the resource that is unique within a resource group. This name can be used to access the resource.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
The ID of the target subscription. The value must be an UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
The API version to use for this operation.
|
Request Body
| Name |
Type |
Description |
|
id
|
string
|
Resource ID.
|
|
name
|
string
|
Name of the resource.
|
|
properties.priority
|
integer
(int32)
minimum: 100 maximum: 65000
|
Priority of the Firewall Policy Rule Collection Group resource.
|
|
properties.ruleCollections
|
FirewallPolicyRuleCollection[]:
|
Group of Firewall Policy rule collections.
|
Responses
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name |
Description |
|
user_impersonation
|
impersonate your user account
|
Examples
Create Firewall Policy Nat Rule Collection Group
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1?api-version=2026-01-01
{
"properties": {
"priority": 100,
"ruleCollections": [
{
"name": "Example-Nat-Rule-Collection",
"action": {
"type": "DNAT"
},
"priority": 100,
"ruleCollectionType": "FirewallPolicyNatRuleCollection",
"rules": [
{
"name": "nat-rule1",
"destinationAddresses": [
"152.23.32.23"
],
"destinationPorts": [
"8080"
],
"ipProtocols": [
"TCP",
"UDP"
],
"ruleType": "NatRule",
"sourceAddresses": [
"2.2.2.2"
],
"sourceIpGroups": [],
"translatedFqdn": "internalhttp.server.net",
"translatedPort": "8080"
}
]
}
]
}
}
import com.azure.resourcemanager.network.fluent.models.FirewallPolicyRuleCollectionGroupInner;
import com.azure.resourcemanager.network.models.FirewallPolicyNatRuleCollection;
import com.azure.resourcemanager.network.models.FirewallPolicyNatRuleCollectionAction;
import com.azure.resourcemanager.network.models.FirewallPolicyNatRuleCollectionActionType;
import com.azure.resourcemanager.network.models.FirewallPolicyRuleNetworkProtocol;
import com.azure.resourcemanager.network.models.NatRule;
import java.util.Arrays;
/**
* Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-01-01/FirewallPolicyNatRuleCollectionGroupPut.json
*/
/**
* Sample code: Create Firewall Policy Nat Rule Collection Group.
*
* @param manager Entry point to NetworkManager.
*/
public static void
createFirewallPolicyNatRuleCollectionGroup(com.azure.resourcemanager.network.NetworkManager manager) {
manager.serviceClient().getFirewallPolicyRuleCollectionGroups().createOrUpdate("rg1", "firewallPolicy",
"ruleCollectionGroup1",
new FirewallPolicyRuleCollectionGroupInner().withPriority(100)
.withRuleCollections(Arrays.asList(new FirewallPolicyNatRuleCollection()
.withName("Example-Nat-Rule-Collection").withPriority(100)
.withAction(new FirewallPolicyNatRuleCollectionAction()
.withType(FirewallPolicyNatRuleCollectionActionType.DNAT))
.withRules(Arrays.asList(new NatRule().withName("nat-rule1")
.withIpProtocols(
Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP, FirewallPolicyRuleNetworkProtocol.UDP))
.withSourceAddresses(Arrays.asList("2.2.2.2"))
.withDestinationAddresses(Arrays.asList("152.23.32.23"))
.withDestinationPorts(Arrays.asList("8080")).withTranslatedPort("8080")
.withSourceIpGroups(Arrays.asList()).withTranslatedFqdn("internalhttp.server.net"))))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python firewall_policy_nat_rule_collection_group_put.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.firewall_policy_rule_collection_groups.begin_create_or_update(
resource_group_name="rg1",
firewall_policy_name="firewallPolicy",
rule_collection_group_name="ruleCollectionGroup1",
parameters={
"properties": {
"priority": 100,
"ruleCollections": [
{
"action": {"type": "DNAT"},
"name": "Example-Nat-Rule-Collection",
"priority": 100,
"ruleCollectionType": "FirewallPolicyNatRuleCollection",
"rules": [
{
"destinationAddresses": ["152.23.32.23"],
"destinationPorts": ["8080"],
"ipProtocols": ["TCP", "UDP"],
"name": "nat-rule1",
"ruleType": "NatRule",
"sourceAddresses": ["2.2.2.2"],
"sourceIpGroups": [],
"translatedFqdn": "internalhttp.server.net",
"translatedPort": "8080",
}
],
}
],
}
},
).result()
print(response)
# x-ms-original-file: 2026-01-01/FirewallPolicyNatRuleCollectionGroupPut.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v12"
)
// Generated from example definition: 2026-01-01/FirewallPolicyNatRuleCollectionGroupPut.json
func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyNatRuleCollectionGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{
Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
Priority: to.Ptr[int32](100),
RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
&armnetwork.FirewallPolicyNatRuleCollection{
Name: to.Ptr("Example-Nat-Rule-Collection"),
Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{
Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT),
},
Priority: to.Ptr[int32](100),
RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection),
Rules: []armnetwork.FirewallPolicyRuleClassification{
&armnetwork.NatRule{
Name: to.Ptr("nat-rule1"),
DestinationAddresses: []*string{
to.Ptr("152.23.32.23"),
},
DestinationPorts: []*string{
to.Ptr("8080"),
},
IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{
to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP),
to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP),
},
RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule),
SourceAddresses: []*string{
to.Ptr("2.2.2.2"),
},
SourceIPGroups: []*string{},
TranslatedFqdn: to.Ptr("internalhttp.server.net"),
TranslatedPort: to.Ptr("8080"),
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{
// FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{
// Name: to.Ptr("ruleCollectionGroup1"),
// Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"),
// Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
// Priority: to.Ptr[int32](100),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
// &armnetwork.FirewallPolicyNatRuleCollection{
// Name: to.Ptr("Example-Nat-Rule-Collection"),
// Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{
// Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT),
// },
// Priority: to.Ptr[int32](100),
// RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection),
// Rules: []armnetwork.FirewallPolicyRuleClassification{
// &armnetwork.NatRule{
// Name: to.Ptr("nat-rule1"),
// DestinationAddresses: []*string{
// to.Ptr("152.23.32.23"),
// },
// DestinationPorts: []*string{
// to.Ptr("8080"),
// },
// IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{
// to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP),
// to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP),
// },
// RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule),
// SourceAddresses: []*string{
// to.Ptr("2.2.2.2"),
// },
// SourceIPGroups: []*string{
// },
// TranslatedFqdn: to.Ptr("internalhttp.server.net"),
// TranslatedPort: to.Ptr("8080"),
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates the specified FirewallPolicyRuleCollectionGroup.
*
* @summary creates or updates the specified FirewallPolicyRuleCollectionGroup.
* x-ms-original-file: 2026-01-01/FirewallPolicyNatRuleCollectionGroupPut.json
*/
async function createFirewallPolicyNatRuleCollectionGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.firewallPolicyRuleCollectionGroups.createOrUpdate(
"rg1",
"firewallPolicy",
"ruleCollectionGroup1",
{
priority: 100,
ruleCollections: [
{
name: "Example-Nat-Rule-Collection",
action: { type: "DNAT" },
priority: 100,
ruleCollectionType: "FirewallPolicyNatRuleCollection",
rules: [
{
name: "nat-rule1",
destinationAddresses: ["152.23.32.23"],
destinationPorts: ["8080"],
ipProtocols: ["TCP", "UDP"],
ruleType: "NatRule",
sourceAddresses: ["2.2.2.2"],
sourceIpGroups: [],
translatedFqdn: "internalhttp.server.net",
translatedPort: "8080",
},
],
},
],
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "ruleCollectionGroup1",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1",
"properties": {
"priority": 100,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Nat-Rule-Collection",
"action": {
"type": "DNAT"
},
"priority": 100,
"ruleCollectionType": "FirewallPolicyNatRuleCollection",
"rules": [
{
"name": "nat-rule1",
"destinationAddresses": [
"152.23.32.23"
],
"destinationPorts": [
"8080"
],
"ipProtocols": [
"TCP",
"UDP"
],
"ruleType": "NatRule",
"sourceAddresses": [
"2.2.2.2"
],
"sourceIpGroups": [],
"translatedFqdn": "internalhttp.server.net",
"translatedPort": "8080"
}
]
}
]
}
}
{
"name": "firewallPolicy",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy",
"properties": {
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Nat-Rule-Collection",
"action": {
"type": "DNAT"
},
"priority": 100,
"ruleCollectionType": "FirewallPolicyNatRuleCollection",
"rules": [
{
"name": "nat-rule1",
"destinationAddresses": [
"152.23.32.23"
],
"destinationPorts": [
"8080"
],
"ipProtocols": [
"TCP",
"UDP"
],
"ruleType": "NatRule",
"sourceAddresses": [
"2.2.2.2"
],
"sourceIpGroups": [],
"translatedFqdn": "internalhttp.server.net",
"translatedPort": "8080"
}
]
}
]
}
}
Create Firewall Policy Rule Collection Group
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1?api-version=2026-01-01
{
"properties": {
"priority": 100,
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"priority": 100,
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "network-rule1",
"destinationAddresses": [
"*"
],
"destinationPorts": [
"*"
],
"ipProtocols": [
"TCP"
],
"ruleType": "NetworkRule",
"sourceAddresses": [
"10.1.25.0/24"
],
"sourceGeoLocations": [
"CA",
"US"
],
"destinationGeoLocations": [
"US"
]
}
]
}
]
}
}
import com.azure.resourcemanager.network.fluent.models.FirewallPolicyRuleCollectionGroupInner;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollection;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionAction;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionActionType;
import com.azure.resourcemanager.network.models.FirewallPolicyRuleNetworkProtocol;
import com.azure.resourcemanager.network.models.NetworkRule;
import java.util.Arrays;
/**
* Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupPut.json
*/
/**
* Sample code: Create Firewall Policy Rule Collection Group.
*
* @param manager Entry point to NetworkManager.
*/
public static void
createFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.network.NetworkManager manager) {
manager.serviceClient().getFirewallPolicyRuleCollectionGroups().createOrUpdate("rg1", "firewallPolicy",
"ruleCollectionGroup1",
new FirewallPolicyRuleCollectionGroupInner().withPriority(100)
.withRuleCollections(Arrays.asList(new FirewallPolicyFilterRuleCollection()
.withName("Example-Filter-Rule-Collection").withPriority(100)
.withAction(new FirewallPolicyFilterRuleCollectionAction()
.withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
.withRules(Arrays.asList(new NetworkRule().withName("network-rule1")
.withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP))
.withSourceAddresses(Arrays.asList("10.1.25.0/24")).withDestinationAddresses(Arrays.asList("*"))
.withDestinationPorts(Arrays.asList("*")).withSourceGeoLocations(Arrays.asList("CA", "US"))
.withDestinationGeoLocations(Arrays.asList("US")))))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python firewall_policy_rule_collection_group_put.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.firewall_policy_rule_collection_groups.begin_create_or_update(
resource_group_name="rg1",
firewall_policy_name="firewallPolicy",
rule_collection_group_name="ruleCollectionGroup1",
parameters={
"properties": {
"priority": 100,
"ruleCollections": [
{
"action": {"type": "Deny"},
"name": "Example-Filter-Rule-Collection",
"priority": 100,
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"destinationAddresses": ["*"],
"destinationGeoLocations": ["US"],
"destinationPorts": ["*"],
"ipProtocols": ["TCP"],
"name": "network-rule1",
"ruleType": "NetworkRule",
"sourceAddresses": ["10.1.25.0/24"],
"sourceGeoLocations": ["CA", "US"],
}
],
}
],
}
},
).result()
print(response)
# x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupPut.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v12"
)
// Generated from example definition: 2026-01-01/FirewallPolicyRuleCollectionGroupPut.json
func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{
Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
Priority: to.Ptr[int32](100),
RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
&armnetwork.FirewallPolicyFilterRuleCollection{
Name: to.Ptr("Example-Filter-Rule-Collection"),
Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{
Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny),
},
Priority: to.Ptr[int32](100),
RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection),
Rules: []armnetwork.FirewallPolicyRuleClassification{
&armnetwork.Rule{
Name: to.Ptr("network-rule1"),
DestinationAddresses: []*string{
to.Ptr("*"),
},
DestinationPorts: []*string{
to.Ptr("*"),
},
IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{
to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP),
},
RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule),
SourceAddresses: []*string{
to.Ptr("10.1.25.0/24"),
},
SourceGeoLocations: []*string{
to.Ptr("CA"),
to.Ptr("US"),
},
DestinationGeoLocations: []*string{
to.Ptr("US"),
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{
// FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{
// Name: to.Ptr("ruleCollectionGroup1"),
// Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"),
// Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
// Priority: to.Ptr[int32](100),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
// &armnetwork.FirewallPolicyFilterRuleCollection{
// Name: to.Ptr("Example-Filter-Rule-Collection"),
// Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{
// Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny),
// },
// Priority: to.Ptr[int32](100),
// RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection),
// Rules: []armnetwork.FirewallPolicyRuleClassification{
// &armnetwork.Rule{
// Name: to.Ptr("network-rule1"),
// DestinationAddresses: []*string{
// to.Ptr("*"),
// },
// DestinationPorts: []*string{
// to.Ptr("*"),
// },
// IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{
// to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP),
// },
// RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule),
// SourceAddresses: []*string{
// to.Ptr("10.1.25.0/24"),
// },
// SourceGeoLocations: []*string{
// to.Ptr("CA"),
// to.Ptr("US"),
// },
// DestinationGeoLocations: []*string{
// to.Ptr("US"),
// },
// },
// },
// },
// },
// Size: to.Ptr("1.2MB"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates the specified FirewallPolicyRuleCollectionGroup.
*
* @summary creates or updates the specified FirewallPolicyRuleCollectionGroup.
* x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupPut.json
*/
async function createFirewallPolicyRuleCollectionGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.firewallPolicyRuleCollectionGroups.createOrUpdate(
"rg1",
"firewallPolicy",
"ruleCollectionGroup1",
{
priority: 100,
ruleCollections: [
{
name: "Example-Filter-Rule-Collection",
action: { type: "Deny" },
priority: 100,
ruleCollectionType: "FirewallPolicyFilterRuleCollection",
rules: [
{
name: "network-rule1",
destinationAddresses: ["*"],
destinationPorts: ["*"],
ipProtocols: ["TCP"],
ruleType: "NetworkRule",
sourceAddresses: ["10.1.25.0/24"],
sourceGeoLocations: ["CA", "US"],
destinationGeoLocations: ["US"],
},
],
},
],
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "ruleCollectionGroup1",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1",
"properties": {
"priority": 100,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"priority": 100,
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "network-rule1",
"destinationAddresses": [
"*"
],
"destinationPorts": [
"*"
],
"ipProtocols": [
"TCP"
],
"ruleType": "NetworkRule",
"sourceAddresses": [
"10.1.25.0/24"
],
"sourceGeoLocations": [
"CA",
"US"
],
"destinationGeoLocations": [
"US"
]
}
]
}
],
"size": "1.2MB"
}
}
{
"name": "firewallPolicy",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy",
"properties": {
"priority": 100,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"priority": 100,
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "network-rule1",
"destinationAddresses": [
"*"
],
"destinationPorts": [
"*"
],
"ipProtocols": [
"TCP"
],
"ruleType": "NetworkRule",
"sourceAddresses": [
"10.1.25.0/24"
],
"sourceGeoLocations": [
"CA",
"US"
],
"destinationGeoLocations": [
"US"
]
}
]
}
],
"size": "1.2MB"
}
}
Sample request
PUT https://management.azure.com/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1?api-version=2026-01-01
{
"properties": {
"priority": 110,
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Allow"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "rule1",
"description": "Insert trusted tenants header",
"fqdnTags": [
"WindowsVirtualDesktop"
],
"httpHeadersToInsert": [
{
"headerName": "Restrict-Access-To-Tenants",
"headerValue": "contoso.com,fabrikam.onmicrosoft.com"
}
],
"protocols": [
{
"port": 80,
"protocolType": "Http"
}
],
"ruleType": "ApplicationRule",
"sourceAddresses": [
"216.58.216.164",
"10.0.0.0/24"
]
}
]
}
]
}
}
import com.azure.resourcemanager.network.fluent.models.FirewallPolicyRuleCollectionGroupInner;
import com.azure.resourcemanager.network.models.ApplicationRule;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollection;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionAction;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionActionType;
import com.azure.resourcemanager.network.models.FirewallPolicyHttpHeaderToInsert;
import com.azure.resourcemanager.network.models.FirewallPolicyRuleApplicationProtocol;
import com.azure.resourcemanager.network.models.FirewallPolicyRuleApplicationProtocolType;
import java.util.Arrays;
/**
* Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json
*/
/**
* Sample code: Create Firewall Policy Rule Collection Group With http header to insert.
*
* @param manager Entry point to NetworkManager.
*/
public static void createFirewallPolicyRuleCollectionGroupWithHttpHeaderToInsert(
com.azure.resourcemanager.network.NetworkManager manager) {
manager.serviceClient().getFirewallPolicyRuleCollectionGroups()
.createOrUpdate("rg1", "firewallPolicy", "ruleCollectionGroup1",
new FirewallPolicyRuleCollectionGroupInner().withPriority(110)
.withRuleCollections(Arrays
.asList(new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection")
.withAction(new FirewallPolicyFilterRuleCollectionAction()
.withType(FirewallPolicyFilterRuleCollectionActionType.ALLOW))
.withRules(Arrays.asList(
new ApplicationRule().withName("rule1").withDescription("Insert trusted tenants header")
.withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
.withProtocols(Arrays.asList(new FirewallPolicyRuleApplicationProtocol()
.withProtocolType(FirewallPolicyRuleApplicationProtocolType.HTTP).withPort(80)))
.withFqdnTags(Arrays.asList("WindowsVirtualDesktop"))
.withHttpHeadersToInsert(Arrays.asList(new FirewallPolicyHttpHeaderToInsert()
.withHeaderName("Restrict-Access-To-Tenants")
.withHeaderValue("contoso.com,fabrikam.onmicrosoft.com"))))))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python firewall_policy_rule_collection_group_with_http_headers_to_insert.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.firewall_policy_rule_collection_groups.begin_create_or_update(
resource_group_name="rg1",
firewall_policy_name="firewallPolicy",
rule_collection_group_name="ruleCollectionGroup1",
parameters={
"properties": {
"priority": 110,
"ruleCollections": [
{
"action": {"type": "Allow"},
"name": "Example-Filter-Rule-Collection",
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"description": "Insert trusted tenants header",
"fqdnTags": ["WindowsVirtualDesktop"],
"httpHeadersToInsert": [
{
"headerName": "Restrict-Access-To-Tenants",
"headerValue": "contoso.com,fabrikam.onmicrosoft.com",
}
],
"name": "rule1",
"protocols": [{"port": 80, "protocolType": "Http"}],
"ruleType": "ApplicationRule",
"sourceAddresses": ["216.58.216.164", "10.0.0.0/24"],
}
],
}
],
}
},
).result()
print(response)
# x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v12"
)
// Generated from example definition: 2026-01-01/FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json
func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithHttpHeaderToInsert() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{
Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
Priority: to.Ptr[int32](110),
RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
&armnetwork.FirewallPolicyFilterRuleCollection{
Name: to.Ptr("Example-Filter-Rule-Collection"),
Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{
Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeAllow),
},
RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection),
Rules: []armnetwork.FirewallPolicyRuleClassification{
&armnetwork.ApplicationRule{
Name: to.Ptr("rule1"),
Description: to.Ptr("Insert trusted tenants header"),
FqdnTags: []*string{
to.Ptr("WindowsVirtualDesktop"),
},
HTTPHeadersToInsert: []*armnetwork.FirewallPolicyHTTPHeaderToInsert{
{
HeaderName: to.Ptr("Restrict-Access-To-Tenants"),
HeaderValue: to.Ptr("contoso.com,fabrikam.onmicrosoft.com"),
},
},
Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{
{
Port: to.Ptr[int32](80),
ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTP),
},
},
RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule),
SourceAddresses: []*string{
to.Ptr("216.58.216.164"),
to.Ptr("10.0.0.0/24"),
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{
// FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{
// Name: to.Ptr("ruleCollectionGroup1"),
// Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
// ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"),
// Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
// Priority: to.Ptr[int32](110),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
// &armnetwork.FirewallPolicyFilterRuleCollection{
// Name: to.Ptr("Example-Filter-Rule-Collection"),
// Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{
// Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeAllow),
// },
// RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection),
// Rules: []armnetwork.FirewallPolicyRuleClassification{
// &armnetwork.ApplicationRule{
// Name: to.Ptr("rule1"),
// Description: to.Ptr("Insert trusted tenants header"),
// FqdnTags: []*string{
// to.Ptr("WindowsVirtualDesktop"),
// },
// HTTPHeadersToInsert: []*armnetwork.FirewallPolicyHTTPHeaderToInsert{
// {
// HeaderName: to.Ptr("Restrict-Access-To-Tenants"),
// HeaderValue: to.Ptr("contoso.com,fabrikam.onmicrosoft.com"),
// },
// },
// Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{
// {
// Port: to.Ptr[int32](80),
// ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTP),
// },
// },
// RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule),
// SourceAddresses: []*string{
// to.Ptr("216.58.216.164"),
// to.Ptr("10.0.0.0/24"),
// },
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates the specified FirewallPolicyRuleCollectionGroup.
*
* @summary creates or updates the specified FirewallPolicyRuleCollectionGroup.
* x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json
*/
async function createFirewallPolicyRuleCollectionGroupWithHttpHeaderToInsert() {
const credential = new DefaultAzureCredential();
const subscriptionId = "e747cc13-97d4-4a79-b463-42d7f4e558f2";
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.firewallPolicyRuleCollectionGroups.createOrUpdate(
"rg1",
"firewallPolicy",
"ruleCollectionGroup1",
{
priority: 110,
ruleCollections: [
{
name: "Example-Filter-Rule-Collection",
action: { type: "Allow" },
ruleCollectionType: "FirewallPolicyFilterRuleCollection",
rules: [
{
name: "rule1",
description: "Insert trusted tenants header",
fqdnTags: ["WindowsVirtualDesktop"],
httpHeadersToInsert: [
{
headerName: "Restrict-Access-To-Tenants",
headerValue: "contoso.com,fabrikam.onmicrosoft.com",
},
],
protocols: [{ port: 80, protocolType: "Http" }],
ruleType: "ApplicationRule",
sourceAddresses: ["216.58.216.164", "10.0.0.0/24"],
},
],
},
],
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "ruleCollectionGroup1",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1",
"properties": {
"priority": 110,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Allow"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "rule1",
"description": "Insert trusted tenants header",
"fqdnTags": [
"WindowsVirtualDesktop"
],
"httpHeadersToInsert": [
{
"headerName": "Restrict-Access-To-Tenants",
"headerValue": "contoso.com,fabrikam.onmicrosoft.com"
}
],
"protocols": [
{
"port": 80,
"protocolType": "Http"
}
],
"ruleType": "ApplicationRule",
"sourceAddresses": [
"216.58.216.164",
"10.0.0.0/24"
]
}
]
}
]
}
}
{
"name": "ruleCollectionGroup1",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1",
"properties": {
"priority": 110,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Allow"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "rule1",
"description": "Insert trusted tenants header",
"fqdnTags": [
"WindowsVirtualDesktop"
],
"httpHeadersToInsert": [
{
"headerName": "Restrict-Access-To-Tenants",
"headerValue": "contoso.com,fabrikam.onmicrosoft.com"
}
],
"protocols": [
{
"port": 80,
"protocolType": "Http"
}
],
"ruleType": "ApplicationRule",
"sourceAddresses": [
"216.58.216.164",
"10.0.0.0/24"
]
}
]
}
]
}
}
Create Firewall Policy Rule Collection Group With IP Groups
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1?api-version=2026-01-01
{
"properties": {
"priority": 110,
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "network-1",
"destinationIpGroups": [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"
],
"destinationPorts": [
"*"
],
"ipProtocols": [
"TCP"
],
"ruleType": "NetworkRule",
"sourceIpGroups": [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"
]
}
]
}
]
}
}
import com.azure.resourcemanager.network.fluent.models.FirewallPolicyRuleCollectionGroupInner;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollection;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionAction;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionActionType;
import com.azure.resourcemanager.network.models.FirewallPolicyRuleNetworkProtocol;
import com.azure.resourcemanager.network.models.NetworkRule;
import java.util.Arrays;
/**
* Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json
*/
/**
* Sample code: Create Firewall Policy Rule Collection Group With IP Groups.
*
* @param manager Entry point to NetworkManager.
*/
public static void
createFirewallPolicyRuleCollectionGroupWithIPGroups(com.azure.resourcemanager.network.NetworkManager manager) {
manager.serviceClient().getFirewallPolicyRuleCollectionGroups().createOrUpdate("rg1", "firewallPolicy",
"ruleCollectionGroup1",
new FirewallPolicyRuleCollectionGroupInner().withPriority(110)
.withRuleCollections(Arrays.asList(new FirewallPolicyFilterRuleCollection()
.withName("Example-Filter-Rule-Collection")
.withAction(new FirewallPolicyFilterRuleCollectionAction()
.withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
.withRules(Arrays.asList(new NetworkRule().withName("network-1")
.withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP))
.withDestinationPorts(Arrays.asList("*"))
.withSourceIpGroups(Arrays.asList(
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"))
.withDestinationIpGroups(Arrays.asList(
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2")))))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python firewall_policy_rule_collection_group_with_ip_groups_put.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.firewall_policy_rule_collection_groups.begin_create_or_update(
resource_group_name="rg1",
firewall_policy_name="firewallPolicy",
rule_collection_group_name="ruleCollectionGroup1",
parameters={
"properties": {
"priority": 110,
"ruleCollections": [
{
"action": {"type": "Deny"},
"name": "Example-Filter-Rule-Collection",
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"destinationIpGroups": [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"
],
"destinationPorts": ["*"],
"ipProtocols": ["TCP"],
"name": "network-1",
"ruleType": "NetworkRule",
"sourceIpGroups": [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"
],
}
],
}
],
}
},
).result()
print(response)
# x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v12"
)
// Generated from example definition: 2026-01-01/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json
func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithIPGroups() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{
Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
Priority: to.Ptr[int32](110),
RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
&armnetwork.FirewallPolicyFilterRuleCollection{
Name: to.Ptr("Example-Filter-Rule-Collection"),
Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{
Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny),
},
RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection),
Rules: []armnetwork.FirewallPolicyRuleClassification{
&armnetwork.Rule{
Name: to.Ptr("network-1"),
DestinationIPGroups: []*string{
to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"),
},
DestinationPorts: []*string{
to.Ptr("*"),
},
IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{
to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP),
},
RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule),
SourceIPGroups: []*string{
to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"),
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{
// FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{
// Name: to.Ptr("ruleCollectionGroup1"),
// Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"),
// Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
// Priority: to.Ptr[int32](110),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
// &armnetwork.FirewallPolicyFilterRuleCollection{
// Name: to.Ptr("Example-Filter-Rule-Collection"),
// Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{
// Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny),
// },
// RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection),
// Rules: []armnetwork.FirewallPolicyRuleClassification{
// &armnetwork.Rule{
// Name: to.Ptr("network-1"),
// DestinationIPGroups: []*string{
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"),
// },
// DestinationPorts: []*string{
// to.Ptr("*"),
// },
// IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{
// to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP),
// },
// RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule),
// SourceIPGroups: []*string{
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"),
// },
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates the specified FirewallPolicyRuleCollectionGroup.
*
* @summary creates or updates the specified FirewallPolicyRuleCollectionGroup.
* x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json
*/
async function createFirewallPolicyRuleCollectionGroupWithIPGroups() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.firewallPolicyRuleCollectionGroups.createOrUpdate(
"rg1",
"firewallPolicy",
"ruleCollectionGroup1",
{
priority: 110,
ruleCollections: [
{
name: "Example-Filter-Rule-Collection",
action: { type: "Deny" },
ruleCollectionType: "FirewallPolicyFilterRuleCollection",
rules: [
{
name: "network-1",
destinationIpGroups: [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2",
],
destinationPorts: ["*"],
ipProtocols: ["TCP"],
ruleType: "NetworkRule",
sourceIpGroups: [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1",
],
},
],
},
],
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "ruleCollectionGroup1",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1",
"properties": {
"priority": 110,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "network-1",
"destinationIpGroups": [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"
],
"destinationPorts": [
"*"
],
"ipProtocols": [
"TCP"
],
"ruleType": "NetworkRule",
"sourceIpGroups": [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"
]
}
]
}
]
}
}
{
"name": "firewallPolicy",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy",
"properties": {
"priority": 110,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "network-1",
"destinationIpGroups": [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups2"
],
"destinationPorts": [
"*"
],
"ipProtocols": [
"TCP"
],
"ruleType": "NetworkRule",
"sourceIpGroups": [
"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/resourceGroups/rg1/ipGroups/ipGroups1"
]
}
]
}
]
}
}
Create Firewall Policy Rule Collection Group With Web Categories
Sample request
PUT https://management.azure.com/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1?api-version=2026-01-01
{
"properties": {
"priority": 110,
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "rule1",
"description": "Deny inbound rule",
"protocols": [
{
"port": 443,
"protocolType": "Https"
}
],
"ruleType": "ApplicationRule",
"sourceAddresses": [
"216.58.216.164",
"10.0.0.0/24"
],
"webCategories": [
"Hacking"
]
}
]
}
]
}
}
import com.azure.resourcemanager.network.fluent.models.FirewallPolicyRuleCollectionGroupInner;
import com.azure.resourcemanager.network.models.ApplicationRule;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollection;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionAction;
import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionActionType;
import com.azure.resourcemanager.network.models.FirewallPolicyRuleApplicationProtocol;
import com.azure.resourcemanager.network.models.FirewallPolicyRuleApplicationProtocolType;
import java.util.Arrays;
/**
* Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json
*/
/**
* Sample code: Create Firewall Policy Rule Collection Group With Web Categories.
*
* @param manager Entry point to NetworkManager.
*/
public static void createFirewallPolicyRuleCollectionGroupWithWebCategories(
com.azure.resourcemanager.network.NetworkManager manager) {
manager.serviceClient().getFirewallPolicyRuleCollectionGroups().createOrUpdate("rg1", "firewallPolicy",
"ruleCollectionGroup1",
new FirewallPolicyRuleCollectionGroupInner().withPriority(110)
.withRuleCollections(Arrays.asList(new FirewallPolicyFilterRuleCollection()
.withName("Example-Filter-Rule-Collection")
.withAction(new FirewallPolicyFilterRuleCollectionAction()
.withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
.withRules(
Arrays.asList(new ApplicationRule().withName("rule1").withDescription("Deny inbound rule")
.withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
.withProtocols(Arrays.asList(new FirewallPolicyRuleApplicationProtocol()
.withProtocolType(FirewallPolicyRuleApplicationProtocolType.HTTPS).withPort(443)))
.withWebCategories(Arrays.asList("Hacking")))))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python firewall_policy_rule_collection_group_with_web_categories_put.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.firewall_policy_rule_collection_groups.begin_create_or_update(
resource_group_name="rg1",
firewall_policy_name="firewallPolicy",
rule_collection_group_name="ruleCollectionGroup1",
parameters={
"properties": {
"priority": 110,
"ruleCollections": [
{
"action": {"type": "Deny"},
"name": "Example-Filter-Rule-Collection",
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"description": "Deny inbound rule",
"name": "rule1",
"protocols": [{"port": 443, "protocolType": "Https"}],
"ruleType": "ApplicationRule",
"sourceAddresses": ["216.58.216.164", "10.0.0.0/24"],
"webCategories": ["Hacking"],
}
],
}
],
}
},
).result()
print(response)
# x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v12"
)
// Generated from example definition: 2026-01-01/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json
func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithWebCategories() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("e747cc13-97d4-4a79-b463-42d7f4e558f2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{
Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
Priority: to.Ptr[int32](110),
RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
&armnetwork.FirewallPolicyFilterRuleCollection{
Name: to.Ptr("Example-Filter-Rule-Collection"),
Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{
Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny),
},
RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection),
Rules: []armnetwork.FirewallPolicyRuleClassification{
&armnetwork.ApplicationRule{
Name: to.Ptr("rule1"),
Description: to.Ptr("Deny inbound rule"),
Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{
{
Port: to.Ptr[int32](443),
ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS),
},
},
RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule),
SourceAddresses: []*string{
to.Ptr("216.58.216.164"),
to.Ptr("10.0.0.0/24"),
},
WebCategories: []*string{
to.Ptr("Hacking"),
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armnetwork.FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse{
// FirewallPolicyRuleCollectionGroup: armnetwork.FirewallPolicyRuleCollectionGroup{
// Name: to.Ptr("ruleCollectionGroup1"),
// Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
// ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"),
// Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{
// Priority: to.Ptr[int32](110),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{
// &armnetwork.FirewallPolicyFilterRuleCollection{
// Name: to.Ptr("Example-Filter-Rule-Collection"),
// Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{
// Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny),
// },
// RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection),
// Rules: []armnetwork.FirewallPolicyRuleClassification{
// &armnetwork.ApplicationRule{
// Name: to.Ptr("rule1"),
// Description: to.Ptr("Deny inbound rule"),
// Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{
// {
// Port: to.Ptr[int32](443),
// ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS),
// },
// },
// RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule),
// SourceAddresses: []*string{
// to.Ptr("216.58.216.164"),
// to.Ptr("10.0.0.0/24"),
// },
// WebCategories: []*string{
// to.Ptr("Hacking"),
// },
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates the specified FirewallPolicyRuleCollectionGroup.
*
* @summary creates or updates the specified FirewallPolicyRuleCollectionGroup.
* x-ms-original-file: 2026-01-01/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json
*/
async function createFirewallPolicyRuleCollectionGroupWithWebCategories() {
const credential = new DefaultAzureCredential();
const subscriptionId = "e747cc13-97d4-4a79-b463-42d7f4e558f2";
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.firewallPolicyRuleCollectionGroups.createOrUpdate(
"rg1",
"firewallPolicy",
"ruleCollectionGroup1",
{
priority: 110,
ruleCollections: [
{
name: "Example-Filter-Rule-Collection",
action: { type: "Deny" },
ruleCollectionType: "FirewallPolicyFilterRuleCollection",
rules: [
{
name: "rule1",
description: "Deny inbound rule",
protocols: [{ port: 443, protocolType: "Https" }],
ruleType: "ApplicationRule",
sourceAddresses: ["216.58.216.164", "10.0.0.0/24"],
webCategories: ["Hacking"],
},
],
},
],
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"name": "ruleCollectionGroup1",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1",
"properties": {
"priority": 110,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "rule1",
"description": "Deny inbound rule",
"protocols": [
{
"port": 443,
"protocolType": "Https"
}
],
"ruleType": "ApplicationRule",
"sourceAddresses": [
"216.58.216.164",
"10.0.0.0/24"
],
"webCategories": [
"Hacking"
]
}
]
}
]
}
}
{
"name": "firewallPolicy",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy",
"properties": {
"priority": 110,
"provisioningState": "Succeeded",
"ruleCollections": [
{
"name": "Example-Filter-Rule-Collection",
"action": {
"type": "Deny"
},
"ruleCollectionType": "FirewallPolicyFilterRuleCollection",
"rules": [
{
"name": "rule1",
"description": "Deny inbound rule",
"protocols": [
{
"port": 443,
"protocolType": "Https"
}
],
"ruleType": "ApplicationRule",
"sourceAddresses": [
"216.58.216.164",
"10.0.0.0/24"
],
"webCategories": [
"Hacking"
]
}
]
}
]
}
}
Definitions
ApplicationRule
Object
Rule of type application.
| Name |
Type |
Description |
|
description
|
string
|
Description of the rule.
|
|
destinationAddresses
|
string[]
|
List of destination IP addresses or Service Tags.
|
|
fqdnTags
|
string[]
|
List of FQDN Tags for this rule.
|
|
httpHeadersToInsert
|
FirewallPolicyHttpHeaderToInsert[]
|
List of HTTP/S headers to insert.
|
|
name
|
string
|
Name of the rule.
|
|
protocols
|
FirewallPolicyRuleApplicationProtocol[]
|
Array of Application Protocols.
|
|
ruleType
|
string:
ApplicationRule
|
Rule Type.
|
|
sourceAddresses
|
string[]
|
List of source IP addresses for this rule.
|
|
sourceIpGroups
|
string[]
|
List of source IpGroups for this rule.
|
|
sourceKubeSelectorGroups
|
string[]
|
List of source Kubernetes Selector Groups for this rule.
|
|
targetFqdns
|
string[]
|
List of FQDNs for this rule.
|
|
targetUrls
|
string[]
|
List of Urls for this rule condition.
|
|
terminateTLS
|
boolean
|
Terminate TLS connections for this rule.
|
|
webCategories
|
string[]
|
List of destination azure web categories.
|
CloudError
Object
An error response from the service.
CloudErrorBody
Object
An error response from the service.
| Name |
Type |
Description |
|
code
|
string
|
An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
|
|
details
|
CloudErrorBody[]
|
A list of additional details about the error.
|
|
message
|
string
|
A message describing the error, intended to be suitable for display in a user interface.
|
|
target
|
string
|
The target of the particular error. For example, the name of the property in error.
|
FirewallPolicyFilterRuleCollection
Object
Firewall Policy Filter Rule Collection.
| Name |
Type |
Description |
|
action
|
FirewallPolicyFilterRuleCollectionAction
|
The action type of a Filter rule collection.
|
|
name
|
string
|
The name of the rule collection.
|
|
priority
|
integer
(int32)
minimum: 100 maximum: 65000
|
Priority of the Firewall Policy Rule Collection resource.
|
|
ruleCollectionType
|
string:
FirewallPolicyFilterRuleCollection
|
The type of the rule collection.
|
|
rules
|
FirewallPolicyRule[]:
|
List of rules included in a rule collection.
|
FirewallPolicyFilterRuleCollectionAction
Object
Properties of the FirewallPolicyFilterRuleCollectionAction.
FirewallPolicyFilterRuleCollectionActionType
Enumeration
The action type of a rule.
| Value |
Description |
|
Allow
|
Allow
|
|
Deny
|
Deny
|
Object
name and value of HTTP/S header to insert
| Name |
Type |
Description |
|
headerName
|
string
|
Contains the name of the header
|
|
headerValue
|
string
|
Contains the value of the header
|
FirewallPolicyNatRuleCollection
Object
Firewall Policy NAT Rule Collection.
| Name |
Type |
Description |
|
action
|
FirewallPolicyNatRuleCollectionAction
|
The action type of a Nat rule collection.
|
|
name
|
string
|
The name of the rule collection.
|
|
priority
|
integer
(int32)
minimum: 100 maximum: 65000
|
Priority of the Firewall Policy Rule Collection resource.
|
|
ruleCollectionType
|
string:
FirewallPolicyNatRuleCollection
|
The type of the rule collection.
|
|
rules
|
FirewallPolicyRule[]:
|
List of rules included in a rule collection.
|
FirewallPolicyNatRuleCollectionAction
Object
Properties of the FirewallPolicyNatRuleCollectionAction.
FirewallPolicyNatRuleCollectionActionType
Enumeration
The action type of a rule.
| Value |
Description |
|
DNAT
|
DNAT
|
FirewallPolicyRuleApplicationProtocol
Object
Properties of the application rule protocol.
FirewallPolicyRuleApplicationProtocolType
Enumeration
The application protocol type of a Rule.
| Value |
Description |
|
Http
|
Http
|
|
Https
|
Https
|
FirewallPolicyRuleCollectionGroup
Object
Rule Collection Group resource.
| Name |
Type |
Description |
|
etag
|
string
|
A unique read-only string that changes whenever the resource is updated.
|
|
id
|
string
|
Resource ID.
|
|
name
|
string
|
Name of the resource.
|
|
properties.priority
|
integer
(int32)
minimum: 100 maximum: 65000
|
Priority of the Firewall Policy Rule Collection Group resource.
|
|
properties.provisioningState
|
ProvisioningState
|
The provisioning state of the firewall policy rule collection group resource.
|
|
properties.ruleCollections
|
FirewallPolicyRuleCollection[]:
|
Group of Firewall Policy rule collections.
|
|
properties.size
|
string
|
A read-only string that represents the size of the FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB)
|
|
type
|
string
|
Resource type.
|
FirewallPolicyRuleCollectionType
Enumeration
The type of the rule collection.
| Value |
Description |
|
FirewallPolicyNatRuleCollection
|
FirewallPolicyNatRuleCollection
|
|
FirewallPolicyFilterRuleCollection
|
FirewallPolicyFilterRuleCollection
|
FirewallPolicyRuleNetworkProtocol
Enumeration
The Network protocol of a Rule.
| Value |
Description |
|
TCP
|
TCP
|
|
UDP
|
UDP
|
|
Any
|
Any
|
|
ICMP
|
ICMP
|
FirewallPolicyRuleType
Enumeration
Rule Type.
| Value |
Description |
|
ApplicationRule
|
ApplicationRule
|
|
NetworkRule
|
NetworkRule
|
|
NatRule
|
NatRule
|
NatRule
Object
Rule of type nat.
| Name |
Type |
Description |
|
description
|
string
|
Description of the rule.
|
|
destinationAddresses
|
string[]
|
List of destination IP addresses or Service Tags.
|
|
destinationPorts
|
string[]
|
List of destination ports.
|
|
ipProtocols
|
FirewallPolicyRuleNetworkProtocol[]
|
Array of FirewallPolicyRuleNetworkProtocols.
|
|
name
|
string
|
Name of the rule.
|
|
ruleType
|
string:
NatRule
|
Rule Type.
|
|
sourceAddresses
|
string[]
|
List of source IP addresses for this rule.
|
|
sourceIpGroups
|
string[]
|
List of source IpGroups for this rule.
|
|
translatedAddress
|
string
|
The translated address for this NAT rule.
|
|
translatedFqdn
|
string
|
The translated FQDN for this NAT rule.
|
|
translatedPort
|
string
|
The translated port for this NAT rule.
|
NetworkRule
Object
Rule of type network.
| Name |
Type |
Description |
|
description
|
string
|
Description of the rule.
|
|
destinationAddresses
|
string[]
|
List of destination IP addresses or Service Tags.
|
|
destinationFqdns
|
string[]
|
List of destination FQDNs.
|
|
destinationGeoLocations
|
string[]
|
List of destination geographic location filters (ISO 3166-1 alpha-2 country codes, e.g. "US", "CA") for this rule.
|
|
destinationIpGroups
|
string[]
|
List of destination IpGroups for this rule.
|
|
destinationPorts
|
string[]
|
List of destination ports.
|
|
ipProtocols
|
FirewallPolicyRuleNetworkProtocol[]
|
Array of FirewallPolicyRuleNetworkProtocols.
|
|
name
|
string
|
Name of the rule.
|
|
ruleType
|
string:
NetworkRule
|
Rule Type.
|
|
sourceAddresses
|
string[]
|
List of source IP addresses for this rule.
|
|
sourceGeoLocations
|
string[]
|
List of source geographic location filters (ISO 3166-1 alpha-2 country codes, e.g. "US", "CA") for this rule.
|
|
sourceIpGroups
|
string[]
|
List of source IpGroups for this rule.
|
|
sourceKubeSelectorGroups
|
string[]
|
List of source Kubernetes Selector Groups for this rule.
|
ProvisioningState
Enumeration
Provisioning states of a resource.
| Value |
Description |
|
Failed
|
Failed
|
|
Succeeded
|
Succeeded
|
|
Canceled
|
Canceled
|
|
Creating
|
Creating
|
|
Updating
|
Updating
|
|
Deleting
|
Deleting
|