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

Management Group Subscriptions - Create

将现有订阅与管理组关联。

PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}?api-version=2020-05-01

URI 参数

名称 必需 类型 说明
groupId
path True

string

管理组 ID。

subscriptionId
path True

string

订阅 ID。

api-version
query True

string

要与客户端请求一起使用的 API 的版本。 当前版本为 2018-01-01-preview。

请求头

名称 必需 类型 说明
Cache-Control

string

指示请求不应使用任何缓存。

响应

名称 类型 说明
200 OK

SubscriptionUnderManagementGroup

确定

Other Status Codes

ErrorResponse

错误

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

AddSubscriptionToManagementGroup

Sample Request

PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/Group/subscriptions/728bcbe4-8d56-4510-86c2-4921b8beefbc?api-version=2020-05-01

Sample Response

{
  "name": "728bcbe4-8d56-4510-86c2-4921b8beefbc",
  "id": " /providers/Microsoft.Management/managementGroups/Group/subscriptions/728bcbe4-8d56-4510-86c2-4921b8beefbc",
  "type": "Microsoft.Management/managementGroups/subscriptions",
  "properties": {
    "displayName": "Group",
    "parent": {
      "id": "/providers/Microsoft.Management/managementGroups/Group"
    },
    "state": "Active",
    "tenant": "e751ac82-623b-4913-8d74-22637c832373"
  }
}

定义

名称 说明
DescendantParentGroupInfo

父管理组的 ID。

ErrorDetails

错误的详细信息。

ErrorResponse

错误对象。

SubscriptionUnderManagementGroup

管理组下订阅的详细信息。

DescendantParentGroupInfo

父管理组的 ID。

名称 类型 说明
id

string

父管理组的完全限定 ID。 例如,/providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000

ErrorDetails

错误的详细信息。

名称 类型 说明
code

string

服务器定义的一组错误代码中的一个。

details

string

错误详细信息的可读表示形式。

message

string

错误的用户可读表示形式。

ErrorResponse

错误对象。

名称 类型 说明
error

ErrorDetails

错误
错误的详细信息。

SubscriptionUnderManagementGroup

管理组下订阅的详细信息。

名称 类型 说明
id

string

订阅的完全限定 ID。 例如,/providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-0000-0000000000000/subscriptions/000000-0000-0000-0000-00000000001

name

string

订阅的字符串化 ID。 例如,00000000-0000-0000-0000-000000000000

properties.displayName

string

订阅的友好名称。

properties.parent

DescendantParentGroupInfo

Parent
父管理组的 ID。

properties.state

string

订阅的状态。

properties.tenant

string

与订阅关联的 AAD 租户 ID。 例如,00000000-0000-0000-0000-000000000000

type

string

资源类型。 例如,Microsoft.Management/managementGroups/subscriptions