Editar

Partilhar via


New-AzServiceFabricApplication

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

Syntax

New-AzServiceFabricApplication
   [-ResourceGroupName] <String>
   [-ClusterName] <String>
   [-ApplicationTypeName] <String>
   [-ApplicationTypeVersion] <String>
   -Name <String>
   [-ApplicationParameter <Hashtable>]
   [-MinimumNodeCount <Int64>]
   [-MaximumNodeCount <Int64>]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzServiceFabricApplication
   [-ResourceGroupName] <String>
   [-ClusterName] <String>
   [-ApplicationTypeName] <String>
   [-ApplicationTypeVersion] <String>
   -Name <String>
   [-ApplicationParameter <Hashtable>]
   -PackageUrl <String>
   [-MinimumNodeCount <Int64>]
   [-MaximumNodeCount <Int64>]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

This cmdlet creates a new service fabric application under the specified resource group and cluster. The parameter -PackageUrl can be used to create the type version, If the type version already exits but its in 'Failed' state the cmdlet will ask if the user wants to recreate the type version. If it continues in 'Failed' state, the command will stop the process and throw an exception.

Examples

Example 1

New-AzServiceFabricApplication -ResourceGroupName "testRG" -ClusterName "testCluster" -ApplicationTypeName "TestAppType" -ApplicationTypeVersion "v1" -Name "testApp" -ApplicationParameter @{key0="value0";key1=$null;key2="value2"}

This example creates the application "testApp" under resource group "testRG" and cluster "testCluster". The application type "TestAppType" version "v1" should already exist in the cluster, and the application parameters should be defined in the application manifest otherwise the cmdlet will fail.

Example 2: Specify -PackageUrl to create the application type version before creating the application.

New-AzServiceFabricApplication -ResourceGroupName "testRG" -ClusterName "testCluster" -ApplicationTypeName "TestAppType" -ApplicationTypeVersion "v1" -Name "testApp" -PackageUrl "https://sftestapp.blob.core.windows.net/sftestapp/testApp_1.0.sfpkg" -ApplicationParameter @{key0="value0";key1=$null;key2="value2"}

This example creates the application type "TestAppType" version "v1" using the package url provided. After this, it will continue the normal process to create the application. If the application type version already exits and the provisioning state its in 'Failed' it will prompt to decide if the user wants to recreate the type version.

Parameters

-ApplicationParameter

Specify the application parameters as key/value pairs. These parameters must exist in the application manifest.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ApplicationTypeName

Specify the name of the application type

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ApplicationTypeVersion

Specify the application type version

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ClusterName

Specify the name of the cluster.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Continue without prompts

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaximumNodeCount

Specifies the maximum number of nodes on which to place an application

Type:Int64
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MinimumNodeCount

Specifies the minimum number of nodes where Service Fabric will reserve capacity for this application

Type:Int64
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specify the name of the application

Type:String
Aliases:ApplicationName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PackageUrl

Specify the url of the application package sfpkg file

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Specify the name of the resource group.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Hashtable

Outputs

PSApplication