New-AzManagementGroupDeploymentStack

Creates a new Management Group scoped Deployment Stack.

Syntax

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

Description

Create a management group scoped deployment stack.

Examples

Example 1: Creates a new stack MyMGStack at the MyManagementGroup management group and deploys it into the child subscription MySubId

New-AzManagementGroupDeploymentStack -Name MyMGStack -ManagementGroupId MyMangementGroup -DeploymentSubscriptionId MySubId -TemplateFile myTemplate.json -Location westus -DenySettingsMode DenyDelete

Create a new management group scoped deployment stack named 'MyMGStack' in management group 'MyManagementGroup,' with the scope of the underlying deployment being MySubId and deny settings being DenyDelete.

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

New-AzManagementGroupDeploymentStack -Name MyMGStack -ManagementGroupId MyMangementGroup -DeploymentSubscriptionId MySubId -Location westus -DenySettingsMode DenyDelete -TemplateParameterFile "./parameters.bicepparam"

This command creates a new stack at the management group 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 unmanaged Resources and ResourceGroups 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 ResourceGroups 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 updating 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

-DeploymentSubscriptionId

The subscription id at which the deployment should be created.

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

-ManagementGroupId

The id of the management group that the deploymentStack will be deployed into.

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:Named
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