共用方式為


Group - Create Or Update

建立或更新群組。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}?api-version=2021-08-01

URI 參數

名稱 位於 必要 類型 Description
groupId
path True

string

minLength: 1
maxLength: 256

群組標識碼。 目前 API 管理服務實例中必須是唯一的。

resourceGroupName
path True

string

資源群組的名稱。

serviceName
path True

string

minLength: 1
maxLength: 50
pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

API 管理服務的名稱。

subscriptionId
path True

string

可唯一識別Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶標識碼會形成每個服務呼叫 URI 的一部分。

api-version
query True

string

要與用戶端要求搭配使用的 API 版本。

要求標頭

名稱 必要 類型 Description
If-Match

string

實體的 ETag。 建立實體時不需要,但在更新實體時則為必要專案。

要求本文

名稱 必要 類型 Description
properties.displayName True

string

minLength: 1
maxLength: 300

組名。

properties.description

string

群組描述。

properties.externalId

string

外部群組的標識碼,此屬性包含來自外部識別提供者的群組標識碼,例如,針對 Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>;否則此值為 null。

properties.type

GroupType

群組類型。

回應

名稱 類型 Description
200 OK

GroupContract

群組已經存在。

標題

ETag: string

201 Created

GroupContract

已成功建立群組。

標題

ETag: string

Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

ApiManagementCreateGroup
ApiManagementCreateGroupExternal

ApiManagementCreateGroup

範例要求

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/tempgroup?api-version=2021-08-01

{
  "properties": {
    "displayName": "temp group"
  }
}

範例回覆

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/tempgroup",
  "type": "Microsoft.ApiManagement/service/groups",
  "name": "tempgroup",
  "properties": {
    "displayName": "temp group",
    "type": "custom"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/tempgroup",
  "type": "Microsoft.ApiManagement/service/groups",
  "name": "tempgroup",
  "properties": {
    "displayName": "temp group",
    "type": "custom"
  }
}

ApiManagementCreateGroupExternal

範例要求

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/aadGroup?api-version=2021-08-01

{
  "properties": {
    "displayName": "NewGroup (samiraad.onmicrosoft.com)",
    "description": "new group to test",
    "type": "external",
    "externalId": "aad://samiraad.onmicrosoft.com/groups/83cf2753-5831-4675-bc0e-2f8dc067c58d"
  }
}

範例回覆

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/aadGroup",
  "type": "Microsoft.ApiManagement/service/groups",
  "name": "aadGroup",
  "properties": {
    "displayName": "NewGroup (samiraad.onmicrosoft.com)",
    "description": "new group to test",
    "type": "external",
    "externalId": "aad://samiraad.onmicrosoft.com/groups/83cf2753-5831-4675-bc0e-2f8dc067c58d"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/aadGroup",
  "type": "Microsoft.ApiManagement/service/groups",
  "name": "aadGroup",
  "properties": {
    "displayName": "NewGroup (samiraad.onmicrosoft.com)",
    "description": "new group to test",
    "type": "external",
    "externalId": "aad://samiraad.onmicrosoft.com/groups/83cf2753-5831-4675-bc0e-2f8dc067c58d"
  }
}

定義

名稱 Description
ErrorFieldContract

錯誤欄位合約。

ErrorResponse

錯誤回應。

GroupContract

合約詳細數據。

GroupCreateParameters

提供給建立群組作業的參數。

GroupType

群組類型。

ErrorFieldContract

錯誤欄位合約。

名稱 類型 Description
code

string

屬性層級錯誤碼。

message

string

人類可讀取的屬性層級錯誤表示法。

target

string

屬性名稱。

ErrorResponse

錯誤回應。

名稱 類型 Description
error.code

string

服務定義的錯誤碼。 此程式代碼可作為回應中所指定 HTTP 錯誤碼的子狀態。

error.details

ErrorFieldContract[]

要求中傳送無效欄位的清單,以防驗證錯誤。

error.message

string

人類可讀取的錯誤表示法。

GroupContract

合約詳細數據。

名稱 類型 Description
id

string

資源的完整資源標識碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

資源的名稱

properties.builtIn

boolean

如果群組是三個系統群組之一,則為 true(系統管理員、開發人員或來賓):否則為 false。

properties.description

string

maxLength: 1000

群組描述。 可以包含 HTML 格式標記。

properties.displayName

string

minLength: 1
maxLength: 300

組名。

properties.externalId

string

針對外部群組,此屬性包含來自外部識別提供者的群組標識符,例如,針對 Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>;否則此值為 null。

properties.type

GroupType

群組類型。

type

string

資源的型別。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”

GroupCreateParameters

提供給建立群組作業的參數。

名稱 類型 Description
properties.description

string

群組描述。

properties.displayName

string

minLength: 1
maxLength: 300

組名。

properties.externalId

string

外部群組的標識碼,此屬性包含來自外部識別提供者的群組標識碼,例如,針對 Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>;否則此值為 null。

properties.type

GroupType

群組類型。

GroupType

群組類型。

Description
custom
external
system