Skip to content

Commit

Permalink
{AzureNetwork} fixes Azure#22448 Making priority required (Azure#22874)
Browse files Browse the repository at this point in the history
* {AzureNetwork} fixes Azure#22448 Making priority required 

fixes Azure#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
  • Loading branch information
navba-MSFT authored and Kayla Ames committed Mar 17, 2023
1 parent f65b3ca commit af6c7cb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
},
"responses": {
"200": {},
"202": {},
"204": {}
"202": {
"headers": {
"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",
"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"
}
},
"204": {
"headers": {
"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",
"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"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@
"securityRuleName": "rule1"
},
"responses": {
"200": {},
"202": {},
"200": {
"headers": {
"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"
}
},
"202": {
"headers": {
"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"
}
},
"204": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@
"required": [
"protocol",
"access",
"priority",
"direction"
],
"description": "Security rule resource."
Expand Down

0 comments on commit af6c7cb

Please sign in to comment.