Share via


Resolve-ServiceFabricService

Retrieves the replica address of a stateful Service Fabric partitioned service or the address of an instance of a stateless Service Fabric service.

Syntax

Singleton NonRefresh (Default)

Resolve-ServiceFabricService
    [-ServiceName] <Uri>
    [-PartitionKindSingleton]
    [-PreviousResult <ResolvedServicePartition>]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Singleton ForceRefresh

Resolve-ServiceFabricService
    [-ServiceName] <Uri>
    [-PartitionKindSingleton]
    [-ForceRefresh]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

UniformInt64 ForceRefresh

Resolve-ServiceFabricService
    [-ServiceName] <Uri>
    [-PartitionKey] <String>
    [-PartitionKindUniformInt64]
    [-ForceRefresh]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

UniformInt64 NonRefresh

Resolve-ServiceFabricService
    [-ServiceName] <Uri>
    [-PartitionKey] <String>
    [-PartitionKindUniformInt64]
    [-PreviousResult <ResolvedServicePartition>]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Named ForceRefresh

Resolve-ServiceFabricService
    [-ServiceName] <Uri>
    [-PartitionKey] <String>
    [-PartitionKindNamed]
    [-ForceRefresh]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Named NonRefresh

Resolve-ServiceFabricService
    [-ServiceName] <Uri>
    [-PartitionKey] <String>
    [-PartitionKindNamed]
    [-PreviousResult <ResolvedServicePartition>]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Description

The Resolve-ServiceFabricService cmdlet retrieves the replica address of a stateful Service Fabric partitioned service or the address of an instance of a stateless Service Fabric service.

The address is cached on the local node and can be refreshed if the connection attempt to the address fails. The failure to connect typically indicates that the replica or the instance has moved to a different node.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Examples

Example 1: Resolve addresses

PS C:\> Resolve-ServiceFabricService -PartitionKindUniformInt64 -ServiceName fabric:/myApp/myService -PartitionKey "0"

This command retrieves the addresses of a uniform Int64 partition mapped to by partition key 0 in a service named fabric:/myApp/myService.

Example 2: Using previous result to refresh local cache

PS C:\> $result = Resolve-ServiceFabricService -ServiceName fabric:/TestApplication/TestService/1 -PartitionKindSingleton
PS C:\> Resolve-ServiceFabricService -ServiceName fabric:/TestApplication/TestService/1 -PartitionKindSingleton -PreviousResult $result

This command provides the result of the first resolve call to the subsequent one. This is required if the user knows that the result previously obtained in the first call is stale. The endpoints are considered stale if the connection request times out or returns an error.

Example 3: Force refresh local cache

PS C:\> Resolve-ServiceFabricService -ServiceName fabric:/TestApplication/TestService/1 -PartitionKindSingleton -ForceRefresh

This command retrieves the address of a stateful replica in a singleton partition after forcefully refreshing the local endpoint cache.

Parameters

-ForceRefresh

Indicates that the cmdlet forces the local cache of resolved addresses to refresh.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Singleton ForceRefresh
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
UniformInt64 ForceRefresh
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
Named ForceRefresh
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PartitionKey

Specifies the partition key for the Service Fabric service.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

UniformInt64 ForceRefresh
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
UniformInt64 NonRefresh
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
Named ForceRefresh
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
Named NonRefresh
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PartitionKindNamed

Indicates that the Service Fabric service is a named partition.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Named ForceRefresh
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Named NonRefresh
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PartitionKindSingleton

Indicates that the Service Fabric service is a singleton partition.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Singleton NonRefresh
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Singleton ForceRefresh
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PartitionKindUniformInt64

Indicates that the Service Fabric service is a UniformInt64 partition.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

UniformInt64 ForceRefresh
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UniformInt64 NonRefresh
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PreviousResult

Specifies the previous resolve service partition results. This is required if the user knows that the result that was obtained previously is stale.

Parameter properties

Type:ResolvedServicePartition
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Singleton NonRefresh
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
UniformInt64 NonRefresh
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
Named NonRefresh
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ServiceName

Specifies the URI of a Service Fabric service.

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.Uri

System.String

System.Fabric.ResolvedServicePartition

System.Management.Automation.SwitchParameter

Outputs

System.Object