Skip to content

Commit 44cc617

Browse files
authored
{AzureNetwork} fixes #22448 Making priority required (#22874)
* {AzureNetwork} fixes #22448 Making priority required fixes #22448 [This is the API](https://learn.microsoft.com/en-us/rest/api/virtualnetwork/network-security-groups/create-or-update?tabs=HTTP#code-try-0) I invoked. For the NSG security rules without priorities, seems like the priority parameter is required. Azure portal works as expected. I don't think that's allowed but according to the schema it is because the priority property is not marked as required. I tried to create a NSG security rule without the priorities and it failed with below. Intrestingly the Azure Request Body: ``` { "properties": { "securityRules": [ { "name": "rule1", "properties": { "protocol": "*", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "destinationPortRange": "80", "sourcePortRange": "*", "direction": "Inbound" } } ] }, "location": "eastus" } ``` Response received: ``` { "error": { "code": "SecurityRuleInvalidPriority", "message": "Security rule has invalid Priority. Value provided: 0 Allowed range 100-4096.", "details": [] } } ``` This PR will make the priority parameter as required. * Update NetworkSecurityGroupRuleDelete.json Long running operation should return `azure-AsyncOperation` in response header. * Update NetworkSecurityGroupDelete.json Long running operation should return location or azure-AsyncOperation in header. * Update NetworkSecurityGroupRuleDelete.json * Update NetworkSecurityGroupDelete.json * Update NetworkSecurityGroupRuleDelete.json * Update NetworkSecurityGroupDelete.json
1 parent cacbca5 commit 44cc617

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

specification/network/resource-manager/Microsoft.Network/stable/2022-09-01/examples/NetworkSecurityGroupDelete.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77
},
88
"responses": {
99
"200": {},
10-
"202": {},
11-
"204": {}
10+
"202": {
11+
"headers": {
12+
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/locations/eastus/operationResults/00000000-0000-0000-0000-000000000000?api-version=2022-09-01",
13+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2022-09-01"
14+
}
15+
},
16+
"204": {
17+
"headers": {
18+
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/locations/eastus/operationResults/00000000-0000-0000-0000-000000000000?api-version=2022-09-01",
19+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2022-09-01"
20+
}
21+
}
1222
}
1323
}

specification/network/resource-manager/Microsoft.Network/stable/2022-09-01/examples/NetworkSecurityGroupRuleDelete.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
"securityRuleName": "rule1"
88
},
99
"responses": {
10-
"200": {},
11-
"202": {},
10+
"200": {
11+
"headers": {
12+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2022-09-01"
13+
}
14+
},
15+
"202": {
16+
"headers": {
17+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2022-09-01"
18+
}
19+
},
1220
"204": {}
1321
}
1422
}

specification/network/resource-manager/Microsoft.Network/stable/2022-09-01/networkSecurityGroup.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@
820820
"required": [
821821
"protocol",
822822
"access",
823+
"priority",
823824
"direction"
824825
],
825826
"description": "Security rule resource."

0 commit comments

Comments
 (0)