Deployments.GetDeployment Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetDeployment(String, CancellationToken) convenience overload with strongly typed models first.
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");