New-AzSubscriptionDeploymentStack

Creates a new Subscription scoped Deployment Stack.

Syntax

New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateFile <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateFile <String>
   -TemplateParameterFile <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateFile <String>
   -TemplateParameterUri <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateFile <String>
   -TemplateParameterObject <Hashtable>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateUri <String>
   -TemplateParameterFile <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateUri <String>
   -TemplateParameterUri <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateUri <String>
   -TemplateParameterObject <Hashtable>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateUri <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateSpecId <String>
   -TemplateParameterFile <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateSpecId <String>
   -TemplateParameterUri <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateSpecId <String>
   -TemplateParameterObject <Hashtable>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateSpecId <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSubscriptionDeploymentStack
   [-Name] <String>
   [-Description <String>]
   -Location <String>
   [-DeleteAll]
   [-DeleteResources]
   [-DeleteResourceGroups]
   -DenySettingsMode <PSDenySettingsMode>
   [-DenySettingsExcludedPrincipal <String[]>]
   [-DenySettingsExcludedAction <String[]>]
   [-DenySettingsApplyToChildScopes]
   [-DeploymentResourceGroupName <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   -TemplateParameterFile <String>
   [-SkipTemplateParameterPrompt]
   [-QueryString <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create a subscription scoped deployment stack.

Examples

Example 1: Create a subscription scoped deployment stack MySubStack at westus location

New-AzSubscriptionDeploymentStack -Name MySubStack -TemplateFile myTemplate.json -Location westus -DenySettingsMode DenyDelete

Create a new subscription scoped deployment stack named 'MySubStack' in the default subscription, with deny settings being DenyDelete.

Example 2: Use a .bicepparam file to create a stack

New-AzSubscriptionDeploymentStack -Name MySubStack -Location westus -DenySettingsMode DenyDelete -TemplateParameterFile "./parameters.bicepparam"

This command creates a new stack at the subscription scope by using a .bicepparam file on disk.

Parameters

-AsJob

Run cmdlet in the background.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

-DeleteAll

Signal to delete both resources and resource groups after updating stack.

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

-DeleteResourceGroups

Signal to delete unmanaged stack resource groups after updating stack.

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

-DeleteResources

Signal to delete unmanaged stack resources after upating stack.

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

-DenySettingsApplyToChildScopes

Apply to child scopes.

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

-DenySettingsExcludedAction

List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted.

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

-DenySettingsExcludedPrincipal

List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted.

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

-DenySettingsMode

Mode for DenySettings. Possible values include: 'denyDelete', 'denyWriteAndDelete', and 'none'.

Type:PSDenySettingsMode
Accepted values:None, DenyDelete, DenyWriteAndDelete
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DeploymentResourceGroupName

The ResourceGroup at which the deployment will be created. If none is specified, it will default to the subscription level scope of the deployment stack.

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

-Description

Description for the stack.

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

-Force

Do not ask for confirmation when overwriting an existing stack.

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

-Location

Location of the stack.

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

-Name

The name of the deploymentStack to create

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

-Pre

When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use.

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

-QueryString

The query string (for example, a SAS token) to be used with the TemplateUri parameter. Would be used in case of linked templates

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

-SkipTemplateParameterPrompt

Skips the PowerShell dynamic parameter processing that checks if the provided template parameter contains all necessary parameters used by the template. This check would prompt the user to provide a value for the missing parameters, but providing the -SkipTemplateParameterPrompt will ignore this prompt and error out immediately if a parameter was found not to be bound in the template. For non-interactive scripts, -SkipTemplateParameterPrompt can be provided to provide a better error message in the case where not all required parameters are satisfied.

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

-Tag

The tags to put on the deployment.

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

-TemplateFile

TemplateFile to be used to create the stack.

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

-TemplateParameterFile

Parameter file to use for the template.

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

-TemplateParameterObject

A hash table which represents the parameters.

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

-TemplateParameterUri

Location of the Parameter file to use for the template.

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

-TemplateSpecId

ResourceId of the TemplateSpec to be used to create the stack.

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

-TemplateUri

Location of the Template to be used to create the stack.

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

PSDeploymentStack