Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Az.WebSites] Remove parsing for SnapshotTime #23236

Closed
Show file tree
Hide file tree
Changes from all 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
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
* Removed snapshot time parsing to avoid trimming the timestamp.
* Adjusted `Publish-AzWebApp` default behavior

## Version 3.1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public class AzureWebAppSnapshot
/// <summary>
/// The time that the snapshot was taken
/// </summary>
public DateTime SnapshotTime { get; set; }
public string SnapshotTime { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ public class GetAzureWebAppSnapshot : WebAppOptionalSlotBaseCmdlet
public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();
var list = WebsitesClient.GetSiteSnapshots(ResourceGroupName, Name, Slot, UseDisasterRecovery.IsPresent).Select(s => {
var list = WebsitesClient.GetSiteSnapshots(ResourceGroupName, Name, Slot, UseDisasterRecovery.IsPresent).Select(s =>
{
return new AzureWebAppSnapshot()
{
ResourceGroupName = this.ResourceGroupName,
Name = this.Name,
Slot = string.IsNullOrEmpty(this.Slot) ? "Production" : this.Slot,
SnapshotTime = DateTime.Parse(s.Time, CultureInfo.InvariantCulture)
SnapshotTime = s.Time
};
}).OrderByDescending(s => s.SnapshotTime).ToArray();
WriteObject(list, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public override void ExecuteCmdlet()
SnapshotRestoreRequest recoveryReq = new SnapshotRestoreRequest()
{
Overwrite = true,
SnapshotTime = this.InputObject.SnapshotTime.ToString("o"),
SnapshotTime = this.InputObject.SnapshotTime,
RecoverConfiguration = this.RecoverConfiguration,
IgnoreConflictingHostNames = true,
RecoverySource = source,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"Module","ClassName","Target","Severity","ProblemId","Description","Remediation"
"Az.Websites","Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.GetAzureWebAppSnapshot","Get-AzWebAppSnapshot","0","3000","The type of property 'SnapshotTime' of type 'Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.AzureWebAppSnapshot' has changed from 'System.DateTime' to 'System.String'.","Change the type of property 'SnapshotTime' back to 'System.DateTime'."
"Az.Websites","Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.RestoreAzureWebAppSnapshot","Restore-AzWebAppSnapshot","0","3000","The type of property 'SnapshotTime' of type 'Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.AzureWebAppSnapshot' has changed from 'System.DateTime' to 'System.String'.","Change the type of property 'SnapshotTime' back to 'System.DateTime'."