Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Websites/Websites/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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());
}
Expand All @@ -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());
}
Expand Down
22 changes: 11 additions & 11 deletions src/Websites/Websites/help/Publish-AzWebApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ Deploys an Azure Web App from a ZIP, JAR, or WAR file using zipdeploy.

### FromWebApp (Default)
```
Publish-AzWebApp -ArchivePath <String> [-Type <String>] [-Clean] [-Async] [-Restart] [-TargetPath <String>]
[-IgnoreStack] [-Reset] [-Force] [-AsJob] [-Timeout <Double>] [-WebApp] <PSSite>
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
Publish-AzWebApp -ArchivePath <String> [-Type <String>] [-Clean <Boolean>] [-Async <Boolean>]
[-Restart <Boolean>] [-TargetPath <String>] [-IgnoreStack] [-Reset] [-Force] [-AsJob] [-Timeout <Double>]
[-WebApp] <PSSite> [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

### FromResourceName
```
Publish-AzWebApp -ArchivePath <String> [-Type <String>] [-Clean] [-Async] [-Restart] [-TargetPath <String>]
[-IgnoreStack] [-Reset] [-Force] [-AsJob] [-Timeout <Double>] [-ResourceGroupName] <String> [-Name] <String>
[[-Slot] <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
Publish-AzWebApp -ArchivePath <String> [-Type <String>] [-Clean <Boolean>] [-Async <Boolean>]
[-Restart <Boolean>] [-TargetPath <String>] [-IgnoreStack] [-Reset] [-Force] [-AsJob] [-Timeout <Double>]
[-ResourceGroupName] <String> [-Name] <String> [[-Slot] <String>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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:

Expand All @@ -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:

Expand Down Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -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'."