Cree el proyecto de la cuenta de Cognitive Services. El proyecto es un subrecurso de una cuenta que le da al desarrollador de IA su contenedor individual para trabajar.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}?api-version=2025-06-01
Parámetros de identificador URI
| Nombre |
En |
Requerido |
Tipo |
Description |
|
accountName
|
path |
True
|
string
minLength: 2 maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$
|
Nombre de la cuenta de Cognitive Services.
|
|
projectName
|
path |
True
|
string
minLength: 2 maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$
|
Nombre del proyecto de la cuenta de Cognitive Services.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nombre del grupo de recursos. El nombre distingue mayúsculas de minúsculas.
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
Identificador de la suscripción de destino.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Versión de la API que se va a usar para esta operación.
|
Cuerpo de la solicitud
| Nombre |
Tipo |
Description |
|
identity
|
Identity
|
Identidad del recurso.
|
|
location
|
string
|
Ubicación geográfica donde reside el recurso
|
|
properties
|
ProjectProperties
|
Propiedades del proyecto de Cognitive Services.
|
|
tags
|
object
|
Etiquetas de recursos.
|
Respuestas
| Nombre |
Tipo |
Description |
|
200 OK
|
Project
|
Si el recurso se crea correctamente o ya existe, el servicio debe devolver 200 (OK).
|
|
201 Created
|
Project
|
Si el recurso se crea correctamente, el servicio debe devolver 201 (OK).
|
|
202 Accepted
|
Project
|
HTTP 202 (aceptado) si la operación se inició correctamente y se completará de forma asincrónica.
|
|
Other Status Codes
|
ErrorResponse
|
Respuesta de error que describe por qué falló la operación
|
Ejemplos
Create Project
Solicitud de ejemplo
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"
}
}
import com.azure.resourcemanager.cognitiveservices.models.Identity;
import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties;
import com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType;
/**
* Samples for Projects Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/
* CreateProject.json
*/
/**
* Sample code: Create Project.
*
* @param manager Entry point to CognitiveServicesManager.
*/
public static void createProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) {
manager.projects().define("testProject1").withExistingAccount("myResourceGroup", "testCreate1")
.withRegion("West US").withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
.withProperties(
new ProjectProperties().withDisplayName("p1").withDescription("Description of this project"))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cognitiveservices
# USAGE
python create_project.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CognitiveServicesManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-1111-2222-3333-444444444444",
)
response = client.projects.begin_create(
resource_group_name="myResourceGroup",
account_name="testCreate1",
project_name="testProject1",
project={
"identity": {"type": "SystemAssigned"},
"location": "West US",
"properties": {"description": "Description of this project", "displayName": "p1"},
},
).result()
print(response)
# x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/CreateProject.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcognitiveservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1004eed4202d64b48157c084fe2830760f8190f4/specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/CreateProject.json
func ExampleProjectsClient_BeginCreate_createProject() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcognitiveservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewProjectsClient().BeginCreate(ctx, "myResourceGroup", "testCreate1", "testProject1", armcognitiveservices.Project{
Identity: &armcognitiveservices.Identity{
Type: to.Ptr(armcognitiveservices.ResourceIdentityTypeSystemAssigned),
},
Location: to.Ptr("West US"),
Properties: &armcognitiveservices.ProjectProperties{
Description: to.Ptr("Description of this project"),
DisplayName: to.Ptr("p1"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Project = armcognitiveservices.Project{
// Name: to.Ptr("testProject1"),
// Type: to.Ptr("Microsoft.CognitiveServices/accounts/projects"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1/projects/testProject1"),
// Etag: to.Ptr("W/\"datetime'2017-04-10T08%3A00%3A05.445595Z'\""),
// Identity: &armcognitiveservices.Identity{
// Type: to.Ptr(armcognitiveservices.ResourceIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("b5cf119e-a5c2-42c7-802f-592e0efb169f"),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// },
// Location: to.Ptr("West US"),
// Properties: &armcognitiveservices.ProjectProperties{
// Description: to.Ptr("Description of this project"),
// DisplayName: to.Ptr("p1"),
// Endpoints: map[string]*string{
// "OpenAI Dall-E API": to.Ptr("https://sub-donmain-name.openai.azure.com/"),
// "OpenAI Language Model Instance API": to.Ptr("https://sub-donmain-name.openai.azure.com/"),
// "OpenAI Sora API": to.Ptr("https://sub-donmain-name.openai.azure.com/"),
// },
// IsDefault: to.Ptr(true),
// ProvisioningState: to.Ptr(armcognitiveservices.ProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CognitiveServicesManagementClient } = require("@azure/arm-cognitiveservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's individual container to work on.
*
* @summary Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's individual container to work on.
* x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/CreateProject.json
*/
async function createProject() {
const subscriptionId =
process.env["COGNITIVESERVICES_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444";
const resourceGroupName = process.env["COGNITIVESERVICES_RESOURCE_GROUP"] || "myResourceGroup";
const accountName = "testCreate1";
const projectName = "testProject1";
const project = {
identity: { type: "SystemAssigned" },
location: "West US",
properties: {
description: "Description of this project",
displayName: "p1",
},
};
const credential = new DefaultAzureCredential();
const client = new CognitiveServicesManagementClient(credential, subscriptionId);
const result = await client.projects.beginCreateAndWait(
resourceGroupName,
accountName,
projectName,
project,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.CognitiveServices.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.CognitiveServices;
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/CreateProject.json
// this example is just showing the usage of "Projects_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this CognitiveServicesAccountResource created on azure
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "myResourceGroup";
string accountName = "testCreate1";
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
// get the collection of this CognitiveServicesProjectResource
CognitiveServicesProjectCollection collection = cognitiveServicesAccount.GetCognitiveServicesProjects();
// invoke the operation
string projectName = "testProject1";
CognitiveServicesProjectData data = new CognitiveServicesProjectData(new AzureLocation("West US"))
{
Identity = new ManagedServiceIdentity("SystemAssigned"),
Properties = new CognitiveServicesProjectProperties
{
DisplayName = "p1",
Description = "Description of this project",
},
};
ArmOperation<CognitiveServicesProjectResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, projectName, data);
CognitiveServicesProjectResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CognitiveServicesProjectData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Respuesta de muestra
{
"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
Solicitud de ejemplo
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"
}
}
import com.azure.resourcemanager.cognitiveservices.models.Identity;
import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties;
import com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType;
/**
* Samples for Projects Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/
* CreateProjectMin.json
*/
/**
* Sample code: Create Project Min.
*
* @param manager Entry point to CognitiveServicesManager.
*/
public static void createProjectMin(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) {
manager.projects().define("testProject1").withExistingAccount("myResourceGroup", "testCreate1")
.withRegion("West US").withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
.withProperties(new ProjectProperties()).create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cognitiveservices
# USAGE
python create_project_min.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CognitiveServicesManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-1111-2222-3333-444444444444",
)
response = client.projects.begin_create(
resource_group_name="myResourceGroup",
account_name="testCreate1",
project_name="testProject1",
project={"identity": {"type": "SystemAssigned"}, "location": "West US", "properties": {}},
).result()
print(response)
# x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/CreateProjectMin.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcognitiveservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1004eed4202d64b48157c084fe2830760f8190f4/specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/CreateProjectMin.json
func ExampleProjectsClient_BeginCreate_createProjectMin() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcognitiveservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewProjectsClient().BeginCreate(ctx, "myResourceGroup", "testCreate1", "testProject1", armcognitiveservices.Project{
Identity: &armcognitiveservices.Identity{
Type: to.Ptr(armcognitiveservices.ResourceIdentityTypeSystemAssigned),
},
Location: to.Ptr("West US"),
Properties: &armcognitiveservices.ProjectProperties{},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Project = armcognitiveservices.Project{
// Name: to.Ptr("testProject1"),
// Type: to.Ptr("Microsoft.CognitiveServices/accounts/projects"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/testCreate1/projects/testProject1"),
// Etag: to.Ptr("W/\"datetime'2017-04-10T08%3A00%3A05.445595Z'\""),
// Identity: &armcognitiveservices.Identity{
// Type: to.Ptr(armcognitiveservices.ResourceIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("b5cf119e-a5c2-42c7-802f-592e0efb169f"),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// },
// Location: to.Ptr("West US"),
// Properties: &armcognitiveservices.ProjectProperties{
// Endpoints: map[string]*string{
// "OpenAI Dall-E API": to.Ptr("https://sub-donmain-name.openai.azure.com/"),
// "OpenAI Language Model Instance API": to.Ptr("https://sub-donmain-name.openai.azure.com/"),
// "OpenAI Sora API": to.Ptr("https://sub-donmain-name.openai.azure.com/"),
// },
// IsDefault: to.Ptr(true),
// ProvisioningState: to.Ptr(armcognitiveservices.ProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CognitiveServicesManagementClient } = require("@azure/arm-cognitiveservices");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's individual container to work on.
*
* @summary Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's individual container to work on.
* x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/CreateProjectMin.json
*/
async function createProjectMin() {
const subscriptionId =
process.env["COGNITIVESERVICES_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444";
const resourceGroupName = process.env["COGNITIVESERVICES_RESOURCE_GROUP"] || "myResourceGroup";
const accountName = "testCreate1";
const projectName = "testProject1";
const project = {
identity: { type: "SystemAssigned" },
location: "West US",
properties: {},
};
const credential = new DefaultAzureCredential();
const client = new CognitiveServicesManagementClient(credential, subscriptionId);
const result = await client.projects.beginCreateAndWait(
resourceGroupName,
accountName,
projectName,
project,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.CognitiveServices.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.CognitiveServices;
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/examples/CreateProjectMin.json
// this example is just showing the usage of "Projects_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this CognitiveServicesAccountResource created on azure
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "myResourceGroup";
string accountName = "testCreate1";
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
// get the collection of this CognitiveServicesProjectResource
CognitiveServicesProjectCollection collection = cognitiveServicesAccount.GetCognitiveServicesProjects();
// invoke the operation
string projectName = "testProject1";
CognitiveServicesProjectData data = new CognitiveServicesProjectData(new AzureLocation("West US"))
{
Identity = new ManagedServiceIdentity("SystemAssigned"),
Properties = new CognitiveServicesProjectProperties(),
};
ArmOperation<CognitiveServicesProjectResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, projectName, data);
CognitiveServicesProjectResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CognitiveServicesProjectData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Respuesta de muestra
{
"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"
}
}
Definiciones
| Nombre |
Description |
|
createdByType
|
El tipo de identidad que creó el recurso.
|
|
ErrorAdditionalInfo
|
Información adicional sobre el error de administración de recursos.
|
|
ErrorDetail
|
Detalle del error.
|
|
ErrorResponse
|
Respuesta de error
|
|
Identity
|
Identidad del recurso.
|
|
Project
|
El proyecto de Cognitive Services es un recurso de Azure que representa el proyecto de la cuenta aprovisionada, su tipo, ubicación y SKU.
|
|
ProjectProperties
|
Propiedades del proyecto de servicios cognitivos".
|
|
ProvisioningState
|
Obtiene el estado de la cuenta de servicios cognitivos en el momento en que se llamó a la operación.
|
|
ResourceIdentityType
|
Tipo de identidad.
|
|
systemData
|
Metadatos relativos a la creación y última modificación del recurso.
|
|
UserAssignedIdentity
|
Identidad administrada asignada por el usuario.
|
createdByType
Enumeración
El tipo de identidad que creó el recurso.
| Valor |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ErrorAdditionalInfo
Objeto
Información adicional sobre el error de administración de recursos.
| Nombre |
Tipo |
Description |
|
info
|
object
|
Información adicional.
|
|
type
|
string
|
Tipo de información adicional.
|
ErrorDetail
Objeto
Detalle del error.
| Nombre |
Tipo |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Información adicional del error.
|
|
code
|
string
|
Código de error.
|
|
details
|
ErrorDetail[]
|
Detalles del error.
|
|
message
|
string
|
El mensaje de error.
|
|
target
|
string
|
Destino del error.
|
ErrorResponse
Objeto
Respuesta de error
| Nombre |
Tipo |
Description |
|
error
|
ErrorDetail
|
Objeto de error.
|
Identity
Objeto
Identidad del recurso.
| Nombre |
Tipo |
Description |
|
principalId
|
string
|
Identificador principal de la identidad del recurso.
|
|
tenantId
|
string
|
Identificador de inquilino del recurso.
|
|
type
|
ResourceIdentityType
|
Tipo de identidad.
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
La lista de identidades asignadas por el usuario asociadas con el recurso. Las referencias de clave del diccionario de identidad de usuario serán identificadores de recursos de ARM con el formato: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}
|
Project
Objeto
El proyecto de Cognitive Services es un recurso de Azure que representa el proyecto de la cuenta aprovisionada, su tipo, ubicación y SKU.
| Nombre |
Tipo |
Description |
|
etag
|
string
|
Etag de recursos.
|
|
id
|
string
|
Identificador de recurso completo para el recurso. Ej: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
identity
|
Identity
|
Identidad del recurso.
|
|
location
|
string
|
Ubicación geográfica donde reside el recurso
|
|
name
|
string
|
Nombre del recurso
|
|
properties
|
ProjectProperties
|
Propiedades del proyecto de Cognitive Services.
|
|
systemData
|
systemData
|
Metadatos relativos a la creación y última modificación del recurso.
|
|
tags
|
object
|
Etiquetas de recursos.
|
|
type
|
string
|
Tipo de recurso. Por ejemplo, "Microsoft.Compute/virtualMachines" o "Microsoft.Storage/storageAccounts"
|
ProjectProperties
Objeto
Propiedades del proyecto de servicios cognitivos".
| Nombre |
Tipo |
Description |
|
description
|
string
|
Descripción del proyecto de Cognitive Services.
|
|
displayName
|
string
|
Nombre para mostrar del proyecto de Cognitive Services.
|
|
endpoints
|
object
|
La lista de puntos de conexión para este proyecto de Cognitive Services.
|
|
isDefault
|
boolean
|
Indica si el proyecto es el proyecto predeterminado para la cuenta.
|
|
provisioningState
|
ProvisioningState
|
Obtiene el estado del proyecto de servicios cognitivos en el momento en que se llamó a la operación.
|
ProvisioningState
Enumeración
Obtiene el estado de la cuenta de servicios cognitivos en el momento en que se llamó a la operación.
| Valor |
Description |
|
Accepted
|
|
|
Creating
|
|
|
Deleting
|
|
|
Moving
|
|
|
Failed
|
|
|
Succeeded
|
|
|
ResolvingDNS
|
|
ResourceIdentityType
Enumeración
Tipo de identidad.
| Valor |
Description |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned, UserAssigned
|
|
systemData
Objeto
Metadatos relativos a la creación y última modificación del recurso.
| Nombre |
Tipo |
Description |
|
createdAt
|
string
(date-time)
|
La marca de tiempo de la creación de recursos (UTC).
|
|
createdBy
|
string
|
La identidad que creó el recurso.
|
|
createdByType
|
createdByType
|
El tipo de identidad que creó el recurso.
|
|
lastModifiedAt
|
string
(date-time)
|
La marca de tiempo de la última modificación del recurso (UTC)
|
|
lastModifiedBy
|
string
|
La identidad que modificó por última vez el recurso.
|
|
lastModifiedByType
|
createdByType
|
El tipo de identidad que modificó por última vez el recurso.
|
UserAssignedIdentity
Objeto
Identidad administrada asignada por el usuario.
| Nombre |
Tipo |
Description |
|
clientId
|
string
|
Identificador de aplicación cliente asociado a esta identidad.
|
|
principalId
|
string
|
Identificador de entidad de seguridad de Azure Active Directory asociado a esta identidad.
|