diff --git a/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceWithParameterCmdletBase.cs b/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceWithParameterCmdletBase.cs index 8c905b7991b6..8b839725a36d 100644 --- a/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceWithParameterCmdletBase.cs +++ b/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceWithParameterCmdletBase.cs @@ -116,69 +116,78 @@ protected ResourceWithParameterCmdletBase() [ValidateNotNullOrEmpty] public string TemplateUri { get; set; } + [Parameter(Mandatory = false, HelpMessage = "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.")] + public SwitchParameter SkipTemplateParameterPrompt { get; set; } + public object GetDynamicParameters() { - if (TemplateObject != null && - TemplateObject != templateObject) - { - templateObject = TemplateObject; - if (string.IsNullOrEmpty(TemplateParameterUri)) - { - dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( - TemplateObject, - TemplateParameterObject, - this.ResolvePath(TemplateParameterFile), - MyInvocation.MyCommand.Parameters.Keys.ToArray()); - } - else - { - dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( - TemplateObject, - TemplateParameterObject, - TemplateParameterUri, - MyInvocation.MyCommand.Parameters.Keys.ToArray()); - } - } - else if (!string.IsNullOrEmpty(TemplateFile) && - !TemplateFile.Equals(templateFile, StringComparison.OrdinalIgnoreCase)) + if (!this.IsParameterBound(c => c.SkipTemplateParameterPrompt)) { - templateFile = TemplateFile; - if (string.IsNullOrEmpty(TemplateParameterUri)) - { - dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( - this.ResolvePath(TemplateFile), - TemplateParameterObject, - this.ResolvePath(TemplateParameterFile), - MyInvocation.MyCommand.Parameters.Keys.ToArray()); - } - else + if (TemplateObject != null && + TemplateObject != templateObject) { - dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( - this.ResolvePath(TemplateFile), - TemplateParameterObject, - TemplateParameterUri, - MyInvocation.MyCommand.Parameters.Keys.ToArray()); + templateObject = TemplateObject; + if (string.IsNullOrEmpty(TemplateParameterUri)) + { + dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( + TemplateObject, + TemplateParameterObject, + this.ResolvePath(TemplateParameterFile), + MyInvocation.MyCommand.Parameters.Keys.ToArray()); + } + else + { + dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( + TemplateObject, + TemplateParameterObject, + TemplateParameterUri, + MyInvocation.MyCommand.Parameters.Keys.ToArray()); + } } - } - else if (!string.IsNullOrEmpty(TemplateUri) && - !TemplateUri.Equals(templateUri, StringComparison.OrdinalIgnoreCase)) - { - templateUri = TemplateUri; - if (string.IsNullOrEmpty(TemplateParameterUri)) + else if (!string.IsNullOrEmpty(TemplateFile) && + !TemplateFile.Equals(templateFile, StringComparison.OrdinalIgnoreCase)) { - dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( - TemplateUri, - TemplateParameterObject, - this.ResolvePath(TemplateParameterFile), - MyInvocation.MyCommand.Parameters.Keys.ToArray()); + templateFile = TemplateFile; + if (string.IsNullOrEmpty(TemplateParameterUri)) + { + dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( + this.ResolvePath(TemplateFile), + TemplateParameterObject, + this.ResolvePath(TemplateParameterFile), + MyInvocation.MyCommand.Parameters.Keys.ToArray()); + } + else + { + dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( + this.ResolvePath(TemplateFile), + TemplateParameterObject, + TemplateParameterUri, + MyInvocation.MyCommand.Parameters.Keys.ToArray()); + } } - else + else if (!string.IsNullOrEmpty(TemplateUri) && + !TemplateUri.Equals(templateUri, StringComparison.OrdinalIgnoreCase)) { - dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( - TemplateUri, - TemplateParameterObject, - TemplateParameterUri, - MyInvocation.MyCommand.Parameters.Keys.ToArray()); + templateUri = TemplateUri; + if (string.IsNullOrEmpty(TemplateParameterUri)) + { + dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( + TemplateUri, + TemplateParameterObject, + this.ResolvePath(TemplateParameterFile), + MyInvocation.MyCommand.Parameters.Keys.ToArray()); + } + else + { + dynamicParameters = TemplateUtility.GetTemplateParametersFromFile( + TemplateUri, + TemplateParameterObject, + TemplateParameterUri, + MyInvocation.MyCommand.Parameters.Keys.ToArray()); + } } } diff --git a/src/Resources/ResourceManager/Implementation/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCmdlet.cs b/src/Resources/ResourceManager/Implementation/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCmdlet.cs index 40c4055ca64e..9efc5c54fb4c 100644 --- a/src/Resources/ResourceManager/Implementation/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCmdlet.cs +++ b/src/Resources/ResourceManager/Implementation/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCmdlet.cs @@ -43,6 +43,8 @@ public class TestAzureResourceGroupDeploymentCmdlet : ResourceWithParameterCmdle [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Rollback to the successful deployment with the given name in the resource group, should not be used if -RollbackToLastDeployment is used.")] public string RollBackDeploymentName { get; set; } + public string DeploymentName { get; set; } + public TestAzureResourceGroupDeploymentCmdlet() { this.Mode = DeploymentMode.Incremental; @@ -57,6 +59,7 @@ public override void ExecuteCmdlet() PSDeploymentCmdletParameters parameters = new PSDeploymentCmdletParameters() { + DeploymentName = DeploymentName ?? Guid.NewGuid().ToString(), ResourceGroupName = ResourceGroupName, TemplateFile = TemplateUri ?? this.ResolvePath(TemplateFile), TemplateObject = TemplateObject, diff --git a/src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs b/src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs index 6458deff1f23..580a864a4bdd 100644 --- a/src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs +++ b/src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs @@ -39,6 +39,7 @@ using ProjectResources = Microsoft.Azure.Commands.ResourceManager.Cmdlets.Properties.Resources; using Microsoft.Azure.Commands.ResourceManager.Common.Paging; using System.Management.Automation; +using Microsoft.Rest; namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkClient { @@ -465,11 +466,42 @@ private Deployment CreateBasicDeployment(PSDeploymentCmdletParameters parameters private TemplateValidationInfo CheckBasicDeploymentErrors(string resourceGroup, string deploymentName, Deployment deployment) { - DeploymentValidateResult validationResult = resourceGroup != null - ? ResourceManagementClient.Deployments.Validate(resourceGroup, deploymentName, deployment) - : ResourceManagementClient.Deployments.ValidateAtSubscriptionScope(deploymentName, deployment); + try + { + DeploymentValidateResult validationResult = resourceGroup != null + ? ResourceManagementClient.Deployments.Validate(resourceGroup, deploymentName, deployment) + : ResourceManagementClient.Deployments.ValidateAtSubscriptionScope(deploymentName, deployment); + + return new TemplateValidationInfo(validationResult); + } + catch (Exception ex) + { + var error = HandleError(ex).FirstOrDefault(); + return new TemplateValidationInfo(new DeploymentValidateResult(error)); + } + } + + private List HandleError(Exception ex) + { + if (ex == null) + { + return null; + } + + ResourceManagementErrorWithDetails error = null; + var innerException = HandleError(ex.InnerException); + if (ex is CloudException) + { + var cloudEx = ex as CloudException; + error = new ResourceManagementErrorWithDetails(cloudEx.Body?.Code, cloudEx.Body?.Message, cloudEx.Body?.Target, innerException); + } + else + { + error = new ResourceManagementErrorWithDetails(null, ex.Message, null, innerException); + } + + return new List { error }; - return new TemplateValidationInfo(validationResult); } private IPage ListDeploymentOperations(string resourceGroupName, string deploymentName) @@ -1071,7 +1103,8 @@ public virtual void CancelDeployment(string resourceGroup, string deploymentName public virtual List ValidateDeployment(PSDeploymentCmdletParameters parameters, DeploymentMode deploymentMode) { Deployment deployment = CreateBasicDeployment(parameters, deploymentMode, null); - TemplateValidationInfo validationInfo = CheckBasicDeploymentErrors(parameters.ResourceGroupName, Guid.NewGuid().ToString(), deployment); + var deploymentName = GenerateDeploymentName(parameters); + TemplateValidationInfo validationInfo = CheckBasicDeploymentErrors(parameters.ResourceGroupName, deploymentName, deployment); if (validationInfo.Errors.Count == 0) { diff --git a/src/Resources/ResourceManager/SdkModels/Deployments/TemplateValidationInfo.cs b/src/Resources/ResourceManager/SdkModels/Deployments/TemplateValidationInfo.cs index d2f1d8632000..74f325707870 100644 --- a/src/Resources/ResourceManager/SdkModels/Deployments/TemplateValidationInfo.cs +++ b/src/Resources/ResourceManager/SdkModels/Deployments/TemplateValidationInfo.cs @@ -24,7 +24,7 @@ public TemplateValidationInfo(DeploymentValidateResult validationResult) Errors = new List(); RequiredProviders = new List(); - + if (validationResult.Error != null) { Errors.Add(validationResult.Error); diff --git a/src/Resources/Resources.Test/ScenarioTests/Common.ps1 b/src/Resources/Resources.Test/ScenarioTests/Common.ps1 index fda210fccbad..01323ee6ff04 100644 --- a/src/Resources/Resources.Test/ScenarioTests/Common.ps1 +++ b/src/Resources/Resources.Test/ScenarioTests/Common.ps1 @@ -258,7 +258,7 @@ function New-AzADSpCredentialWithId ) $profile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile - $cmdlet = New-Object -TypeName Microsoft.Azure.Commands.ActiveDirectory.NewAzureADSpCredentialCommand + $cmdlet = New-Object -TypeName Microsoft.Azure.Commands.ActiveDirectory.NewAzureADSpCredentialCommand $cmdlet.DefaultProfile = $profile $cmdlet.CommandRuntime = $PSCmdlet.CommandRuntime @@ -297,5 +297,103 @@ function New-AzADSpCredentialWithId $cmdlet.KeyId = $KeyId } + $cmdlet.ExecuteCmdlet() +} + +function Test-AzResourceGroupDeploymentWithName +{ + [CmdletBinding()] + param( + [string] [Parameter()] $DeploymentName, + [string] [Parameter()] $ResourceGroupName, + [string] [Parameter()] $RollBackDeploymentName, + [string] [Parameter()] $TemplateFile, + [string] [Parameter()] $TemplateUri, + [string] [Parameter()] $TemplateParameterFile, + [string] [Parameter()] $TemplateParameterUri, + [string] [Parameter()] $ApiVersion, + [switch] [Parameter()] $RollbackToLastDeployment, + [switch] [Parameter()] $SkipTemplateParameterPrompt, + [switch] [Parameter()] $Pre, + [hashtable] [Parameter()] $TemplateObject, + [hashtable] [Parameter()] $TemplateParameterObject, + [Microsoft.Azure.Management.ResourceManager.Models.DeploymentMode] [Parameter()] $Mode + ) + + $profile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile + $cmdlet = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.TestAzureResourceGroupDeploymentCmdlet + $cmdlet.DefaultProfile = $profile + $cmdlet.CommandRuntime = $PSCmdlet.CommandRuntime + + if (-not ([string]::IsNullOrEmpty($DeploymentName))) + { + $cmdlet.DeploymentName = $DeploymentName + } + + if (-not ([string]::IsNullOrEmpty($ResourceGroupName))) + { + $cmdlet.ResourceGroupName = $ResourceGroupName + } + + if (-not ([string]::IsNullOrEmpty($RollBackDeploymentName))) + { + $cmdlet.RollBackDeploymentName = $RollBackDeploymentName + } + + if (-not ([string]::IsNullOrEmpty($TemplateFile))) + { + $cmdlet.TemplateFile = $TemplateFile + } + + if (-not ([string]::IsNullOrEmpty($TemplateUri))) + { + $cmdlet.TemplateUri = $TemplateUri + } + + if (-not ([string]::IsNullOrEmpty($TemplateParameterFile))) + { + $cmdlet.TemplateParameterFile = $TemplateParameterFile + } + + if (-not ([string]::IsNullOrEmpty($TemplateParameterUri))) + { + $cmdlet.TemplateParameterUri = $TemplateParameterUri + } + + if (-not ([string]::IsNullOrEmpty($ApiVersion))) + { + $cmdlet.ApiVersion = $ApiVersion + } + + if ($RollbackToLastDeployment.IsPresent) + { + $cmdlet.RollbackToLastDeployment = $true + } + + if ($SkipTemplateParameterPrompt.IsPresent) + { + $cmdlet.SkipTemplateParameterPrompt = $true + } + + if ($Pre.IsPresent) + { + $cmdlet.Pre = $true + } + + if ($TemplateObject -ne $null) + { + $cmdlet.TemplateObject = $TemplateObject + } + + if ($TemplateParameterObject -ne $null) + { + $cmdlet.TemplateParameterObject = $TemplateParameterObject + } + + if ($Mode -ne $null) + { + $cmdlet.Mode = $Mode + } + $cmdlet.ExecuteCmdlet() } \ No newline at end of file diff --git a/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.cs b/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.cs index d0ebaf73cf10..03cc4cdf370c 100644 --- a/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.cs +++ b/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.cs @@ -47,6 +47,13 @@ public void TestNewDeploymentFromTemplateObject() TestRunner.RunTestScript("Test-NewDeploymentFromTemplateObject"); } + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestTestResourceGroupDeploymentErrors() + { + TestRunner.RunTestScript("Test-TestResourceGroupDeploymentErrors"); + } + [Fact] [Trait(Category.AcceptanceType, Category.CheckIn)] public void TestNestedDeploymentFromTemplateFile() diff --git a/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1 b/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1 index 24070c9d011f..46f442692bb4 100644 --- a/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1 +++ b/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1 @@ -101,6 +101,39 @@ function Test-NewDeploymentFromTemplateObject } } +function Test-TestResourceGroupDeploymentErrors +{ + # Catch exception when resource group doesn't exist + $rgname = "unknownresourcegroup" + $deploymentName = Get-ResourceName + $result = Test-AzResourceGroupDeploymentWithName -DeploymentName $deploymentName -ResourceGroupName $rgname -TemplateFile sampleDeploymentTemplate.json -TemplateParameterFile sampleDeploymentTemplateParams.json + Write-Debug "$result" + Assert-NotNull $result + Assert-AreEqual "ResourceGroupNotFound" $result.Code + Assert-AreEqual "Resource group '$rgname' could not be found." $result.Message + + # Setup + $rgname = Get-ResourceGroupName + $rname = Get-ResourceName + $rglocation = "West US 2" + + try + { + # Test + # Catch exception when parameter template is missing + New-AzResourceGroup -Name $rgname -Location $rglocation + $result = Test-AzResourceGroupDeploymentWithName -DeploymentName $deploymentName -ResourceGroupName $rgname -TemplateFile sampleDeploymentTemplate.json -SkipTemplateParameterPrompt + Assert-NotNull $result + Assert-AreEqual "InvalidTemplate" $result.Code + Assert-StartsWith "Deployment template validation failed" $result.Message + } + finally + { + # Cleanup + Clean-ResourceGroup $rgname + } +} + <# .SYNOPSIS Tests cross resource group deployment via template file. diff --git a/src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.DeploymentTests/TestTestResourceGroupDeploymentErrors.json b/src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.DeploymentTests/TestTestResourceGroupDeploymentErrors.json new file mode 100644 index 000000000000..4da5673b24a9 --- /dev/null +++ b/src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.DeploymentTests/TestTestResourceGroupDeploymentErrors.json @@ -0,0 +1,638 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourcegroups/unknownresourcegroup/providers/Microsoft.Resources/deployments/ps1693/validate?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL3Jlc291cmNlZ3JvdXBzL3Vua25vd25yZXNvdXJjZWdyb3VwL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVzb3VyY2VzL2RlcGxveW1lbnRzL3BzMTY5My92YWxpZGF0ZT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountName\": {\r\n \"type\": \"String\"\r\n },\r\n \"storageAccountType\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"Standard_LRS\",\r\n \"allowedValues\": [\r\n \"Standard_LRS\",\r\n \"Standard_GRS\",\r\n \"Standard_ZRS\"\r\n ]\r\n },\r\n \"location\": {\r\n \"type\": \"String\",\r\n \"defaultValue\": \"East US\",\r\n \"allowedValues\": [\r\n \"West US\",\r\n \"East US\"\r\n ]\r\n }\r\n },\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n \"name\": \"[parameters('StorageAccountName')]\",\r\n \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n \"properties\": {\r\n \"accountType\": \"[parameters('storageAccountType')]\"\r\n }\r\n }\r\n ],\r\n \"outputs\": {\r\n \"storageAccountInfo\": {\r\n \"value\": \"[reference(concat('Microsoft.Storage/storageAccounts/', parameters('StorageAccountName')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0])]\",\r\n \"type\": \"object\"\r\n }\r\n }\r\n },\r\n \"parameters\": {\r\n \"StorageAccountName\": {\r\n \"value\": \"testvivek52f323kdd255556\"\r\n }\r\n },\r\n \"mode\": \"Incremental\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0d7b03a7-9406-450b-9294-86d09cfd0ad5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1519" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "74968414-7d23-4e85-8eda-e84c521f32af" + ], + "x-ms-correlation-request-id": [ + "74968414-7d23-4e85-8eda-e84c521f32af" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224829Z:74968414-7d23-4e85-8eda-e84c521f32af" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:48:29 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "112" + ], + "Retry-After": [ + "0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'unknownresourcegroup' could not be found.\"\r\n }\r\n}", + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourcegroups/ps8149?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL3Jlc291cmNlZ3JvdXBzL3BzODE0OT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "HEAD", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4086ed19-7de9-4b3e-9b62-49bdfc1ccff0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "d4c1dca7-a2ec-400b-9482-cbce99581f42" + ], + "x-ms-correlation-request-id": [ + "d4c1dca7-a2ec-400b-9482-cbce99581f42" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224829Z:d4c1dca7-a2ec-400b-9482-cbce99581f42" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:48:29 GMT" + ], + "Content-Length": [ + "98" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Retry-After": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourcegroups/ps8149?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL3Jlc291cmNlZ3JvdXBzL3BzODE0OT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "HEAD", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0640ffcb-1b3b-4b4f-bdab-a08fb6a52db5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "9e8dc4dd-3d52-4c7b-877b-a71422e87bfa" + ], + "x-ms-correlation-request-id": [ + "9e8dc4dd-3d52-4c7b-877b-a71422e87bfa" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224832Z:9e8dc4dd-3d52-4c7b-877b-a71422e87bfa" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:48:31 GMT" + ], + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Retry-After": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourcegroups/ps8149?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL3Jlc291cmNlZ3JvdXBzL3BzODE0OT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West US 2\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0e1362df-60a4-4c0d-b273-b8080abe0e85" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "7ce81e96-1efd-4e64-989b-79232919b6d4" + ], + "x-ms-correlation-request-id": [ + "7ce81e96-1efd-4e64-989b-79232919b6d4" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224830Z:7ce81e96-1efd-4e64-989b-79232919b6d4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:48:29 GMT" + ], + "Content-Length": [ + "166" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Retry-After": [ + "0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/ps8149\",\r\n \"name\": \"ps8149\",\r\n \"location\": \"westus2\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourcegroups/ps8149/providers/Microsoft.Resources/deployments/ps1693/validate?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL3Jlc291cmNlZ3JvdXBzL3BzODE0OS9wcm92aWRlcnMvTWljcm9zb2Z0LlJlc291cmNlcy9kZXBsb3ltZW50cy9wczE2OTMvdmFsaWRhdGU/YXBpLXZlcnNpb249MjAxOC0wNS0wMQ==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"storageAccountName\": {\r\n \"type\": \"String\"\r\n },\r\n \"storageAccountType\": {\r\n \"type\": \"string\",\r\n \"defaultValue\": \"Standard_LRS\",\r\n \"allowedValues\": [\r\n \"Standard_LRS\",\r\n \"Standard_GRS\",\r\n \"Standard_ZRS\"\r\n ]\r\n },\r\n \"location\": {\r\n \"type\": \"String\",\r\n \"defaultValue\": \"East US\",\r\n \"allowedValues\": [\r\n \"West US\",\r\n \"East US\"\r\n ]\r\n }\r\n },\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n \"name\": \"[parameters('StorageAccountName')]\",\r\n \"apiVersion\": \"2015-06-15\",\r\n \"location\": \"[parameters('location')]\",\r\n \"properties\": {\r\n \"accountType\": \"[parameters('storageAccountType')]\"\r\n }\r\n }\r\n ],\r\n \"outputs\": {\r\n \"storageAccountInfo\": {\r\n \"value\": \"[reference(concat('Microsoft.Storage/storageAccounts/', parameters('StorageAccountName')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0])]\",\r\n \"type\": \"object\"\r\n }\r\n }\r\n },\r\n \"parameters\": {},\r\n \"mode\": \"Incremental\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e4a8c74e-51aa-4f91-ace1-b982eb2500c9" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1428" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "c9a4e259-a196-41aa-a5a3-e200ce4d8b6f" + ], + "x-ms-correlation-request-id": [ + "c9a4e259-a196-41aa-a5a3-e200ce4d8b6f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224832Z:c9a4e259-a196-41aa-a5a3-e200ce4d8b6f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:48:32 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "265" + ], + "Retry-After": [ + "0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InvalidTemplate\",\r\n \"message\": \"Deployment template validation failed: 'The value for the template parameter 'storageAccountName' at line '7' and column '31' is not provided. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.\"\r\n }\r\n}", + "StatusCode": 400 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourcegroups/ps8149?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL3Jlc291cmNlZ3JvdXBzL3BzODE0OT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "27527f7b-d552-4e75-9320-860ee64c8b7b" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzgxNDktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2018-05-01" + ], + "Retry-After": [ + "0" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "27e34148-304d-434d-9e15-8a317f4bf87a" + ], + "x-ms-correlation-request-id": [ + "27e34148-304d-434d-9e15-8a317f4bf87a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224832Z:27e34148-304d-434d-9e15-8a317f4bf87a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:48:31 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzgxNDktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpneE5Ea3RWMFZUVkZWVE1pSXNJbXB2WWt4dlkyRjBhVzl1SWpvaWQyVnpkSFZ6TWlKOT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzgxNDktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2018-05-01" + ], + "Retry-After": [ + "0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-request-id": [ + "f600c9c4-76f2-44ba-a019-50b315f84d02" + ], + "x-ms-correlation-request-id": [ + "f600c9c4-76f2-44ba-a019-50b315f84d02" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224847Z:f600c9c4-76f2-44ba-a019-50b315f84d02" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:48:47 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzgxNDktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpneE5Ea3RWMFZUVkZWVE1pSXNJbXB2WWt4dlkyRjBhVzl1SWpvaWQyVnpkSFZ6TWlKOT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzgxNDktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2018-05-01" + ], + "Retry-After": [ + "0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-request-id": [ + "ac8e5b3e-de9a-466a-bb30-b863a9937a20" + ], + "x-ms-correlation-request-id": [ + "ac8e5b3e-de9a-466a-bb30-b863a9937a20" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224902Z:ac8e5b3e-de9a-466a-bb30-b863a9937a20" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:49:02 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzgxNDktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpneE5Ea3RWMFZUVkZWVE1pSXNJbXB2WWt4dlkyRjBhVzl1SWpvaWQyVnpkSFZ6TWlKOT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-request-id": [ + "4db2137a-1afd-408f-872f-4ae04c20806c" + ], + "x-ms-correlation-request-id": [ + "4db2137a-1afd-408f-872f-4ae04c20806c" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224917Z:4db2137a-1afd-408f-872f-4ae04c20806c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:49:17 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ], + "Retry-After": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzgxNDktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2018-05-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzljYmQ5MjAtYzAwYy00MjdjLTg1MmItOGFhZjM4YmFkYWViL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpneE5Ea3RWMFZUVkZWVE1pSXNJbXB2WWt4dlkyRjBhVzl1SWpvaWQyVnpkSFZ6TWlKOT9hcGktdmVyc2lvbj0yMDE4LTA1LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27129.04", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.9.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-request-id": [ + "22231c58-4602-4026-b24b-ff24f580a7bc" + ], + "x-ms-correlation-request-id": [ + "22231c58-4602-4026-b24b-ff24f580a7bc" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20190325T224917Z:22231c58-4602-4026-b24b-ff24f580a7bc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 25 Mar 2019 22:49:17 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ], + "Retry-After": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + } + ], + "Names": { + "Test-TestResourceGroupDeploymentErrors": [ + "ps1693", + "ps8149", + "ps743" + ] + }, + "Variables": { + "SubscriptionId": "c9cbd920-c00c-427c-852b-8aaf38badaeb" + } +} \ No newline at end of file diff --git a/src/Resources/Resources/ChangeLog.md b/src/Resources/Resources/ChangeLog.md index 911f48d43d6c..37ab13a34693 100644 --- a/src/Resources/Resources/ChangeLog.md +++ b/src/Resources/Resources/ChangeLog.md @@ -19,6 +19,11 @@ --> ## Upcoming Release * Improve handling of providers for `Get-AzResource` when providing `-ResourceId` or `-ResourceGroupName`, `-Name` and `-ResourceType` parameters +* Improve error handling for for `Test-AzDeployment` and `Test-AzResourceGroupDeployment` + - Handle errors thrown outside of deployment validation and include them in output of command instead + - More information here: https://github.com/Azure/azure-powershell/issues/6856 +* Add `-IgnoreDynamicParameters` switch parameter to set of deployment cmdlets to skip prompt in script and job scenarios + - More information here: https://github.com/Azure/azure-powershell/issues/6856 ## Version 1.2.1 * Update wildcard support for Get-AzResource and Get-AzResourceGroup diff --git a/src/Resources/Resources/help/New-AzDeployment.md b/src/Resources/Resources/help/New-AzDeployment.md index 4171a0de4fd2..c63902f528ff 100644 --- a/src/Resources/Resources/help/New-AzDeployment.md +++ b/src/Resources/Resources/help/New-AzDeployment.md @@ -15,85 +15,90 @@ Create a deployment ### ByTemplateFileWithNoParameters (Default) ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateFile [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] + -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateObjectAndParameterObject ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterObject -TemplateObject [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterObject -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateFileAndParameterObject ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterObject -TemplateFile [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterObject -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateUriAndParameterObject ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterObject -TemplateUri [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterObject -TemplateUri [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateObjectAndParameterFile ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterFile -TemplateObject [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterFile -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateFileAndParameterFile ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterFile -TemplateFile [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterFile -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] + [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateUriAndParameterFile ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterFile -TemplateUri [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterFile -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] + [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateObjectAndParameterUri ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterUri -TemplateObject [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterUri -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateFileAndParameterUri ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterUri -TemplateFile [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterUri -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] + [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateUriAndParameterUri ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterUri -TemplateUri [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterUri -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] + [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateObjectWithNoParameters ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateObject [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] + -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateUriWithNoParameters ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateUri [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] + -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -250,6 +255,21 @@ 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. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -TemplateFile Local path to the template file. diff --git a/src/Resources/Resources/help/New-AzResourceGroupDeployment.md b/src/Resources/Resources/help/New-AzResourceGroupDeployment.md index cf2d5f058b3c..27c3cba40650 100644 --- a/src/Resources/Resources/help/New-AzResourceGroupDeployment.md +++ b/src/Resources/Resources/help/New-AzResourceGroupDeployment.md @@ -17,96 +17,105 @@ Adds an Azure deployment to a resource group. ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateFile [-ApiVersion ] [-Pre] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateObjectAndParameterObject ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterObject -TemplateObject [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterObject -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateFileAndParameterObject ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterObject -TemplateFile [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterObject -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateUriAndParameterObject ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterObject -TemplateUri [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterObject -TemplateUri [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateObjectAndParameterFile ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterFile -TemplateObject [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterFile -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateFileAndParameterFile ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterFile -TemplateFile [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterFile -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateUriAndParameterFile ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterFile -TemplateUri [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterFile -TemplateUri [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateObjectAndParameterUri ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterUri -TemplateObject [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterUri -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateFileAndParameterUri ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterUri -TemplateFile [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterUri -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateUriAndParameterUri ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterUri -TemplateUri [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateParameterUri -TemplateUri [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateObjectWithNoParameters ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateObject [-ApiVersion ] [-Pre] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateUriWithNoParameters ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateUri [-ApiVersion ] [-Pre] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] + [-AsJob] -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -329,6 +338,21 @@ 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. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -TemplateFile Specifies the full path of a JSON template file. This can be a custom template or a gallery template that is saved as a JSON file, such as one created by using the **Save-AzResourceGroupGalleryTemplate** cmdlet. diff --git a/src/Resources/Resources/help/Test-AzDeployment.md b/src/Resources/Resources/help/Test-AzDeployment.md index fb3b5a7638b9..df40a48cf12c 100644 --- a/src/Resources/Resources/help/Test-AzDeployment.md +++ b/src/Resources/Resources/help/Test-AzDeployment.md @@ -14,74 +14,83 @@ Validates a deployment. ### ByTemplateFileWithNoParameters (Default) ``` -Test-AzDeployment -Location -TemplateFile [-ApiVersion ] [-Pre] - [-DefaultProfile ] [] +Test-AzDeployment -Location -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateObjectAndParameterObject ``` Test-AzDeployment -Location -TemplateParameterObject -TemplateObject - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateFileAndParameterObject ``` Test-AzDeployment -Location -TemplateParameterObject -TemplateFile - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateUriAndParameterObject ``` Test-AzDeployment -Location -TemplateParameterObject -TemplateUri - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateObjectAndParameterFile ``` Test-AzDeployment -Location -TemplateParameterFile -TemplateObject - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateFileAndParameterFile ``` Test-AzDeployment -Location -TemplateParameterFile -TemplateFile - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateUriAndParameterFile ``` Test-AzDeployment -Location -TemplateParameterFile -TemplateUri - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateObjectAndParameterUri ``` Test-AzDeployment -Location -TemplateParameterUri -TemplateObject - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateFileAndParameterUri ``` Test-AzDeployment -Location -TemplateParameterUri -TemplateFile - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateUriAndParameterUri ``` Test-AzDeployment -Location -TemplateParameterUri -TemplateUri - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateObjectWithNoParameters ``` -Test-AzDeployment -Location -TemplateObject [-ApiVersion ] [-Pre] - [-DefaultProfile ] [] +Test-AzDeployment -Location -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateUriWithNoParameters ``` -Test-AzDeployment -Location -TemplateUri [-ApiVersion ] [-Pre] - [-DefaultProfile ] [] +Test-AzDeployment -Location -TemplateUri [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ## DESCRIPTION @@ -168,6 +177,21 @@ 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. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -TemplateFile Local path to the template file. diff --git a/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md b/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md index c1388ee93ecc..618a44c82422 100644 --- a/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md +++ b/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md @@ -16,85 +16,94 @@ Validates a resource group deployment. ### ByTemplateFileWithNoParameters (Default) ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] - [-RollBackDeploymentName ] -TemplateFile [-ApiVersion ] [-Pre] - [-DefaultProfile ] [] + [-RollBackDeploymentName ] -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateObjectAndParameterObject ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterObject -TemplateObject - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateFileAndParameterObject ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterObject -TemplateFile - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateUriAndParameterObject ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterObject -TemplateUri - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateObjectAndParameterFile ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterFile -TemplateObject - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateFileAndParameterFile ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterFile -TemplateFile - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateUriAndParameterFile ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterFile -TemplateUri - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateObjectAndParameterUri ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterUri -TemplateObject - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateFileAndParameterUri ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterUri -TemplateFile - [-ApiVersion ] [-Pre] [-DefaultProfile ] [] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateUriAndParameterUri ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] - [-RollBackDeploymentName ] -TemplateParameterUri -TemplateUri [-ApiVersion ] - [-Pre] [-DefaultProfile ] [] + [-RollBackDeploymentName ] -TemplateParameterUri -TemplateUri + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [] ``` ### ByTemplateObjectWithNoParameters ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] - [-RollBackDeploymentName ] -TemplateObject [-ApiVersion ] [-Pre] - [-DefaultProfile ] [] + [-RollBackDeploymentName ] -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateUriWithNoParameters ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] - [-RollBackDeploymentName ] -TemplateUri [-ApiVersion ] [-Pre] - [-DefaultProfile ] [] + [-RollBackDeploymentName ] -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] + [-Pre] [-DefaultProfile ] [] ``` ## DESCRIPTION @@ -223,6 +232,21 @@ 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. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -TemplateFile Specifies the full path of a JSON template file.