你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzServiceFabricManagedClusterApplication
Create new service fabric managed application under the specified resource group and cluster.
Syntax
New-AzServiceFabricManagedClusterApplication
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationTypeName] <String>
[-ApplicationTypeVersion] <String>
-Name <String>
[-ApplicationParameter <Hashtable>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricManagedClusterApplication
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationTypeName] <String>
[-ApplicationTypeVersion] <String>
-Name <String>
[-ApplicationParameter <Hashtable>]
-PackageUrl <String>
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
This cmdlet creates a new service fabric managed 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
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$appTypeName = "testAppType"
$appTypeVersion = "v1"
$appParameters = @{key0="value0";key1=$null;key2="value2"}
New-AzServiceFabricManagedClusterApplication -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationTypeName $appTypeName -ApplicationTypeVersion $appTypeVersion -Name $appName -ApplicationParameter $appParameters
This example creates the managed application "testApp" under resource group "testRG" and cluster "testCluster". The managed 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.
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$appTypeName = "testAppType"
$appTypeVersion = "v1"
$appParameters = @{key0="value0";key1=$null;key2="value2"}
$packageUrlV1 = "https://sftestapp.blob.core.windows.net/sftestapp/testApp_1.0.sfpkg"
New-AzServiceFabricManagedClusterApplication -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationTypeName $appTypeName -ApplicationTypeVersion $appTypeVersion -Name $appName -PackageUrl $packageUrlV1 -ApplicationParameter $appParameters
This example creates the managed application type "testAppType" version "v1" using the package url provided. After this, it will continue the normal process to create the application. If the managed 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 managed application type
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ApplicationTypeVersion
Specify the managed application type version
Type: | String |
Position: | 3 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AsJob
Run cmdlet in the background and return a Job to track progress.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
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 |
-Name
Specify the name of the managed 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 |
-Tag
Specify the tags as key/value pairs.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
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 |