az sf service

Manage the services of a Service Fabric application.

Commands

az sf service application-name Gets the name of the Service Fabric application for a service.
az sf service create Creates the specified Service Fabric service from the description.
az sf service description Gets the description of an existing Service Fabric service.
az sf service health Gets the health of the specified Service Fabric service.
az sf service list Gets the information about all services belonging to the application specified by the application id.
az sf service manifest Gets the manifest describing a service type.
az sf service report-health Sends a health report on the Service Fabric service.
az sf service resolve Resolve a Service Fabric partition.
az sf service update Updates the specified service using the given update description.

az sf service application-name

The GetApplicationName endpoint returns the name of the application for the specified service.

az sf service application-name --service-id
[--timeout]

Required Parameters

--service-id

The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme.

Optional Parameters

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60

az sf service create

Creates the specified Service Fabric service from the description.

az sf service create --app-id
--name
--service-type
[--activation-mode]
[--constraints]
[--correlated-service]
[--correlation]
[--dns-name]
[--instance-count]
[--int-scheme]
[--int-scheme-count]
[--int-scheme-high]
[--int-scheme-low]
[--load-metrics]
[--min-replica-set-size]
[--move-cost]
[--named-scheme]
[--named-scheme-list]
[--no-persisted-state]
[--placement-policy-list]
[--quorum-loss-wait]
[--replica-restart-wait]
[--singleton-scheme]
[--stand-by-replica-keep]
[--stateful]
[--stateless]
[--target-replica-set-size]
[--timeout]

Required Parameters

--app-id

The identity of the parent application. This is typically the full id of the application without the 'fabric:' URI scheme.

--name

Name of the service. This should be a child of the application id. This is the full name including the fabric: URI. For example service fabric:/A/B is a child of application fabric:/A.

--service-type

Name of the service type.

Optional Parameters

--activation-mode

The activation mode for the service package.

--constraints

The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following:"NodeColor == blue".

--correlated-service

Name of the target service to correlate with.

--correlation

Correlate the service with an existing service using an alignment affinity.

--dns-name

The DNS name of the service to be created. The Service Fabric DNS system service must be enabled for this setting.

--instance-count

The instance count. This applies to stateless services only.

--int-scheme

Indicates the service should be uniformly partitioned across a range of unsigned integers.

--int-scheme-count

The number of partitions inside the integer key range to create, if using an uniform integer partition scheme.

--int-scheme-high

The end of the key integer range, if using an uniform integer partition scheme.

--int-scheme-low

The start of the key integer range, if using an uniform integer partition scheme.

--load-metrics

JSON encoded list of metrics used when load balancing services across nodes.

--min-replica-set-size

The minimum replica set size as a number. This applies to stateful services only.

--move-cost

Specifies the move cost for the service. Possible values are: 'Zero', 'Low', 'Medium', 'High'.

--named-scheme

Indicates the service should have multiple named partitions.

--named-scheme-list

JSON encoded list of names to partition the service across, if using the named partition scheme.

--no-persisted-state

If true, this indicates the service has no persistent state stored on the local disk, or it only stores state in memory.

--placement-policy-list

JSON encoded list of placement policies for the service, and any associated domain names. Policies can be one or more of: NonPartiallyPlaceService, PreferPrimaryDomain, RequireDomain, RequireDomainDistribution.

--quorum-loss-wait

The maximum duration, in seconds, for which a partition is allowed to be in a state of quorum loss. This applies to stateful services only.

--replica-restart-wait

The duration, in seconds, between when a replica goes down and when a new replica is created. This applies to stateful services only.

--singleton-scheme

Indicates the service should have a single partition or be a non-partitioned service.

--stand-by-replica-keep

The maximum duration, in seconds, for which StandBy replicas will be maintained before being removed. This applies to stateful services only.

--stateful

Indicates the service is a stateful service.

--stateless

Indicates the service is a stateless service.

--target-replica-set-size

The target replica set size as a number. This applies to stateful services only.

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60

az sf service description

Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained.

az sf service description --service-id
[--timeout]

Required Parameters

--service-id

The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme.

Optional Parameters

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60

az sf service health

Gets the health information of the specified service. Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. Use PartitionsHealthStateFilter to filter the collection of partitions returned. If you specify a service that does not exist in the health store, this cmdlet returns an error. .

az sf service health --service-id
[--events-health-state-filter]
[--partitions-health-state-filter]
[--timeout]

Required Parameters

--service-id

The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme.

Optional Parameters

--events-health-state-filter

Allows filtering the collection of HealthEvent objects returned based on health state. The possible values for this parameter include integer value of one of the following health states. Only events that match the filter are returned. All events are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535.

--partitions-health-state-filter

Allows filtering of the partitions health state objects returned in the result of service health query based on their health state. The possible values for this parameter include integer value of one of the following health states. Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of partitions with HealthState value of OK (2) and Warning (4) will be returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535.

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60

az sf service list

Returns the information about all services belonging to the application specified by the application id.

az sf service list --application-id
[--continuation-token]
[--service-type-name]
[--timeout]

Required Parameters

--application-id

The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme.

Optional Parameters

--continuation-token

The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded.

--service-type-name

The service type name used to filter the services to query for.

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60

az sf service manifest

Gets the manifest describing a service type. The response contains the service manifest XML as a string.

az sf service manifest --application-type-name
--application-type-version
--service-manifest-name
[--timeout]

Required Parameters

--application-type-name

The name of the application type.

--application-type-version

The version of the application type.

--service-manifest-name

The name of a service manifest registered as part of an application type in a Service Fabric cluster.

Optional Parameters

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60

az sf service report-health

Reports health state of the specified Service Fabric service. The report must contain the information about the source of the health report and property on which it is reported. The report is sent to a Service Fabric gateway Service, which forwards to the health store. The report may be accepted by the gateway, but rejected by the health store after extra validation. For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. To see whether the report was applied in the health store, check that the report appears in the health events of the service.

az sf service report-health --health-property
--health-state
--service-id
--source-id
[--description]
[--remove-when-expired]
[--sequence-number]
[--timeout]
[--ttl]

Required Parameters

--health-property

The property of the health information. An entity can have health reports for different properties. The property is a string and not a fixed enumeration to allow the reporter flexibility to categorize the state condition that triggers the report. For example, a reporter with SourceId "LocalWatchdog" can monitor the state of the available disk on a node, so it can report "AvailableDisk" property on that node. The same reporter can monitor the node connectivity, so it can report a property "Connectivity" on the same node. In the health store, these reports are treated as separate health events for the specified node. Together with the SourceId, the property uniquely identifies the health information.

--health-state

Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'.

--service-id

The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme.

--source-id

The source name which identifies the client/watchdog/system component which generated the health information.

Optional Parameters

--description

The description of the health information. It represents free text used to add human readable information about the report. The maximum string length for the description is 4096 characters. If the provided string is longer, it will be automatically truncated. When truncated, the last characters of the description contain a marker "[Truncated]", and total string size is 4096 characters. The presence of the marker indicates to users that truncation occurred. Note that when truncated, the description has less than 4096 characters from the original string.

--remove-when-expired

Value that indicates whether the report is removed from health store when it expires. If set to true, the report is removed from the health store after it expires. If set to false, the report is treated as an error when expired. The value of this property is false by default. When clients report periodically, they should set this value to false (default). This way, is the reporter has issues (eg. deadlock) and can't report, the entity is evaluated at error when the health report expires. This flags the entity as being in Error health state.

--sequence-number

The sequence number for this health report as a numeric string. The report sequence number is used by the health store to detect stale reports. If not specified, a sequence number is auto-generated by the health client when a report is added.

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60
--ttl

The duration, in milliseconds, for which this health report is valid. When clients report periodically, they should send reports with higher frequency than time to live. If not specified, time to live defaults to infinite value.

az sf service resolve

Resolve a Service Fabric service partition, to get the endpoints of the service replicas.

az sf service resolve --service-id
[--partition-key-type]
[--partition-key-value]
[--previous-rsp-version]
[--timeout]

Required Parameters

--service-id

The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme.

Optional Parameters

--partition-key-type

Key type for the partition. This parameter is required if the partition scheme for the service is Int64Range or Named. The possible values are following. - None (1) - Indicates that the the PartitionKeyValue parameter is not specified. This is valid for the partitions with partitioning scheme as Singleton. This is the default value. The value is 1. - Int64Range (2) - Indicates that the the PartitionKeyValue parameter is an int64 partition key. This is valid for the partitions with partitioning scheme as Int64Range. The value is 2. - Named (3) - Indicates that the the PartitionKeyValue parameter is a name of the partition. This is valid for the partitions with partitioning scheme as Named. The value is 3.

--partition-key-value

Partition key. This is required if the partition scheme for the service is Int64Range or Named.

--previous-rsp-version

The value in the Version field of the response that was received previously. This is required if the user knows that the result that was got previously is stale.

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60

az sf service update

Updates the specified service using the given update description.

az sf service update --service-id
[--constraints]
[--correlated-service]
[--correlation]
[--instance-count]
[--load-metrics]
[--min-replica-set-size]
[--move-cost]
[--placement-policy-list]
[--quorum-loss-wait]
[--replica-restart-wait]
[--stand-by-replica-keep]
[--stateful]
[--stateless]
[--target-replica-set-size]
[--timeout]

Required Parameters

--service-id

Target service to update. This is typically the full id of the service without the 'fabric:' URI scheme.

Optional Parameters

--constraints

The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue".

--correlated-service

Name of the target service to correlate with.

--correlation

Correlate the service with an existing service using an alignment affinity.

--instance-count

The instance count. This applies to stateless services only.

--load-metrics

JSON encoded list of metrics used when load balancing across nodes.

--min-replica-set-size

The minimum replica set size as a number. This applies to stateful services only.

--move-cost

Specifies the move cost for the service. Possible values are: 'Zero', 'Low', 'Medium', 'High'.

--placement-policy-list

JSON encoded list of placement policies for the service, and any associated domain names. Policies can be one or more of: NonPartiallyPlaceService, PreferPrimaryDomain, RequireDomain, RequireDomainDistribution.

--quorum-loss-wait

The maximum duration, in seconds, for which a partition is allowed to be in a state of quorum loss. This applies to stateful services only.

--replica-restart-wait

The duration, in seconds, between when a replica goes down and when a new replica is created. This applies to stateful services only.

--stand-by-replica-keep

The maximum duration, in seconds, for which StandBy replicas will be maintained before being removed. This applies to stateful services only.

--stateful

Indicates the target service is a stateful service.

--stateless

Indicates the target service is a stateless service.

--target-replica-set-size

The target replica set size as a number. This applies to stateful services only.

--timeout -t

The server timeout for performing the operation, specified in seconds. This is the maximum time a client can wait.

default value: 60