diff --git a/src/Websites/Websites/ChangeLog.md b/src/Websites/Websites/ChangeLog.md index 6ef53d1ce93f..ef96ef66534c 100644 --- a/src/Websites/Websites/ChangeLog.md +++ b/src/Websites/Websites/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Allow clean and restart parameters to be toggled off for `Publish-AzWebApp`` ## Version 3.2.1 * Introduced secrets detection feature to safeguard sensitive data. diff --git a/src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs b/src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs index 1c840fc458d6..e60c7ef81b3a 100644 --- a/src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs +++ b/src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs @@ -49,13 +49,13 @@ public class PublishAzureWebAppCmdlet : WebAppOptionalSlotBaseCmdlet public string Type { get; set; } [Parameter(Mandatory = false, HelpMessage = "Cleans the target directory prior to deploying the file(s).")] - public SwitchParameter Clean { get; set; } + public bool? Clean { get; set; } [Parameter(Mandatory = false, HelpMessage = "The artifact is deployed asynchronously. (The command will exit once the artifact is pushed to the web app.)")] - public SwitchParameter Async { get; set; } + public bool? Async { get; set; } [Parameter(Mandatory = false, HelpMessage = "The web app will be restarted following the deployment. Set this to false if you are deploying multiple artifacts and do not want to restart the site on the earlier deployments.")] - public SwitchParameter Restart { get; set; } + public bool? Restart { get; set; } [Parameter(Mandatory = false, HelpMessage = "Absolute path that the artifact should be deployed to.")] public string TargetPath { get; set; } @@ -120,7 +120,7 @@ public override void ExecuteCmdlet() paramValues.Add("path", TargetPath); // default async to true if not provided to match old behavior - if (Async.IsPresent) + if (Async != null) { paramValues.Add("async", Async.ToString()); } @@ -130,12 +130,12 @@ public override void ExecuteCmdlet() paramValues.Add("async", "true"); } - if (Restart.IsPresent) + if (Restart != null) { paramValues.Add("restart", Restart.ToString()); } - if (Clean.IsPresent) + if (Clean != null) { paramValues.Add("clean", Clean.ToString()); } diff --git a/src/Websites/Websites/help/Publish-AzWebApp.md b/src/Websites/Websites/help/Publish-AzWebApp.md index 5455e794caa4..ad72ab93cafc 100644 --- a/src/Websites/Websites/help/Publish-AzWebApp.md +++ b/src/Websites/Websites/help/Publish-AzWebApp.md @@ -14,18 +14,18 @@ Deploys an Azure Web App from a ZIP, JAR, or WAR file using zipdeploy. ### FromWebApp (Default) ``` -Publish-AzWebApp -ArchivePath [-Type ] [-Clean] [-Async] [-Restart] [-TargetPath ] - [-IgnoreStack] [-Reset] [-Force] [-AsJob] [-Timeout ] [-WebApp] - [-DefaultProfile ] [-WhatIf] [-Confirm] - [] +Publish-AzWebApp -ArchivePath [-Type ] [-Clean ] [-Async ] + [-Restart ] [-TargetPath ] [-IgnoreStack] [-Reset] [-Force] [-AsJob] [-Timeout ] + [-WebApp] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] ``` ### FromResourceName ``` -Publish-AzWebApp -ArchivePath [-Type ] [-Clean] [-Async] [-Restart] [-TargetPath ] - [-IgnoreStack] [-Reset] [-Force] [-AsJob] [-Timeout ] [-ResourceGroupName] [-Name] - [[-Slot] ] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] +Publish-AzWebApp -ArchivePath [-Type ] [-Clean ] [-Async ] + [-Restart ] [-TargetPath ] [-IgnoreStack] [-Reset] [-Force] [-AsJob] [-Timeout ] + [-ResourceGroupName] [-Name] [[-Slot] ] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -113,7 +113,7 @@ Accept wildcard characters: False The artifact is deployed asynchronously. (The command will exit once the artifact is pushed to the web app.) ```yaml -Type: System.Management.Automation.SwitchParameter +Type: System.Nullable`1[System.Boolean] Parameter Sets: (All) Aliases: @@ -128,7 +128,7 @@ Accept wildcard characters: False Cleans the target directory prior to deploying the file(s). ```yaml -Type: System.Management.Automation.SwitchParameter +Type: System.Nullable`1[System.Boolean] Parameter Sets: (All) Aliases: @@ -233,7 +233,7 @@ Accept wildcard characters: False The web app will be restarted following the deployment. Set this to false if you are deploying multiple artifacts and do not want to restart the site on the earlier deployments. ```yaml -Type: System.Management.Automation.SwitchParameter +Type: System.Nullable`1[System.Boolean] Parameter Sets: (All) Aliases: diff --git a/tools/StaticAnalysis/Exceptions/Az.Websites/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.Websites/BreakingChangeIssues.csv index 1f1472231ced..0cb06feeebbe 100644 --- a/tools/StaticAnalysis/Exceptions/Az.Websites/BreakingChangeIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.Websites/BreakingChangeIssues.csv @@ -1,2 +1,5 @@ "Module","ClassName","Target","Severity","ProblemId","Description","Remediation" "Az.Websites","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.NewAzureWebAppSlotCmdlet","New-AzWebAppSlot","0","1050","The parameter set '__AllParameterSets' for cmdlet 'New-AzWebAppSlot' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'New-AzWebAppSlot'." +"Az.Websites","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet","New-AzWebAppSlot","0","1050","The cmdlet 'Publish-AzWebApp' no longer supports the type 'System.Management.Automation.SwitchParameter' for parameter 'Clean'.","Change the type for parameter 'Clean' back to 'System.Management.Automation.SwitchParameter'." +"Az.Websites","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet","New-AzWebAppSlot","0","1050","The cmdlet 'Publish-AzWebApp' no longer supports the type 'System.Management.Automation.SwitchParameter' for parameter 'Async'.","Change the type for parameter 'Async' back to 'System.Management.Automation.SwitchParameter'." +"Az.Websites","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet","New-AzWebAppSlot","0","1050","The cmdlet 'Publish-AzWebApp' no longer supports the type 'System.Management.Automation.SwitchParameter' for parameter 'Restart'.","Change the type for parameter 'Restart' back to 'System.Management.Automation.SwitchParameter'." \ No newline at end of file