Inbound Security Rule - Create Or Update
Creates or updates the specified Network Virtual Appliance Inbound Security Rules.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}?api-version=2025-03-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
network
|
path | True |
string |
The name of the Network Virtual Appliance. |
|
resource
|
path | True |
string |
The name of the resource group. |
|
rule
|
path | True |
string |
The name of security rule collection. |
|
subscription
|
path | True |
string |
The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
|
api-version
|
query | True |
string |
Client API version. |
Request Body
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource ID. |
| name |
string |
Name of security rule collection. |
| properties.ruleType |
Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. |
|
| properties.rules |
List of allowed rules. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Request successful. The operation returns the resulting Network Virtual Appliance Inbound Security Rules resource. |
|
| 201 Created |
Request received successfully. The operation returns the resulting Network Virtual Appliance Inbound Security Rules resource. |
|
| Other Status Codes |
Error response describing why the operation failed. |
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 Network Virtual Appliance Inbound Security Rules
Sample request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/inboundSecurityRules/rule1?api-version=2025-03-01
{
"properties": {
"ruleType": "Permanent",
"rules": [
{
"name": "inboundRule1",
"protocol": "TCP",
"sourceAddressPrefix": "50.20.121.5/32",
"destinationPortRange": 22,
"destinationPortRanges": [
"80-100"
],
"appliesOn": [
"slbip1"
]
}
]
}
}
Sample response
{
"name": "rule1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1",
"etag": "W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\"",
"properties": {
"ruleType": "Permanent",
"provisioningState": "Succeeded",
"rules": [
{
"name": "inboundRule1",
"protocol": "TCP",
"sourceAddressPrefix": "50.20.121.5/32",
"destinationPortRange": 22,
"destinationPortRanges": [
"80-100"
],
"appliesOn": [
"slbip1"
]
}
]
}
}
{
"name": "rule1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1",
"etag": "W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\"",
"properties": {
"ruleType": "Permanent",
"provisioningState": "Succeeded",
"rules": [
{
"name": "inboundRule1",
"protocol": "TCP",
"sourceAddressPrefix": "50.20.121.5/32",
"destinationPortRange": 22,
"destinationPortRanges": [
"80-100"
],
"appliesOn": [
"slbip1"
]
}
]
}
}
Definitions
| Name | Description |
|---|---|
|
Cloud |
An error response from the service. |
|
Cloud |
An error response from the service. |
|
Inbound |
NVA Inbound Security Rule resource. |
|
Inbound |
Properties of the Inbound Security Rules resource. |
|
Inbound |
Protocol. This should be either TCP or UDP. |
|
Inbound |
Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. |
|
Provisioning |
The current provisioning state. |
CloudError
An error response from the service.
| Name | Type | Description |
|---|---|---|
| error |
Cloud error body. |
CloudErrorBody
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 |
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. |
InboundSecurityRule
NVA Inbound Security Rule 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 security rule collection. |
| properties.provisioningState |
The provisioning state of the resource. |
|
| properties.ruleType |
Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. |
|
| properties.rules |
List of allowed rules. |
|
| type |
string |
NVA inbound security rule type. |
InboundSecurityRules
Properties of the Inbound Security Rules resource.
| Name | Type | Description |
|---|---|---|
| appliesOn |
string[] |
Public IP name in case of Permanent Rule type & Interface Name in case of Auto Expire Rule type |
| destinationPortRange |
integer (int32) minimum: 0maximum: 65535 |
NVA port ranges to be opened up. One needs to provide specific ports. |
| destinationPortRanges |
string[] |
NVA port ranges to be opened up. One can provide a range of ports. Allowed port value between 0 and 65535. |
| name |
string |
Name of the rule. |
| protocol |
Protocol. This should be either TCP or UDP. |
|
| sourceAddressPrefix |
string |
The CIDR or source IP range. |
InboundSecurityRulesProtocol
Protocol. This should be either TCP or UDP.
| Value | Description |
|---|---|
| TCP | |
| UDP |
InboundSecurityRuleType
Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule.
| Value | Description |
|---|---|
| AutoExpire | |
| Permanent |
ProvisioningState
The current provisioning state.
| Value | Description |
|---|---|
| Succeeded | |
| Updating | |
| Deleting | |
| Failed |