FabricClient.ServiceManagementClient.CreateServiceAsync 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
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 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
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.
When description
is null.
Remarks
The default timeout is one minute for which the system will allow this operation to continue before returning 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 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
- TimeSpan
The maximum amount of time the system will allow this operation to continue before returning TimeoutException.
- cancellationToken
- CancellationToken
The CancellationTokenthat the operation is observing. It can be used to propagate notification that the operation should be canceled.
Returns
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.
When serviceDescription
is null.
Remarks
Service Fabric name will be implicitly created if it does not already exist.
Applies to
Azure SDK for .NET