Get-AzWebAppSnapshot throws "String was not recognized as a valid DateTime" error

%3CLINGO-SUB%20id%3D%22lingo-sub-1174276%22%20slang%3D%22en-US%22%3EGet-AzWebAppSnapshot%20throws%20%22String%20was%20not%20recognized%20as%20a%20valid%20DateTime%22%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1174276%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20implementing%20Release%20Pipeline%20and%20wanted%20to%20use%20App%20Service%20Snapshots%20feature%20(which%20is%20currently%20in%20preview).%20According%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Faz.websites%2Fget-azwebappsnapshot%3Fview%3Dazps-3.4.0%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Edocumentation%3C%2FA%3E%20it%20should%20be%20easy%2C%20but%20I%20faced%20an%20issue%20at%20very%20first%20step%20when%20just%20tried%20to%20get%20snapshot%20using%20appropriate%20Az%20commandlet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3ENote%3A%3C%2FSTRONG%3E%20app%2C%20that%20I%20would%20like%20to%20get%20snapshots%20from%20is%20in%20P%20tier%20and%20have%20snapshots%20(at%20least%20they%20can%20be%20seen%20on%20Backup%20blade)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20what%20I%20am%20trying%20to%20run%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EGet-AzWebAppSnapshot%20-ResourceGroupName%20ibu-testsnapshot%20-Name%20ibu-testsnapshot%20-Slot%20production%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAn%20the%20exception%20in%20Powershell%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EGet-AzWebAppSnapshot%20%3A%20String%20was%20not%20recognized%20as%20a%20valid%20DateTime.%0AAt%20line%3A1%20char%3A1%0A%2B%20Get-AzWebAppSnapshot%20-ResourceGroupName%20weu-prd-xc2%20-Name%20weu-prd-xc2%20...%0A%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%20%20%20%20%2B%20CategoryInfo%20%20%20%20%20%20%20%20%20%20%3A%20CloseError%3A%20(%3A)%20%5BGet-AzWebAppSnapshot%5D%2C%20FormatException%0A%20%20%20%20%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.GetAzureWebAppSnapshot%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20suppose%20it%20is%20expecting%20some%20parameter%20to%20be%20DateTime%2C%20but%20which%20one%3F%20Event%20in%20context%20help%20there%20is%20nothing%20about%20that%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-02-14%2017_24_38-CreateWebAppBackup.ps1%20-%20DevOps%20-%20Visual%20Studio%20Code%20%5BAdministrator%5D.png%22%20style%3D%22width%3A%20866px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F171260iA4A2D4A4D1DE9F70%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-02-14%2017_24_38-CreateWebAppBackup.ps1%20-%20DevOps%20-%20Visual%20Studio%20Code%20%5BAdministrator%5D.png%22%20alt%3D%222020-02-14%2017_24_38-CreateWebAppBackup.ps1%20-%20DevOps%20-%20Visual%20Studio%20Code%20%5BAdministrator%5D.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EDoes%20anybody%20have%20any%20idea%20what%20can%20be%20the%20case%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1174276%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApp%20Services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Resource%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDevOps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
New Contributor

I am implementing Release Pipeline and wanted to use App Service Snapshots feature (which is currently in preview). According to the documentation it should be easy, but I faced an issue at very first step when just tried to get snapshot using appropriate Az commandlet.

 

Note: app, that I would like to get snapshots from is in P tier and have snapshots (at least they can be seen on Backup blade)

 

Here what I am trying to run:

 

Get-AzWebAppSnapshot -ResourceGroupName ibu-testsnapshot -Name ibu-testsnapshot -Slot production

 

 

An the exception in Powershell:

 

Get-AzWebAppSnapshot : String was not recognized as a valid DateTime.
At line:1 char:1
+ Get-AzWebAppSnapshot -ResourceGroupName weu-prd-xc2 -Name weu-prd-xc2 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzWebAppSnapshot], FormatException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.GetAzureWebAppSnapshot

 

I suppose it is expecting some parameter to be DateTime, but which one? Event in context help there is nothing about that:

2020-02-14 17_24_38-CreateWebAppBackup.ps1 - DevOps - Visual Studio Code [Administrator].png

Does anybody have any idea what can be the case?

0 Replies