Skip to content

Commit 00a2e50

Browse files
author
Martin Bentancour
authored
Fix DateTime issue restoring deleted webapp (#16308)
* Fix issue restoring deleted WebApp Fixes [issue](#13245) that prevents restoring deleted WebApps if the host running the script uses a locale with a different date format than en-US. * Update ChangeLog.md Include changelog for Restore-AzDeletedWebApp DateTime fix
1 parent 6a87b55 commit 00a2e50

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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+
* Updated `Restore-AzDeletedWebApp` to fix issue that prevents the cmdlet from working on hosts with a locale is anything different from `en-US`
2122

2223
## Version 2.11.0
2324
* Fixed `Set-AzWebAppSlot` to support MinTlsVersion version update [#17663]

src/Websites/Websites/Cmdlets/BackupRestore/RestoreAzureDeletedWebApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private string GetDeletedSiteResourceId()
163163
{
164164
throw new Exception("Deleted app not found");
165165
}
166-
DeletedSite lastDeleted = deletedSites.OrderBy(ds => DateTime.Parse(ds.DeletedTimestamp)).Last();
166+
DeletedSite lastDeleted = deletedSites.OrderBy(ds => DateTime.Parse(ds.DeletedTimestamp, new System.Globalization.CultureInfo("en-US"))).Last();
167167
if (deletedSites.Count() > 1)
168168
{
169169
WriteWarning("Found multiple matching deleted apps. Restoring the most recently deleted app, deleted at " + lastDeleted.DeletedTimestamp);

0 commit comments

Comments
 (0)