Edit

Share via


New-AzServiceFabricService

Create new service fabric service under the specified application and cluster.

Syntax

Stateless-Singleton (Default)

New-AzServiceFabricService
    [-ResourceGroupName] <String>
    [-ClusterName] <String>
    [-ApplicationName] <String>
    [-Name] <String>
    -Type <String>
    -InstanceCount <Int32>
    [-Stateless]
    [-DefaultMoveCost <MoveCostEnum>]
    [-PartitionSchemeSingleton]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Stateless-UniformInt64Range

New-AzServiceFabricService
    [-ResourceGroupName] <String>
    [-ClusterName] <String>
    [-ApplicationName] <String>
    [-Name] <String>
    -Type <String>
    -InstanceCount <Int32>
    [-Stateless]
    [-DefaultMoveCost <MoveCostEnum>]
    [-PartitionSchemeUniformInt64]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Stateless-Named

New-AzServiceFabricService
    [-ResourceGroupName] <String>
    [-ClusterName] <String>
    [-ApplicationName] <String>
    [-Name] <String>
    -Type <String>
    -InstanceCount <Int32>
    [-Stateless]
    [-DefaultMoveCost <MoveCostEnum>]
    [-PartitionSchemeNamed]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Stateful-Singleton

New-AzServiceFabricService
    [-ResourceGroupName] <String>
    [-ClusterName] <String>
    [-ApplicationName] <String>
    [-Name] <String>
    -Type <String>
    -TargetReplicaSetSize <Int32>
    -MinReplicaSetSize <Int32>
    [-Stateful]
    [-ReplicaRestartWaitDuration <TimeSpan>]
    [-QuorumLossWaitDuration <TimeSpan>]
    [-StandByReplicaKeepDuration <TimeSpan>]
    [-DefaultMoveCost <MoveCostEnum>]
    [-PartitionSchemeSingleton]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Stateful-UniformInt64Range

New-AzServiceFabricService
    [-ResourceGroupName] <String>
    [-ClusterName] <String>
    [-ApplicationName] <String>
    [-Name] <String>
    -Type <String>
    -TargetReplicaSetSize <Int32>
    -MinReplicaSetSize <Int32>
    [-Stateful]
    [-ReplicaRestartWaitDuration <TimeSpan>]
    [-QuorumLossWaitDuration <TimeSpan>]
    [-StandByReplicaKeepDuration <TimeSpan>]
    [-DefaultMoveCost <MoveCostEnum>]
    [-PartitionSchemeUniformInt64]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Stateful-Named

New-AzServiceFabricService
    [-ResourceGroupName] <String>
    [-ClusterName] <String>
    [-ApplicationName] <String>
    [-Name] <String>
    -Type <String>
    -TargetReplicaSetSize <Int32>
    -MinReplicaSetSize <Int32>
    [-Stateful]
    [-ReplicaRestartWaitDuration <TimeSpan>]
    [-QuorumLossWaitDuration <TimeSpan>]
    [-StandByReplicaKeepDuration <TimeSpan>]
    [-DefaultMoveCost <MoveCostEnum>]
    [-PartitionSchemeNamed]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet allows to creating stateless or stateful services under the specified application. The service should exit in the application manifest and the type should be the same as the one in the manifest. The application name should be a prefix of the service name.

Examples

Example 1

$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$serviceName = "testApp~testService1"
$serviceTypeName = "testStateless"
New-AzServiceFabricService -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationName $appName -Name $serviceName -Type $serviceTypeName -Stateless -InstanceCount -1 -PartitionSchemeSingleton -Verbose

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

Example 2

$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$serviceName = "testApp~testService2"
$serviceTypeName = "testStatefulType"
New-AzServiceFabricService -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationName $appName -Name $serviceName -Type $serviceTypeName -Stateful -TargetReplicaSetSize 3 -MinReplicaSetSize 5

This example will create a new stateful service "testApp~testService2" with a target of 5 nodes.

Parameters

-ApplicationName

Specify the name of the application.

Parameter properties

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

Parameter sets

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

-ClusterName

Specify the name of the cluster.

Parameter properties

Type:String
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

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

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

Parameter sets

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

-DefaultMoveCost

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

Parameter properties

Type:MoveCostEnum
Default value:None
Accepted values:Zero, Low, Medium, High
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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

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

-InstanceCount

Specify the instance count for the service

Parameter properties

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

Parameter sets

Stateless-Singleton
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateless-UniformInt64Range
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateless-Named
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MinReplicaSetSize

Specify the min replica set size for the service

Parameter properties

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

Parameter sets

Stateful-Singleton
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-UniformInt64Range
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-Named
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specify the name of the service.

Parameter properties

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

Parameter sets

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

-PartitionSchemeNamed

Indicates that the service uses the named partition scheme. Services using this model usually have 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.

Parameter properties

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

Parameter sets

Stateless-Named
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-Named
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PartitionSchemeSingleton

Indicates that the service uses the singleton partition scheme. Singleton partitions are typically used when the service does not require any additional routing.

Parameter properties

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

Parameter sets

Stateless-Singleton
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-Singleton
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PartitionSchemeUniformInt64

Indicates that the service uses the UniformInt64 partition scheme. This means that each partition owns a range of int64 keys.

Parameter properties

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

Parameter sets

Stateless-UniformInt64Range
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-UniformInt64Range
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-QuorumLossWaitDuration

Specify the quorum loss wait duration for the service

Parameter properties

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

Parameter sets

Stateful-Singleton
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-UniformInt64Range
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-Named
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicaRestartWaitDuration

Specify the replica restart wait duration for the service

Parameter properties

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

Parameter sets

Stateful-Singleton
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-UniformInt64Range
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-Named
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

Specify the name of the resource group.

Parameter properties

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

Parameter sets

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

-StandByReplicaKeepDuration

Specify the stand by replica duration for the service

Parameter properties

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

Parameter sets

Stateful-Singleton
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-UniformInt64Range
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-Named
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Stateful

Use for stateful service

Parameter properties

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

Parameter sets

Stateful-Singleton
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-UniformInt64Range
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-Named
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Stateless

Use for stateless service

Parameter properties

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

Parameter sets

Stateless-Singleton
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateless-UniformInt64Range
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateless-Named
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetReplicaSetSize

Specify the target replica set size for the service

Parameter properties

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

Parameter sets

Stateful-Singleton
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-UniformInt64Range
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Stateful-Named
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Type

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

Parameter properties

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

Parameter sets

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

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

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

String

Outputs

PSService