FabricClient.ServiceManagementClient.CreateServiceAsync Method

Definition

Overloads

CreateServiceAsync(ServiceDescription)

Instantiates a service with specified description.

CreateServiceAsync(ServiceDescription, TimeSpan, CancellationToken)

Instantiates a service with specified description. Also takes in timeout interval, which is the maximum of time the system will allow this operation to continue before returning System.TimeoutException and cancellation-token that the operation is observing.

CreateServiceAsync(ServiceDescription)

Instantiates a service with specified description.

public System.Threading.Tasks.Task CreateServiceAsync (System.Fabric.Description.ServiceDescription description);
member this.CreateServiceAsync : System.Fabric.Description.ServiceDescription -> System.Threading.Tasks.Task
Public Function CreateServiceAsync (description As ServiceDescription) As Task

Parameters

description
ServiceDescription

The configuration for the service. A ServiceDescription contains all of the information necessary to create a service.

Returns

System.Threading.Tasks.Task

The instantiated service.

Exceptions

The FabricClient object is in a closed state. Dispose of the FabricClient object you are using and instantiate a new FabricClient object.

System.ArgumentNullException

When description is null.

Remarks

The default timeout is one minute for which the system will allow this operation to continue before returning System.TimeoutException.

Service Fabric name will be implicitly created if it does not already exist.

Applies to

CreateServiceAsync(ServiceDescription, TimeSpan, CancellationToken)

Instantiates a service with specified description. Also takes in timeout interval, which is the maximum of time the system will allow this operation to continue before returning System.TimeoutException and cancellation-token that the operation is observing.

public System.Threading.Tasks.Task CreateServiceAsync (System.Fabric.Description.ServiceDescription serviceDescription, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
member this.CreateServiceAsync : System.Fabric.Description.ServiceDescription * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function CreateServiceAsync (serviceDescription As ServiceDescription, timeout As TimeSpan, cancellationToken As CancellationToken) As Task

Parameters

serviceDescription
ServiceDescription

The configuration for the service. A ServiceDescription contains all of the information necessary to create a service.

timeout
System.TimeSpan

The maximum amount of time the system will allow this operation to continue before returning System.TimeoutException.

cancellationToken
System.Threading.CancellationToken

The System.Threading.CancellationTokenthat the operation is observing. It can be used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task

The instantiated service.

Exceptions

The FabricClient object is in a closed state. Dispose of the FabricClient object you are using and instantiate a new FabricClient object.

System.ArgumentNullException

When serviceDescription is null.

Remarks

Service Fabric name will be implicitly created if it does not already exist.

Applies to