通过


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

Projects - Create

创建认知服务帐户的项目。 项目是帐户的子资源,它为 AI 开发人员提供了单独的容器来处理。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}?api-version=2025-06-01

URI 参数

名称 必需 类型 说明
accountName
path True

string

minLength: 2
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$

认知服务帐户的名称。

projectName
path True

string

minLength: 2
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$

认知服务帐户项目的名称。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string

minLength: 1

目标订阅的 ID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求正文

名称 类型 说明
identity

Identity

资源的标识。

location

string

资源所在的地理位置

properties

ProjectProperties

认知服务项目的属性。

tags

object

资源标记。

响应

名称 类型 说明
200 OK

Project

如果资源已成功创建或已存在,则服务应返回 200 (正常) 。

201 Created

Project

如果资源创建成功,服务应返回 201 (OK) 。

202 Accepted

Project

HTTP 202(已接受)如果作已成功启动,并将异步完成。

Other Status Codes

ErrorResponse

描述作失败原因的错误响应

示例

Create Project
Create Project Min

Create Project

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1/projects/testProject1?api-version=2025-06-01

{
  "location": "West US",
  "properties": {
    "description": "Description of this project",
    "displayName": "p1"
  },
  "identity": {
    "type": "SystemAssigned"
  }
}

示例响应

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1/projects/testProject1",
  "name": "testProject1",
  "type": "Microsoft.CognitiveServices/accounts/projects",
  "location": "West US",
  "etag": "W/\"datetime'2017-04-10T08%3A00%3A05.445595Z'\"",
  "properties": {
    "description": "Description of this project",
    "displayName": "p1",
    "provisioningState": "Succeeded",
    "endpoints": {
      "OpenAI Language Model Instance API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Dall-E API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Sora API": "https://sub-donmain-name.openai.azure.com/"
    },
    "isDefault": true
  },
  "identity": {
    "principalId": "b5cf119e-a5c2-42c7-802f-592e0efb169f",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "type": "SystemAssigned"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1/projects/testProject1",
  "name": "testProject1",
  "type": "Microsoft.CognitiveServices/accounts/projects",
  "location": "West US",
  "etag": "W/\"datetime'2017-04-10T07%3A57%3A48.4582781Z'\"",
  "properties": {
    "description": "Description of this project",
    "displayName": "p1",
    "provisioningState": "Succeeded",
    "endpoints": {
      "OpenAI Language Model Instance API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Dall-E API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Sora API": "https://sub-donmain-name.openai.azure.com/"
    },
    "isDefault": true
  },
  "identity": {
    "principalId": "b5cf119e-a5c2-42c7-802f-592e0efb169f",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "type": "SystemAssigned"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1/projects/testProject1",
  "name": "testProject1",
  "type": "Microsoft.CognitiveServices/accounts/projects",
  "location": "West US",
  "etag": "W/\"datetime'2017-04-10T07%3A57%3A48.4582781Z'\"",
  "properties": {
    "description": "Description of this project",
    "displayName": "p1",
    "provisioningState": "Succeeded",
    "endpoints": {
      "OpenAI Language Model Instance API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Dall-E API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Sora API": "https://sub-donmain-name.openai.azure.com/"
    },
    "isDefault": true
  },
  "identity": {
    "principalId": "b5cf119e-a5c2-42c7-802f-592e0efb169f",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "type": "SystemAssigned"
  }
}

Create Project Min

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1/projects/testProject1?api-version=2025-06-01

{
  "location": "West US",
  "properties": {},
  "identity": {
    "type": "SystemAssigned"
  }
}

示例响应

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1/projects/testProject1",
  "name": "testProject1",
  "type": "Microsoft.CognitiveServices/accounts/projects",
  "location": "West US",
  "etag": "W/\"datetime'2017-04-10T08%3A00%3A05.445595Z'\"",
  "properties": {
    "provisioningState": "Succeeded",
    "endpoints": {
      "OpenAI Language Model Instance API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Dall-E API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Sora API": "https://sub-donmain-name.openai.azure.com/"
    },
    "isDefault": true
  },
  "identity": {
    "principalId": "b5cf119e-a5c2-42c7-802f-592e0efb169f",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "type": "SystemAssigned"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1",
  "name": "testProject1",
  "type": "Microsoft.CognitiveServices/accounts/projects",
  "location": "West US",
  "etag": "W/\"datetime'2017-04-10T07%3A57%3A48.4582781Z'\"",
  "properties": {
    "provisioningState": "Succeeded",
    "endpoints": {
      "OpenAI Language Model Instance API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Dall-E API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Sora API": "https://sub-donmain-name.openai.azure.com/"
    },
    "isDefault": true
  },
  "identity": {
    "principalId": "b5cf119e-a5c2-42c7-802f-592e0efb169f",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "type": "SystemAssigned"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1",
  "name": "testProject1",
  "type": "Microsoft.CognitiveServices/accounts/projects",
  "location": "West US",
  "etag": "W/\"datetime'2017-04-10T07%3A57%3A48.4582781Z'\"",
  "properties": {
    "provisioningState": "Succeeded",
    "endpoints": {
      "OpenAI Language Model Instance API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Dall-E API": "https://sub-donmain-name.openai.azure.com/",
      "OpenAI Sora API": "https://sub-donmain-name.openai.azure.com/"
    },
    "isDefault": true
  },
  "identity": {
    "principalId": "b5cf119e-a5c2-42c7-802f-592e0efb169f",
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "type": "SystemAssigned"
  }
}

定义

名称 说明
createdByType

创建资源的标识类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

Identity

资源的标识。

Project

认知服务项目是表示预配帐户的项目、类型、位置和 SKU 的 Azure 资源。

ProjectProperties

认知服务项目的属性“。

ProvisioningState

获取调用作时认知服务帐户的状态。

ResourceIdentityType

标识类型。

systemData

与创建和上次修改资源相关的元数据。

UserAssignedIdentity

用户分配的托管标识。

createdByType

创建资源的标识类型。

说明
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

附加信息。

type

string

附加信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

Identity

资源的标识。

名称 类型 说明
principalId

string

资源标识的主体 ID。

tenantId

string

资源的租户 ID。

type

ResourceIdentityType

标识类型。

userAssignedIdentities

<string,  UserAssignedIdentity>

与资源关联的用户分配的标识列表。 用户标识字典键引用将是 ARM 资源 ID,格式为:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}

Project

认知服务项目是表示预配帐户的项目、类型、位置和 SKU 的 Azure 资源。

名称 类型 说明
etag

string

资源 Etag。

id

string

资源的完全限定资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

identity

Identity

资源的标识。

location

string

资源所在的地理位置

name

string

资源的名称

properties

ProjectProperties

认知服务项目的属性。

systemData

systemData

与创建和上次修改资源相关的元数据。

tags

object

资源标记。

type

string

资源类型。 例如,“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

ProjectProperties

认知服务项目的属性“。

名称 类型 说明
description

string

认知服务项目的说明。

displayName

string

认知服务项目的显示名称。

endpoints

object

此认知服务项目的终结点列表。

isDefault

boolean

指示项目是否为帐户的默认项目。

provisioningState

ProvisioningState

获取调用作时认知服务项目的状态。

ProvisioningState

获取调用作时认知服务帐户的状态。

说明
Accepted
Creating
Deleting
Moving
Failed
Succeeded
ResolvingDNS

ResourceIdentityType

标识类型。

说明
None
SystemAssigned
UserAssigned
SystemAssigned, UserAssigned

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建的时间戳 (UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识类型。

lastModifiedAt

string (date-time)

资源上次修改的时间戳 (UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识类型。

UserAssignedIdentity

用户分配的托管标识。

名称 类型 说明
clientId

string

与此标识关联的客户端应用 ID。

principalId

string

与此标识关联的 Azure Active Directory 主体 ID。