你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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=2024-01-01

URI Parameters

Name In Required Type Description
networkVirtualApplianceName
path True

string

The name of the Network Virtual Appliance.

resourceGroupName
path True

string

The name of the resource group.

ruleCollectionName
path True

string

The name of security rule collection.

subscriptionId
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

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.

properties.rules

InboundSecurityRules[]

List of allowed rules.

Responses

Name Type Description
200 OK

InboundSecurityRule

Request successful. The operation returns the resulting Network Virtual Appliance Inbound Security Rules resource.

201 Created

InboundSecurityRule

Request received successfully. The operation returns the resulting Network Virtual Appliance Inbound Security Rules resource.

Other Status Codes

CloudError

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=2024-01-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
CloudError

An error response from the service.

CloudErrorBody

An error response from the service.

InboundSecurityRule

NVA Inbound Security Rule resource.

InboundSecurityRules

Properties of the Inbound Security Rules resource.

InboundSecurityRulesProtocol

Protocol. This should be either TCP or 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.

ProvisioningState

The current provisioning state.

CloudError

An error response from the service.

Name Type Description
error

CloudErrorBody

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

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.

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

ProvisioningState

The provisioning state of the resource.

properties.ruleType

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.

properties.rules

InboundSecurityRules[]

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

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

InboundSecurityRulesProtocol

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.

Name Type Description
TCP

string

UDP

string

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.

Name Type Description
AutoExpire

string

Permanent

string

ProvisioningState

The current provisioning state.

Name Type Description
Deleting

string

Failed

string

Succeeded

string

Updating

string