Share via


Deployments.GetDeploymentsAsync Method

Definition

Overloads

GetDeploymentsAsync(String, String, Nullable<DeploymentType>, CancellationToken)

List all deployed models in the project.

GetDeploymentsAsync(String, String, String, RequestContext)

[Protocol Method] List all deployed models in the project

GetDeploymentsAsync(String, String, Nullable<DeploymentType>, CancellationToken)

Source:
Deployments.cs

List all deployed models in the project.

public virtual Azure.AsyncPageable<Azure.AI.Projects.AIDeployment> GetDeploymentsAsync(string modelPublisher = default, string modelName = default, Azure.AI.Projects.DeploymentType? deploymentType = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetDeploymentsAsync : string * string * Nullable<Azure.AI.Projects.DeploymentType> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.AI.Projects.AIDeployment>
override this.GetDeploymentsAsync : string * string * Nullable<Azure.AI.Projects.DeploymentType> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.AI.Projects.AIDeployment>
Public Overridable Function GetDeploymentsAsync (Optional modelPublisher As String = Nothing, Optional modelName As String = Nothing, Optional deploymentType As Nullable(Of DeploymentType) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of AIDeployment)

Parameters

modelPublisher
String

Model publisher to filter models by.

modelName
String

Model name (the publisher specific name) to filter models by.

deploymentType
Nullable<DeploymentType>

Type of deployment to filter list by.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetDeploymentsAsync.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Deployments client = new AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview");

await foreach (Deployment item in client.GetDeploymentsAsync())
{
}

Applies to

GetDeploymentsAsync(String, String, String, RequestContext)

Source:
Deployments.cs

[Protocol Method] List all deployed models in the project

public virtual Azure.AsyncPageable<BinaryData> GetDeploymentsAsync(string modelPublisher, string modelName, string deploymentType, Azure.RequestContext context);
abstract member GetDeploymentsAsync : string * string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetDeploymentsAsync : string * string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetDeploymentsAsync (modelPublisher As String, modelName As String, deploymentType As String, context As RequestContext) As AsyncPageable(Of BinaryData)

Parameters

modelPublisher
String

Model publisher to filter models by.

modelName
String

Model name (the publisher specific name) to filter models by.

deploymentType
String

Type of deployment to filter list by. Allowed values: "ModelDeployment".

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call GetDeploymentsAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Deployments client = new AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview");

await foreach (BinaryData item in client.GetDeploymentsAsync("kznreojrvlwdq", "gplerszsuyisseeksnyvkaqperxox", null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("type").ToString());
    Console.WriteLine(result.GetProperty("name").ToString());
}

Applies to