From 79faf7773541334165a6a55a55d161bc32e83f6e Mon Sep 17 00:00:00 2001 From: Ben Eshed Date: Fri, 25 Mar 2022 08:32:34 +0300 Subject: [PATCH] Ability to update tags on firewall policies (#18322) * Support updating of Azure Firewall Policy Tags. Includes HTTP Patch example * Use common-types ErrorDetail * Ability to update tags for Firewall Policies * spell check fix for firewallpolicy * Use future release api-version for example --- .../examples/FirewallPolicyPatch.json | 128 ++++++++++++++++++ .../stable/2021-08-01/firewallPolicy.json | 57 ++++++++ 2 files changed, 185 insertions(+) create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyPatch.json diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyPatch.json b/specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyPatch.json new file mode 100644 index 000000000000..7d1c74bea78c --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/examples/FirewallPolicyPatch.json @@ -0,0 +1,128 @@ +{ + "parameters": { + "firewallPolicyName": "firewallPolicy", + "resourceGroupName": "myResourceGroup", + "api-version": "2021-08-01", + "subscriptionId": "subId", + "parameters": { + "tags": { + "key1": "value1", + "key2": "value2" + } + } + }, + "responses": { + "200": { + "body": { + "name": "firewallPolicy", + "id": "/subscriptions/subId/resourceGroups/myResourceGroup/providers/Microsoft.Network/firewallPolicies/firewallPolicy", + "type": "Microsoft.Network/firewallPolicies", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "location": "West US", + "tags": { + "key1": "value1", + "key2": "value2" + }, + "properties": { + "provisioningState": "Succeeded", + "threatIntelMode": "Alert", + "threatIntelWhitelist": { + "ipAddresses": [ + "20.3.4.5" + ], + "fqdns": [ + "*.microsoft.com" + ] + }, + "ruleCollectionGroups": [ + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1" + } + ], + "insights": { + "isEnabled": true, + "retentionDays": 100, + "logAnalyticsResources": { + "workspaces": [ + { + "region": "westus", + "workspaceId": { + "id": "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1" + } + }, + { + "region": "eastus", + "workspaceId": { + "id": "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2" + } + } + ], + "defaultWorkspaceId": { + "id": "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace" + } + } + }, + "firewalls": [], + "snat": { + "privateRanges": [ + "IANAPrivateRanges" + ] + }, + "sql": { + "allowSqlRedirect": true + }, + "dnsSettings": { + "servers": [ + "30.3.4.5" + ], + "enableProxy": true, + "requireProxyForNetworkRules": false + }, + "explicitProxySettings": { + "enableExplicitProxy": true, + "httpPort": 8087, + "httpsPort": 8087, + "pacFilePort": 8087, + "pacFile": "https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D" + }, + "sku": { + "tier": "Premium" + }, + "intrusionDetection": { + "mode": "Alert", + "configuration": { + "signatureOverrides": [ + { + "id": "2525004", + "mode": "Deny" + } + ], + "bypassTrafficSettings": [ + { + "name": "bypassRule1", + "description": "Rule 1", + "protocol": "TCP", + "sourceAddresses": [ + "1.2.3.4" + ], + "destinationAddresses": [ + "5.6.7.8" + ], + "destinationPorts": [ + "*" + ] + } + ] + } + }, + "transportSecurity": { + "certificateAuthority": { + "name": "clientcert", + "keyVaultSecretId": "https://kv/secret" + } + } + } + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/firewallPolicy.json b/specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/firewallPolicy.json index 443290d6abde..94d0fe2613e6 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/firewallPolicy.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2021-08-01/firewallPolicy.json @@ -211,6 +211,63 @@ "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } + }, + "patch": { + "tags": [ + "FirewallPolicies" + ], + "operationId": "FirewallPolicies_UpdateTags", + "description": "Updates tags of a Azure Firewall Policy resource.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "firewallPolicyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Firewall Policy." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "./network.json#/definitions/TagsObject" + }, + "description": "Parameters supplied to update Azure Firewall Policy tags." + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The operation returns the resulting FirewallPolicy resource.", + "schema": { + "$ref": "#/definitions/FirewallPolicy" + } + }, + "default": { + "description": "Unexpected error.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Update FirewallPolicy Tags": { + "$ref": "./examples/FirewallPolicyPatch.json" + } + } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies": {