Test-AzSubscriptionDeploymentStack
Validates a subscription scoped deployment stack.
Syntax
ByTemplateFileWithNoParameters (Default)
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateFile <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateFileWithParameterFile
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateFile <String>
-TemplateParameterFile <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateFileWithParameterUri
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateFile <String>
-TemplateParameterUri <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateFileWithParameterObject
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateFile <String>
-TemplateParameterObject <Hashtable>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateUriWithParameterFile
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateUri <String>
-TemplateParameterFile <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateUriWithParameterUri
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateUri <String>
-TemplateParameterUri <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateUriWithParameterObject
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateUri <String>
-TemplateParameterObject <Hashtable>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateUriWithNoParameters
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateUri <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateSpecWithParameterFile
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateSpecId <String>
-TemplateParameterFile <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateSpecWithParameterUri
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateSpecId <String>
-TemplateParameterUri <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateSpecWithParameterObject
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateSpecId <String>
-TemplateParameterObject <Hashtable>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByTemplateSpecWithNoParameters
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateSpecId <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByParameterFileWithNoTemplate
Test-AzSubscriptionDeploymentStack
[-Name] <String>
-Location <String>
-ActionOnUnmanage <PSActionOnUnmanage>
-DenySettingsMode <PSDenySettingsMode>
-TemplateParameterFile <String>
[-PassThru]
[-Description <String>]
[-DenySettingsExcludedPrincipal <String[]>]
[-DenySettingsExcludedAction <String[]>]
[-DenySettingsApplyToChildScopes]
[-DeploymentResourceGroupName <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-BypassStackOutOfSyncError]
[-SkipTemplateParameterPrompt]
[-QueryString <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Validates a subscription scoped deployment stack.
Examples
Example 1: Create a subscription scoped deployment stack MySubStack at westus location
Test-AzSubscriptionDeploymentStack -Name MySubStack -TemplateFile myTemplate.json -Location westus -DenySettingsMode DenyDelete -ActionOnUnmanage DetachAll
Validates a subscription scoped Deployment stack named 'MySubStack' in the default subscription, with deny settings being DenyDelete and ActionOnUnmanage as DetachAll.
Parameters
-ActionOnUnmanage
Action to take on resources that become unmanaged on deletion or update of the deployment stack.
Possible values include: 'detachAll' (do not delete any unmanaged resources), 'deleteResources' (delete all unmanaged resources that are not RGs or MGs), and 'deleteAll' (delete every unmanaged resource).
Parameter properties
Type: PSActionOnUnmanage
Default value: None
Accepted values: DetachAll, DeleteResources, DeleteAll
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AsJob
Run cmdlet in the background.
Parameter properties
Type: SwitchParameter
Default value: None
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
-BypassStackOutOfSyncError
Bypass errors for the stack being out of sync when running the operation.
If the stack is out of sync and this parameter is not set, the operation will fail.
Only include this parameter if instructed to do so on a failed stack operation.
Parameter properties
Type: SwitchParameter
Default value: None
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
-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
-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
-DenySettingsApplyToChildScopes
Apply to child scopes.
Parameter properties
Type: SwitchParameter
Default value: None
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
-DenySettingsExcludedAction
List of role-based management operations that are excluded from the denySettings.
Up to 200 actions are permitted.
Parameter properties
Type: String [ ]
Default value: None
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
-DenySettingsExcludedPrincipal
List of AAD principal IDs excluded from the lock.
Up to 5 principals are permitted.
Parameter properties
Type: String [ ]
Default value: None
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
-DenySettingsMode
Mode for DenySettings.
Possible values include: 'denyDelete', 'denyWriteAndDelete', and 'none'.
Parameter properties
Type: PSDenySettingsMode
Default value: None
Accepted values: None, DenyDelete, DenyWriteAndDelete
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: 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.
Parameter properties
Type: String
Default value: None
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
-Description
Description for the stack.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Force
Do not ask for confirmation when overwriting an existing stack.
Parameter properties
Type: SwitchParameter
Default value: None
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
-Location
Location of the stack.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Name
The name of the deploymentStack to create
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: StackName
Parameter sets
(All)
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PassThru
If set, a boolean will be returned with value dependent on cmdlet success.
Parameter properties
Type: SwitchParameter
Default value: None
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
-Pre
When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use.
Parameter properties
Type: SwitchParameter
Default value: None
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
-QueryString
The query string (for example, a SAS token) to be used with the TemplateUri parameter.
Would be used in case of linked templates
Parameter properties
Type: String
Default value: None
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
-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.
Parameter properties
Type: SwitchParameter
Default value: None
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
-Tag
The tags to put on the deployment.
Parameter properties
Type: Hashtable
Default value: None
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
-TemplateFile
TemplateFile to be used to create the stack.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByTemplateFileWithNoParameters
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateFileWithParameterFile
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateFileWithParameterUri
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateFileWithParameterObject
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TemplateParameterFile
Parameter file to use for the template.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByTemplateFileWithParameterFile
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateUriWithParameterFile
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateSpecWithParameterFile
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByParameterFileWithNoTemplate
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TemplateParameterObject
A hash table which represents the parameters.
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByTemplateFileWithParameterObject
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateUriWithParameterObject
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateSpecWithParameterObject
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TemplateParameterUri
Location of the Parameter file to use for the template.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByTemplateFileWithParameterUri
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateUriWithParameterUri
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateSpecWithParameterUri
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TemplateSpecId
ResourceId of the TemplateSpec to be used to create the stack.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByTemplateSpecWithParameterFile
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateSpecWithParameterUri
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateSpecWithParameterObject
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateSpecWithNoParameters
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TemplateUri
Location of the Template to be used to create the stack.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByTemplateUriWithParameterFile
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateUriWithParameterUri
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateUriWithParameterObject
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ByTemplateUriWithNoParameters
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
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 .
Outputs