Share via


az sf service

Manage services running on an Azure Service Fabric cluster. Only support ARM deployed services.

Commands

Name Description Type Status
az sf service create

Create a new service on an Azure Service Fabric cluster.

Core GA
az sf service delete

Delete a service.

Core GA
az sf service list

List services of a given application.

Core GA
az sf service show

Get a service.

Core GA

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}]
                     [--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
--target-replica --target-replica-set-size

Specify the target replica set size for the stateful service.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sf service delete

Delete a service.

az sf service delete --application-name
                     --cluster-name
                     --name
                     --resource-group

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. Required.

--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>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sf service list

List services of a given application.

az sf service list --application-name
                   --cluster-name
                   --resource-group

Examples

List services.

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

Required Parameters

--application-name

The name of the application resource. Required.

--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>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sf service show

Get a service.

az sf service show --application-name
                   --cluster-name
                   --name
                   --resource-group

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. Required.

--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>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.