Skip to content
Merged
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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
* Introduced an option to give custom timeout for `Publish-AzWebApp`
* Added support for App Service Environment
- `New-AzAppServiceEnvironment`
- `Remove-AzAppServiceEnvironment`
Expand Down
11 changes: 11 additions & 0 deletions src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

using Microsoft.Azure.Commands.WebApps.Models;
using Microsoft.Azure.Management.WebSites.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.IO;
using System.Management.Automation;
Expand Down Expand Up @@ -45,6 +46,10 @@ public class PublishAzureWebAppCmdlet : WebAppOptionalSlotBaseCmdlet
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
public SwitchParameter AsJob { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Configurable timeout in millseconds to wait for deployment operation to complete. The default timeout is 100000 milliseconds")]
[ValidateRange(100000, 3600000)]
public double Timeout { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();
Expand Down Expand Up @@ -72,6 +77,12 @@ public override void ExecuteCmdlet()
using (var s = File.OpenRead(ArchivePath))
{
HttpClient client = new HttpClient();
if (this.IsParameterBound(cmdlet => cmdlet.Timeout))
{
// Considering the deployment of large packages the default time(150 seconds) is not sufficient. So increased the timeout based on user choice.
client.Timeout = TimeSpan.FromMilliseconds(Timeout);
}

var byteArray = Encoding.ASCII.GetBytes(user.PublishingUserName + ":" + user.PublishingPassword);
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpContent fileContent = new StreamContent(s);
Expand Down
23 changes: 23 additions & 0 deletions src/Websites/Websites/help/Publish-AzWebApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ PS C:\> Publish-AzWebApp -WebApp $app -ArchivePath C:\project\app.zip -Force

Uploads the contents of java_app.jar to the web app named ContosoApp belonging to the resource group ContosoRG.

### Example 6
```powershell
PS C:\> $app = Get-AzWebApp -ResourceGroupName ContosoRG -Name ContosoApp
PS C:\> Publish-AzWebApp -WebApp $app -ArchivePath C:\project\app.zip -Timeout 300000 -Force
```

Uploads the contents of java_app.jar to the web app named ContosoApp belonging to the resource group ContosoRG. User can Sets the timespan in Milliseconds to wait before the request times out.

## PARAMETERS

### -ArchivePath
Expand Down Expand Up @@ -171,6 +179,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Timeout
Sets the timespan in Milliseconds to wait before the request times out.

```yaml
Type: System.Double
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WebApp
The web app object

Expand Down
4 changes: 2 additions & 2 deletions src/Websites/Websites/help/Remove-AzWebAppCertificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ schema: 2.0.0
# Remove-AzWebAppCertificate

## SYNOPSIS
Creates an App service managed certificate for an Azure Web App.
Removes an App service managed certificate for an Azure Web App.

## SYNTAX

Expand All @@ -17,7 +17,7 @@ Remove-AzWebAppCertificate [-ResourceGroupName] <String> [-ThumbPrint] <String>
```

## DESCRIPTION
The **Remove-AzWebAppCertificate** cmdlet creates an Azure App Service Managed Certificate
The **Remove-AzWebAppCertificate** cmdlet Removes an Azure App Service Managed Certificate

## EXAMPLES

Expand Down