Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
* Increased timeout for Publish-AzWebApp cmdlet
* Added support for App Service Managed certificates
- New Cmdlets
- New-AzWebAppCertificate
Expand Down
8 changes: 8 additions & 0 deletions src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public class PublishAzureWebAppCmdlet : WebAppOptionalSlotBaseCmdlet
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
public SwitchParameter AsJob { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Sets the timespan in Milliseconds to wait before the request times out.")]
public double Timeout { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();
Expand Down Expand Up @@ -72,6 +75,11 @@ public override void ExecuteCmdlet()
using (var s = File.OpenRead(ArchivePath))
{
HttpClient client = new HttpClient();
if (Timeout != 0)
{
// 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