Network Security Perimeter Access Rules - Create Or Update
创建或更新网络访问规则。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}?api-version=2025-03-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
access
|
path | True |
string maxLength: 80pattern: (^[a-zA-Z0-9]+[a-zA-Z0-9_.-]*[a-zA-Z0-9_]+$)|(^[a-zA-Z0-9]$) |
NSP 访问规则的名称。 |
|
network
|
path | True |
string maxLength: 80pattern: (^[a-zA-Z0-9]+[a-zA-Z0-9_.-]*[a-zA-Z0-9_]+$)|(^[a-zA-Z0-9]$) |
网络安全外围的名称。 |
|
profile
|
path | True |
string maxLength: 80pattern: (^[a-zA-Z0-9]+[a-zA-Z0-9_.-]*[a-zA-Z0-9_]+$)|(^[a-zA-Z0-9]$) |
NSP 配置文件的名称。 |
|
resource
|
path | True |
string |
资源组的名称。 |
|
subscription
|
path | True |
string |
唯一标识 Azure 订阅Microsoft的订阅凭据。 订阅 ID 构成了每个服务调用的 URI 的一部分。 |
|
api-version
|
query | True |
string |
客户端 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| properties.addressPrefixes |
string[] |
入站地址前缀(IPv4/IPv6) |
| properties.direction |
指定访问规则是否为入站/出站的方向。 |
|
| properties.emailAddresses |
string[] |
电子邮件地址格式的出站规则。 此访问规则类型当前不可用。 |
| properties.fullyQualifiedDomainNames |
string[] |
完全限定域名格式的出站规则。 |
| properties.phoneNumbers |
string[] |
电话号码格式的出站规则。 此访问规则类型当前不可用。 |
| properties.serviceTags |
string[] |
类型服务标记的入站规则。 此访问规则类型当前不可用。 |
| properties.subscriptions |
订阅 ID 列表 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
已更新 - 已更新现有访问规则。 返回资源。 |
|
| 201 Created |
创建 - 返回创建的 NspAccessRule 资源。 |
|
| Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
NspAccessRulePut
示例请求
PUT https://management.azure.com/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1?api-version=2025-03-01
{
"properties": {
"direction": "Inbound",
"addressPrefixes": [
"10.11.0.0/16",
"10.10.1.0/24"
]
}
}
示例响应
{
"name": "accessRule1",
"id": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1",
"type": "Microsoft.Network/networkSecurityPerimeters/profiles/accessRules",
"properties": {
"provisioningState": "Succeeded",
"direction": "Inbound",
"addressPrefixes": [
"10.11.0.0/16",
"10.10.1.0/24"
],
"fullyQualifiedDomainNames": [],
"subscriptions": [],
"networkSecurityPerimeters": [],
"emailAddresses": [],
"phoneNumbers": [],
"serviceTags": []
},
"systemData": {
"createdBy": "user",
"createdByType": "User",
"createdAt": "2024-02-07T18:07:36.3446713Z",
"lastModifiedBy": "user",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-02-07T18:07:36.3446713Z"
}
}
{
"name": "accessRule1",
"id": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityPerimeters/nsp1/profiles/profile1/accessRules/accessRule1",
"type": "Microsoft.Network/networkSecurityPerimeters/profiles/accessRules",
"properties": {
"provisioningState": "Succeeded",
"direction": "Inbound",
"addressPrefixes": [
"10.11.0.0/16",
"10.10.1.0/24"
],
"fullyQualifiedDomainNames": [],
"subscriptions": [],
"networkSecurityPerimeters": [],
"emailAddresses": [],
"phoneNumbers": [],
"serviceTags": []
},
"systemData": {
"createdBy": "user",
"createdByType": "User",
"createdAt": "2024-02-07T18:07:36.3446713Z",
"lastModifiedBy": "user",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-02-07T18:07:36.3446713Z"
}
}
定义
| 名称 | 说明 |
|---|---|
|
Access |
指定访问规则是否为入站/出站的方向。 |
|
Cloud |
服务的错误响应。 |
|
Cloud |
服务的错误响应。 |
|
created |
创建资源的标识的类型。 |
|
Nsp |
NSP 访问规则资源 |
|
nsp |
作用域分配资源的预配状态。 |
|
Perimeter |
|
|
Subscription |
|
|
system |
与创建和上次修改资源相关的元数据。 |
AccessRuleDirection
指定访问规则是否为入站/出站的方向。
| 值 | 说明 |
|---|---|
| Inbound | |
| Outbound |
CloudError
服务的错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
云错误正文。 |
CloudErrorBody
服务的错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误的标识符。 代码是固定的,旨在以编程方式使用。 |
| details |
有关错误的其他详细信息的列表。 |
|
| message |
string |
描述错误的消息,旨在适合在用户界面中显示。 |
| target |
string |
特定错误的目标。 例如,错误属性的名称。 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
NspAccessRule
NSP 访问规则资源
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (arm-id) |
资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| name |
string |
资源的名称 |
| properties.addressPrefixes |
string[] |
入站地址前缀(IPv4/IPv6) |
| properties.direction |
指定访问规则是否为入站/出站的方向。 |
|
| properties.emailAddresses |
string[] |
电子邮件地址格式的出站规则。 此访问规则类型当前不可用。 |
| properties.fullyQualifiedDomainNames |
string[] |
完全限定域名格式的出站规则。 |
| properties.networkSecurityPerimeters |
由外围 ID 指定的规则。 |
|
| properties.phoneNumbers |
string[] |
电话号码格式的出站规则。 此访问规则类型当前不可用。 |
| properties.provisioningState |
作用域分配资源的预配状态。 |
|
| properties.serviceTags |
string[] |
类型服务标记的入站规则。 此访问规则类型当前不可用。 |
| properties.subscriptions |
订阅 ID 列表 |
|
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| type |
string |
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
nspProvisioningState
作用域分配资源的预配状态。
| 值 | 说明 |
|---|---|
| Succeeded | |
| Creating | |
| Updating | |
| Deleting | |
| Accepted | |
| Failed |
PerimeterBasedAccessRule
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (arm-id) |
ARM ID 格式的 NSP ID。 |
| location |
string |
提供的 NSP 的位置。 |
| perimeterGuid |
string |
提供的 NSP 的资源指南。 |
SubscriptionId
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (arm-id) |
ARM ID 格式的订阅 ID。 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |