az sf service

Manage services running on an Azure Service Fabric cluster.

Commands

az sf service create

Create a new service on an Azure Service Fabric cluster.

az sf service delete

Delete a service.

az sf service list

List services of a given application.

az sf service show

Get a service.

az sf service create

Create a new service on an Azure Service Fabric cluster.

az sf service create --application
                     --cluster-name
                     --name
                     --resource-group
                     --service-type
                     --state {stateful, stateless}
                     [--default-move-cost {High, Low, Medium, Zero}]
                     [--instance-count]
                     [--min-replica]
                     [--partition-scheme {named, singleton, uniformInt64}]
                     [--subscription]
                     [--target-replica]

Examples

Create a new stateless service "testApp~testService1" with instance count -1 (on all the nodes).

az sf service create -g testRG -c testCluster --application-name testApp --state stateless --service-name testApp~testService \
  --service-type testStateless --instance-count -1 --partition-scheme singleton

Create a new stateful service "testApp~testService2" with a target of 5 nodes.

az sf service create -g testRG -c testCluster --application-name testApp --state stateful --service-name testApp~testService2 \
  --service-type testStatefulType --min-replica-set-size 3 --target-replica-set-size 5

Required Parameters

--application --application-name

Specify the name of the service. The application name must be a prefix of the service name, for example: appName~serviceName.

--cluster-name -c

Specify the name of the cluster, if not given it will be same as resource group name.

--name --service-name

Specify the name of the service. The application name must be a prefix of the service name, for example: appName~serviceName.

--resource-group -g

Specify the resource group name. You can configure the default group using az configure --defaults group=<name>.

--service-type

Specify the service type name of the application, it should exist in the application manifest.

--state

Specify if the service is stateless or stateful.

accepted values: stateful, stateless

Optional Parameters

--default-move-cost

Specify the default cost for a move. Higher costs make it less likely that the Cluster Resource Manager will move the replica when trying to balance the cluster.

accepted values: High, Low, Medium, Zero
--instance-count

Specify the instance count for the stateless service. If -1 is used, it means it will run on all the nodes.

--min-replica --min-replica-set-size

Specify the min replica set size for the stateful service.

--partition-scheme

Specify what partition scheme to use. Singleton partitions are typically used when the service does not require any additional routing. UniformInt64 means that each partition owns a range of int64 keys. Named is usually for services with data that can be bucketed, within a bounded set. Some common examples of data fields used as named partition keys would be regions, postal codes, customer groups, or other business boundaries.

accepted values: named, singleton, uniformInt64
default value: singleton
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--target-replica --target-replica-set-size

Specify the target replica set size for the stateful service.

az sf service delete

Delete a service.

az sf service delete --application-name
                     --cluster-name
                     --name
                     --resource-group
                     [--subscription]

Examples

Delete service.

az sf service delete -g testRG -c testCluster --application-name testApp --service-name testApp~testService

Required Parameters

--application-name

The name of the application resource.

--cluster-name -c

Specify the name of the cluster, if not given it will be same as resource group name.

--name --service-name

Specify the name of the service. The application name must be a prefix of the service name, for example: appName~serviceName.

--resource-group -g

Specify the resource group name. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sf service list

List services of a given application.

az sf service list --application-name
                   --cluster-name
                   --resource-group
                   [--query-examples]
                   [--subscription]

Examples

List services.

az sf service list -g testRG -c testCluster --application-name testApp

Required Parameters

--application-name

The name of the application resource.

--cluster-name -c

Specify the name of the cluster, if not given it will be same as resource group name.

--resource-group -g

Specify the resource group name. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sf service show

Get a service.

az sf service show --application-name
                   --cluster-name
                   --name
                   --resource-group
                   [--query-examples]
                   [--subscription]

Examples

Show the properties of a service on an Azure Service Fabric cluster.

az sf service show -g testRG -c testCluster --application-name testApp --service-name testApp~testService

Required Parameters

--application-name

The name of the application resource.

--cluster-name -c

Specify the name of the cluster, if not given it will be same as resource group name.

--name --service-name

Specify the name of the service. The application name must be a prefix of the service name, for example: appName~serviceName.

--resource-group -g

Specify the resource group name. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.