Share via


Deployments.GetDeploymentAsync Method

Definition

Overloads

GetDeploymentAsync(String, RequestContext)

[Protocol Method] Get a deployed model.

GetDeploymentAsync(String, CancellationToken)

Get a deployed model.

GetDeploymentAsync(String, RequestContext)

Source:
Deployments.cs

[Protocol Method] Get a deployed model.

public virtual System.Threading.Tasks.Task<Azure.Response> GetDeploymentAsync(string name, Azure.RequestContext context);
abstract member GetDeploymentAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDeploymentAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetDeploymentAsync (name As String, context As RequestContext) As Task(Of Response)

Parameters

name
String

Name of the deployment.

context
RequestContext

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

Returns

The response returned from the service.

Exceptions

name is null.

name is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetDeploymentAsync 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");

Response response = await client.GetDeploymentAsync("qqvacpzjfk", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("name").ToString());

Applies to

GetDeploymentAsync(String, CancellationToken)

Source:
Deployments.cs

Get a deployed model.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.AIDeployment>> GetDeploymentAsync(string name, System.Threading.CancellationToken cancellationToken = default);
abstract member GetDeploymentAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.AIDeployment>>
override this.GetDeploymentAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.AIDeployment>>
Public Overridable Function GetDeploymentAsync (name As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AIDeployment))

Parameters

name
String

Name of the deployment.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

name is null.

name is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetDeploymentAsync.

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

Response<Deployment> response = await client.GetDeploymentAsync("qqvacpzjfk");

Applies to