Share via


Deployments.GetDeployment Method

Definition

Overloads

GetDeployment(String, RequestContext)

[Protocol Method] Get a deployed model.

GetDeployment(String, CancellationToken)

Get a deployed model.

GetDeployment(String, RequestContext)

Source:
Deployments.cs

[Protocol Method] Get a deployed model.

public virtual Azure.Response GetDeployment(string name, Azure.RequestContext context);
abstract member GetDeployment : string * Azure.RequestContext -> Azure.Response
override this.GetDeployment : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetDeployment (name As String, context As RequestContext) As 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 GetDeployment 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 = client.GetDeployment("qqvacpzjfk", null);

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

Applies to

GetDeployment(String, CancellationToken)

Source:
Deployments.cs

Get a deployed model.

public virtual Azure.Response<Azure.AI.Projects.AIDeployment> GetDeployment(string name, System.Threading.CancellationToken cancellationToken = default);
abstract member GetDeployment : string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Projects.AIDeployment>
override this.GetDeployment : string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Projects.AIDeployment>
Public Overridable Function GetDeployment (name As String, Optional cancellationToken As CancellationToken = Nothing) As 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 GetDeployment.

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

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

Applies to