Skip to content

Commit 9a11862

Browse files
Kotasudhakarreddyvidyadharijamiisra-fel
authored
fix #13763- webapp:Increased timout to 300000 MS for Publish-AzWebApp cmdlet (#13894)
* fix #13763- Increased timout to 300000 MS for Publish-AzWebApp cmdlet * Updated changelog.md * Added optional property for Timeout. * Added validation for handling minimum Timeout * Updated changelog * Addressed review comment * fixed build issue 'OverflowException' * Fixed build issue * Addressed review comments * Updated Help text for Remove-AzWebAppCertificate * Honoring UseManagedDisk input for HyperV to Azure scenario in site recovery service (#14128) * Honoring UseManagedDisk input for HyperV to Azure scenario in site recovery service * Update in changeLog * Update in help file * Minor fix in help file * Added test cases * NIT fixes for spaces * Addressed review comments * Update ChangeLog.md Co-authored-by: vidyadharijami <[email protected]> Co-authored-by: Yeming Liu <[email protected]>
1 parent 14d4edb commit 9a11862

File tree

6 files changed

+721
-686
lines changed

6 files changed

+721
-686
lines changed

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests/TestPublishWebAppFromWar.json

Lines changed: 341 additions & 341 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests/TestPublishWebAppFromZip.json

Lines changed: 343 additions & 343 deletions
Large diffs are not rendered by default.

src/Websites/Websites/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Introduced an option to give custom timeout for `Publish-AzWebApp`
2122
* Added support for App Service Environment
2223
- `New-AzAppServiceEnvironment`
2324
- `Remove-AzAppServiceEnvironment`

src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

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

49+
[Parameter(Mandatory = false, HelpMessage = "Configurable timeout in millseconds to wait for deployment operation to complete. The default timeout is 100000 milliseconds")]
50+
[ValidateRange(100000, 3600000)]
51+
public double Timeout { get; set; }
52+
4853
public override void ExecuteCmdlet()
4954
{
5055
base.ExecuteCmdlet();
@@ -72,6 +77,12 @@ public override void ExecuteCmdlet()
7277
using (var s = File.OpenRead(ArchivePath))
7378
{
7479
HttpClient client = new HttpClient();
80+
if (this.IsParameterBound(cmdlet => cmdlet.Timeout))
81+
{
82+
// Considering the deployment of large packages the default time(150 seconds) is not sufficient. So increased the timeout based on user choice.
83+
client.Timeout = TimeSpan.FromMilliseconds(Timeout);
84+
}
85+
7586
var byteArray = Encoding.ASCII.GetBytes(user.PublishingUserName + ":" + user.PublishingPassword);
7687
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
7788
HttpContent fileContent = new StreamContent(s);

src/Websites/Websites/help/Publish-AzWebApp.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ PS C:\> Publish-AzWebApp -WebApp $app -ArchivePath C:\project\app.zip -Force
6464

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

67+
### Example 6
68+
```powershell
69+
PS C:\> $app = Get-AzWebApp -ResourceGroupName ContosoRG -Name ContosoApp
70+
PS C:\> Publish-AzWebApp -WebApp $app -ArchivePath C:\project\app.zip -Timeout 300000 -Force
71+
```
72+
73+
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.
74+
6775
## PARAMETERS
6876

6977
### -ArchivePath
@@ -171,6 +179,21 @@ Accept pipeline input: True (ByPropertyName)
171179
Accept wildcard characters: False
172180
```
173181
182+
### -Timeout
183+
Sets the timespan in Milliseconds to wait before the request times out.
184+
185+
```yaml
186+
Type: System.Double
187+
Parameter Sets: (All)
188+
Aliases:
189+
190+
Required: False
191+
Position: Named
192+
Default value: None
193+
Accept pipeline input: False
194+
Accept wildcard characters: False
195+
```
196+
174197
### -WebApp
175198
The web app object
176199

src/Websites/Websites/help/Remove-AzWebAppCertificate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Remove-AzWebAppCertificate
99

1010
## SYNOPSIS
11-
Creates an App service managed certificate for an Azure Web App.
11+
Removes an App service managed certificate for an Azure Web App.
1212

1313
## SYNTAX
1414

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

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

2222
## EXAMPLES
2323

0 commit comments

Comments
 (0)