Subscription Policy - Add Update Policy For Tenant
为用户的租户创建或更新订阅租户策略。
PUT https://management.azure.com/providers/Microsoft.Subscription/policies/default?api-version=2021-10-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
api-version
|
query | True |
string |
要用于客户端请求的 API 的版本。 当前版本为 2021-10-01 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| blockSubscriptionsIntoTenant |
boolean |
阻止将订阅输入到用户的租户中。 |
| blockSubscriptionsLeavingTenant |
boolean |
阻止离开用户的租户中的订阅。 |
| exemptedPrincipals |
string[] (uuid) |
从用户租户的设置订阅租户策略中免除的用户 objectId 列表。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
已成功创建/更新订阅租户策略。 |
|
| Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
TenantPolicy
示例请求
PUT https://management.azure.com/providers/Microsoft.Subscription/policies/default?api-version=2021-10-01
{
"blockSubscriptionsLeavingTenant": true,
"blockSubscriptionsIntoTenant": true,
"exemptedPrincipals": [
"e879cf0f-2b4d-5431-109a-f72fc9868693",
"9792da87-c97b-410d-a97d-27021ba09ce6"
]
}
示例响应
{
"id": "providers/Microsoft.Subscription/policies/default",
"name": "default",
"type": "providers/Microsoft.Subscription/policies",
"properties": {
"policyId": "291bba3f-e0a5-47bc-a099-3bdcb2a50a05",
"blockSubscriptionsLeavingTenant": true,
"blockSubscriptionsIntoTenant": true,
"exemptedPrincipals": [
"e879cf0f-2b4d-5431-109a-f72fc9868693",
"9792da87-c97b-410d-a97d-27021ba09ce6"
]
}
}
定义
| 名称 | 说明 |
|---|---|
|
created |
创建资源的标识的类型。 |
|
Error |
描述错误响应的格式。 |
|
Error |
错误响应指示服务无法处理传入请求。 错误消息中提供了原因。 |
|
Get |
租户策略信息。 |
|
Put |
放置租户策略请求属性。 |
|
system |
与创建和上次修改资源相关的元数据。 |
|
Tenant |
租户策略。 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorResponse
描述错误响应的格式。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码 |
| message |
string |
指示作失败的原因的错误消息。 |
ErrorResponseBody
错误响应指示服务无法处理传入请求。 错误消息中提供了原因。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码 |
| error |
错误的详细信息。 |
|
| message |
string |
指示作失败的原因的错误消息。 |
GetTenantPolicyResponse
租户策略信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
策略 ID。 |
| name |
string |
策略名称。 |
| properties |
租户策略属性。 |
|
| systemData |
与创建和上次修改资源相关的元数据。 |
|
| type |
string |
资源类型。 |
PutTenantPolicyRequestProperties
放置租户策略请求属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| blockSubscriptionsIntoTenant |
boolean |
阻止将订阅输入到用户的租户中。 |
| blockSubscriptionsLeavingTenant |
boolean |
阻止离开用户的租户中的订阅。 |
| exemptedPrincipals |
string[] (uuid) |
从用户租户的设置订阅租户策略中免除的用户 objectId 列表。 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
TenantPolicy
租户策略。
| 名称 | 类型 | 说明 |
|---|---|---|
| blockSubscriptionsIntoTenant |
boolean |
阻止将订阅输入到用户的租户中。 |
| blockSubscriptionsLeavingTenant |
boolean |
阻止离开用户的租户中的订阅。 |
| exemptedPrincipals |
string[] (uuid) |
从用户租户的设置订阅租户策略中免除的用户 objectId 列表。 |
| policyId |
string |
策略 ID。 |