Bilişsel Hizmetler hesabının projesini oluşturun. Proje, AI geliştiricisine üzerinde çalışacağı ayrı bir kapsayıcı sağlayan bir hesabın alt kaynağıdır.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}?api-version=2025-06-01
URI Parametreleri
| Name |
İçinde |
Gerekli |
Tür |
Description |
|
accountName
|
path |
True
|
string
minLength: 2 maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$
|
Bilişsel Hizmetler hesabının adı.
|
|
projectName
|
path |
True
|
string
minLength: 2 maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$
|
Bilişsel Hizmetler hesabının projesinin adı.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Kaynak grubunun adı. Ad büyük/küçük harfe duyarsız.
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
Hedef aboneliğin kimliği.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Bu işlem için kullanılacak API sürümü.
|
İstek Gövdesi
| Name |
Tür |
Description |
|
identity
|
Identity
|
Kaynağın kimliği.
|
|
location
|
string
|
Kaynağın bulunduğu coğrafi konum
|
|
properties
|
ProjectProperties
|
Bilişsel Hizmetler projesinin özellikleri.
|
|
tags
|
object
|
Kaynak etiketleri.
|
Yanıtlar
| Name |
Tür |
Description |
|
200 OK
|
Project
|
Kaynak başarıyla oluşturulduysa veya zaten mevcutsa, hizmetin 200 (Tamam) döndürmesi gerekir.
|
|
201 Created
|
Project
|
Kaynak başarıyla oluşturulursa, hizmetin 201 (Tamam) döndürmesi gerekir.
|
|
202 Accepted
|
Project
|
HTTP 202 (Kabul Edildi) işlem başarıyla başlatıldıysa ve zaman uyumsuz olarak tamamlanacaksa.
|
|
Other Status Codes
|
ErrorResponse
|
İşlemin neden başarısız olduğunu açıklayan hata yanıtı
|
Örnekler
Create Project
Örnek isteği
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
Örnek yanıt
{
"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
Örnek isteği
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
Örnek yanıt
{
"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"
}
}
Tanımlar
createdByType
Numaralandırma
Kaynağı oluşturan kimliğin türü.
| Değer |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ErrorAdditionalInfo
Nesne
Kaynak yönetimi hatası ek bilgileri.
| Name |
Tür |
Description |
|
info
|
object
|
Ek bilgi.
|
|
type
|
string
|
Ek bilgi türü.
|
ErrorDetail
Nesne
Hata ayrıntısı.
| Name |
Tür |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Hata ek bilgileri.
|
|
code
|
string
|
Hata kodu.
|
|
details
|
ErrorDetail[]
|
Hata ayrıntıları.
|
|
message
|
string
|
Hata iletisi.
|
|
target
|
string
|
Hata hedefi.
|
ErrorResponse
Nesne
Hata yanıtı
Identity
Nesne
Kaynağın kimliği.
| Name |
Tür |
Description |
|
principalId
|
string
|
Kaynak kimliğinin asıl kimliği.
|
|
tenantId
|
string
|
Kaynağın kiracı kimliği.
|
|
type
|
ResourceIdentityType
|
Kimlik türü.
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentity>
|
Kaynakla ilişkilendirilmiş kullanıcı tarafından atanan kimliklerin listesi. Kullanıcı kimliği sözlüğü anahtar başvuruları şu biçimde ARM kaynak kimlikleri olacaktır: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}
|
Project
Nesne
Bilişsel Hizmetler projesi, sağlanan hesabın projesini, türünü, konumunu ve SKU'sunu temsil eden bir Azure kaynağıdır.
| Name |
Tür |
Description |
|
etag
|
string
|
Kaynak Etag'i.
|
|
id
|
string
|
Kaynağın tam kaynak kimliği. Örn - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
identity
|
Identity
|
Kaynağın kimliği.
|
|
location
|
string
|
Kaynağın bulunduğu coğrafi konum
|
|
name
|
string
|
Kaynağın adı
|
|
properties
|
ProjectProperties
|
Bilişsel Hizmetler projesinin özellikleri.
|
|
systemData
|
systemData
|
Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.
|
|
tags
|
object
|
Kaynak etiketleri.
|
|
type
|
string
|
Kaynağın türü. Örneğin, "Microsoft.Compute/virtualMachines" veya "Microsoft.Storage/storageAccounts"
|
ProjectProperties
Nesne
Bilişsel Hizmetler Projesinin Özellikleri'.
| Name |
Tür |
Description |
|
description
|
string
|
Bilişsel Hizmetler Projesi'nin açıklaması.
|
|
displayName
|
string
|
Bilişsel Hizmetler Projesi'nin görünen adı.
|
|
endpoints
|
object
|
Bu Bilişsel Hizmetler Projesi için uç nokta listesi.
|
|
isDefault
|
boolean
|
Projenin, hesap için varsayılan proje olup olmadığını gösterir.
|
|
provisioningState
|
ProvisioningState
|
İşlemin çağrıldığı sırada bilişsel hizmetler projesinin durumunu alır.
|
ProvisioningState
Numaralandırma
İşlemin çağrıldığı sırada bilişsel hizmetler hesabının durumunu alır.
| Değer |
Description |
|
Accepted
|
|
|
Creating
|
|
|
Deleting
|
|
|
Moving
|
|
|
Failed
|
|
|
Succeeded
|
|
|
ResolvingDNS
|
|
ResourceIdentityType
Numaralandırma
Kimlik türü.
| Değer |
Description |
|
None
|
|
|
SystemAssigned
|
|
|
UserAssigned
|
|
|
SystemAssigned, UserAssigned
|
|
systemData
Nesne
Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.
| Name |
Tür |
Description |
|
createdAt
|
string
(date-time)
|
Kaynak oluşturma zaman damgası (UTC).
|
|
createdBy
|
string
|
Kaynağı oluşturan kimlik.
|
|
createdByType
|
createdByType
|
Kaynağı oluşturan kimliğin türü.
|
|
lastModifiedAt
|
string
(date-time)
|
Kaynak son değişikliğinin zaman damgası (UTC)
|
|
lastModifiedBy
|
string
|
Kaynağı en son değiştiren kimlik.
|
|
lastModifiedByType
|
createdByType
|
Kaynağı en son değiştiren kimlik türü.
|
UserAssignedIdentity
Nesne
Kullanıcı tarafından atanan yönetilen kimlik.
| Name |
Tür |
Description |
|
clientId
|
string
|
Bu kimlikle ilişkili İstemci Uygulama Kimliği.
|
|
principalId
|
string
|
Bu kimlikle ilişkili Azure Active Directory asıl kimliği.
|