Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.21k stars 3.82k forks source link

WebApp:Get-AzWebAppSnapshot cmdlet Issue #15422

Closed MayankBargali-MSFT closed 3 years ago

MayankBargali-MSFT commented 3 years ago

Description

One of our customer observed below error while executing the below command. I have collected the -debug output from the customer and I can see that the issue is while parsing the field (propertiestime) to DateTime on the response we get from List snapshot REST API (not sure for all json object or only one-two json object) Get-AzWebAppSnapshot -ResourceGroupName $AppServicePlanResourceGroup -Name $WebAppName

Error: [2021-07-02T08:43:45.157Z] ERROR: String '06/13/2021 14:32:13' was not recognized as a valid DateTime. [2021-07-02T08:43:45.157Z] [2021-07-02T08:43:45.157Z] Exception : [2021-07-02T08:43:45.157Z] Type : System.FormatException [2021-07-02T08:43:45.157Z] TargetSite : [2021-07-02T08:43:45.157Z] Name : Parse [2021-07-02T08:43:45.157Z] DeclaringType : System.DateTimeParse, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e [2021-07-02T08:43:45.157Z] MemberType : Method [2021-07-02T08:43:45.157Z] Module : System.Private.CoreLib.dll [2021-07-02T08:43:45.157Z] StackTrace : [2021-07-02T08:43:45.157Z] at System.DateTimeParse.Parse(ReadOnlySpan1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles) [2021-07-02T08:43:45.157Z] at System.DateTime.Parse(String s) [2021-07-02T08:43:45.157Z] at Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.GetAzureWebAppSnapshot.<ExecuteCmdlet>b__4_0(Snapshot s) [2021-07-02T08:43:45.157Z] at System.Linq.Enumerable.SelectListIterator2.ToArray() [2021-07-02T08:43:45.157Z] at System.Linq.Buffer1..ctor(IEnumerable1 source) [2021-07-02T08:43:45.157Z] at System.Linq.OrderedEnumerable1.ToArray() [2021-07-02T08:43:45.157Z] at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) [2021-07-02T08:43:45.157Z] at Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.GetAzureWebAppSnapshot.ExecuteCmdlet() [2021-07-02T08:43:45.158Z] at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c3`1.b3_0(T c) [2021-07-02T08:43:45.158Z] at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor) [2021-07-02T08:43:45.158Z] at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet) [2021-07-02T08:43:45.158Z] at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()

Name Value


PSVersion 7.0.6 PSEdition Core GitCommitId 7.0.6 OS Darwin 20.3.0 Darwin Kernel Version 20.3.0: Thu … Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

Interestingly the issue is only observed while executing it VS Code for function and we see the same exception:

test cap1

But when running the command from terminal it works fine at customer end and we see the az and az.websites modules are same.

cap2

I can share the Get-AZSnapshot_DebugOutput and Response_from_list-snapshots_REST_API offline for more details.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp, @AzureAppServiceCLI.

Issue Details
## Description One of our customer observed below error while executing the below command. I have collected the -debug output from the customer and I can see that the issue is while parsing the field (propertiestime) to DateTime on the response we get from List snapshot REST API (not sure for all json object or only one-two json object) Get-AzWebAppSnapshot -ResourceGroupName $AppServicePlanResourceGroup -Name $WebAppName Error: [2021-07-02T08:43:45.157Z] ERROR: String '06/13/2021 14:32:13' was not recognized as a valid DateTime. [2021-07-02T08:43:45.157Z] [2021-07-02T08:43:45.157Z] Exception : [2021-07-02T08:43:45.157Z] Type : System.FormatException [2021-07-02T08:43:45.157Z] TargetSite : [2021-07-02T08:43:45.157Z] Name : Parse [2021-07-02T08:43:45.157Z] DeclaringType : System.DateTimeParse, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e [2021-07-02T08:43:45.157Z] MemberType : Method [2021-07-02T08:43:45.157Z] Module : System.Private.CoreLib.dll [2021-07-02T08:43:45.157Z] StackTrace : [2021-07-02T08:43:45.157Z] at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles) [2021-07-02T08:43:45.157Z] at System.DateTime.Parse(String s) [2021-07-02T08:43:45.157Z] at Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.GetAzureWebAppSnapshot.b__4_0(Snapshot s) [2021-07-02T08:43:45.157Z] at System.Linq.Enumerable.SelectListIterator`2.ToArray() [2021-07-02T08:43:45.157Z] at System.Linq.Buffer`1..ctor(IEnumerable`1 source) [2021-07-02T08:43:45.157Z] at System.Linq.OrderedEnumerable`1.ToArray() [2021-07-02T08:43:45.157Z] at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) [2021-07-02T08:43:45.157Z] at Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.GetAzureWebAppSnapshot.ExecuteCmdlet() [2021-07-02T08:43:45.158Z] at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.b__3_0(T c) [2021-07-02T08:43:45.158Z] at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor) [2021-07-02T08:43:45.158Z] at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet) [2021-07-02T08:43:45.158Z] at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() Name Value ---- ----- PSVersion 7.0.6 PSEdition Core GitCommitId 7.0.6 OS Darwin 20.3.0 Darwin Kernel Version 20.3.0: Thu … Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 Interestingly the issue is only observed while executing it VS Code for function and we see the same exception: test cap1 But when running the command from terminal it works fine at customer end and we see the az and az.websites modules are same. cap2 I can share the Get-AZSnapshot_DebugOutput and Response_from_list-snapshots_REST_API offline for more details.
Author: MayankBargali-MSFT
Assignees: -
Labels: `App Services`, `Service Attention`, `needs-triage`
Milestone: -
Kotasudhakarreddy commented 3 years ago

Unable to repro in the latest Az.Websites module (2.8.0). Update to latest module using Update-Module -Name Az.Websites should resolve the issue.

ghost commented 3 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!