次の方法で共有


DevBoxesClient.GetRemoteConnectionAsync Method

Definition

Overloads

GetRemoteConnectionAsync(String, String, String, CancellationToken)

Gets RDP Connection info.

GetRemoteConnectionAsync(String, String, String, RequestContext)

[Protocol Method] Gets RDP Connection info

GetRemoteConnectionAsync(String, String, String, CancellationToken)

Source:
DevBoxesClient.cs

Gets RDP Connection info.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.RemoteConnection>> GetRemoteConnectionAsync (string projectName, string userId, string devBoxName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRemoteConnectionAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.RemoteConnection>>
override this.GetRemoteConnectionAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.RemoteConnection>>
Public Overridable Function GetRemoteConnectionAsync (projectName As String, userId As String, devBoxName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of RemoteConnection))

Parameters

projectName
String

The DevCenter Project upon which to execute operations.

userId
String

The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.

devBoxName
String

The name of a Dev Box.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName, userId or devBoxName is null.

projectName, userId or devBoxName is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetRemoteConnectionAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);

Response<RemoteConnection> response = await client.GetRemoteConnectionAsync("<projectName>", "<userId>", "<devBoxName>");

This sample shows how to call GetRemoteConnectionAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);

Response<RemoteConnection> response = await client.GetRemoteConnectionAsync("<projectName>", "<userId>", "<devBoxName>");

Applies to

GetRemoteConnectionAsync(String, String, String, RequestContext)

Source:
DevBoxesClient.cs
Source:
DevBoxesClient.cs

[Protocol Method] Gets RDP Connection info

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

Parameters

projectName
String

The DevCenter Project upon which to execute operations.

userId
String

The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.

devBoxName
String

The name of a Dev Box.

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

projectName, userId or devBoxName is null.

projectName, userId or devBoxName 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 GetRemoteConnectionAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);

Response response = await client.GetRemoteConnectionAsync("<projectName>", "<userId>", "<devBoxName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

This sample shows how to call GetRemoteConnectionAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);

Response response = await client.GetRemoteConnectionAsync("<projectName>", "<userId>", "<devBoxName>", null);

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

Applies to