Service Fabric Create Service

Creates or updates a Service Fabric service resource.

Create or update a Service Fabric service resource with the specified name.

Request

Method Request URI
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}?api-version=2017-07-01-preview

Parameters

Name Type Required Location
subscriptionId string Yes Path
resourceGroupName string Yes Path
clusterName string Yes Path
applicationName string Yes Path
serviceName string Yes Path
api-version string Yes Query
parameters ServiceResource Yes Body

subscriptionId

Type: string
Required: Yes

The customer subscription identifier.


resourceGroupName

Type: string
Required: Yes

The name of the resource group.


clusterName

Type: string
Required: Yes

The name of the cluster resource.


applicationName

Type: string
Required: Yes

The name of the application resource.


serviceName

Type: string
Required: Yes

The name of the service resource in the format of {applicationName}~{serviceName}.


api-version

Type: string
Required: Yes
Default: 2017-07-01-preview

The version of the Service Fabric resource provider API. This is a required parameter and it's value must be "2017-07-01-preview" for this specification.


parameters

Type: ServiceResource
Required: Yes

The service resource.

Responses

HTTP Status Code Description Response Schema
202 (Accepted) The request was accepted and the operation will complete asynchronously.
ServiceResource
All other status codes The detailed error response.
ErrorModel

Examples

Put a service with mininum parameters

Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService?api-version=2017-07-01-preview
Body
{
  "type": "services",
  "location": "eastus",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService",
  "name": "myCluster",
  "tags": {},
  "properties": {
    "serviceKind": "Stateless",
    "serviceTypeName": "myServiceType",
    "partitionDescription": {
      "partitionScheme": "Singleton"
    },
    "instanceCount": "1"
  }
}

202 Response

Headers
Retry-After: 10
Location: http://10.91.140.224/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/operationResults/5bc615c3-6c5b-4593-80e1-008f55376ec7?api-version=2017-07-01-preview
Body
{
  "type": "services",
  "location": "eastus",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService",
  "name": "myCluster",
  "tags": {},
  "etag": "W/\"636462502183671256\"",
  "properties": {
    "provisioningState": "Updating",
    "serviceKind": "Stateless",
    "serviceTypeName": "myServiceType",
    "partitionDescription": {
      "partitionScheme": "Singleton"
    },
    "instanceCount": "1"
  }
}

Put a service with maximum parameters

Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService?api-version=2017-07-01-preview
Body
{
  "type": "services",
  "location": "eastus",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService",
  "name": "myCluster",
  "tags": {},
  "properties": {
    "serviceKind": "Stateless",
    "placementConstraints": "NodeType==frontend",
    "serviceTypeName": "myServiceType",
    "partitionDescription": {
      "partitionScheme": "Singleton"
    },
    "serviceLoadMetrics": [
      {
        "name": "metric1",
        "weight": "Low"
      }
    ],
    "correlationScheme": [
      {
        "serviceName": "fabric:/app1/app1~svc1",
        "scheme": "Affinity"
      }
    ],
    "servicePlacementPolicies": [],
    "defaultMoveCost": "Medium",
    "instanceCount": "5"
  }
}

202 Response

Headers
Retry-After: 10
Location: http://10.91.140.224/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/operationResults/2e633105-aadc-4928-9164-d76b974170a3?api-version=2017-07-01-preview
Body
{
  "type": "services",
  "location": "eastus",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService",
  "name": "myCluster",
  "tags": {},
  "etag": "W/\"636462502183671258\"",
  "properties": {
    "provisioningState": "Updating",
    "serviceKind": "Stateless",
    "placementConstraints": "NodeType==frontend",
    "serviceTypeName": "myServiceType",
    "partitionDescription": {
      "partitionScheme": "Singleton"
    },
    "serviceLoadMetrics": [
      {
        "name": "metric1",
        "weight": "Low"
      }
    ],
    "servicePlacementPolicies": [],
    "defaultMoveCost": "Medium",
    "instanceCount": "5"
  }
}