public override void ExecuteCmdlet() { base.ExecuteCmdlet(); RestoreRequest request = new RestoreRequest() { Location = "", StorageAccountUrl = this.StorageAccountUrl, BlobName = this.BlobName, SiteName = CmdletHelpers.GenerateSiteWithSlotName(Name, Slot), Overwrite = this.Overwrite.IsPresent, IgnoreConflictingHostNames = this.IgnoreConflictingHostNames.IsPresent, Databases = this.Databases, OperationType = BackupRestoreOperationType.Default }; // The id here does not actually matter. It is an artifact of the CSM API requirements. It should be possible // to restore from a backup that is no longer stored in our Backups table. WebsitesClient.RestoreSite(ResourceGroupName, Name, Slot, "1", request); }
public override void ExecuteCmdlet() { base.ExecuteCmdlet(); if (string.IsNullOrEmpty(AppServicePlan)) { Site app = WebsitesClient.GetWebApp(ResourceGroupName, Name, Slot); this.AppServicePlan = app.ServerFarmId.Split('/').Last(); } RestoreRequest request = new RestoreRequest() { StorageAccountUrl = this.StorageAccountUrl, BlobName = this.BlobName, SiteName = CmdletHelpers.GenerateSiteWithSlotName(Name, Slot), Overwrite = this.Overwrite.IsPresent, AppServicePlan = this.AppServicePlan, IgnoreConflictingHostNames = this.IgnoreConflictingHostNames.IsPresent, Databases = this.Databases, OperationType = BackupRestoreOperationType.Default }; // The id here does not actually matter. It is an artifact of the CSM API requirements. It should be possible // to restore from a backup that is no longer stored in our Backups table. WebsitesClient.RestoreSite(ResourceGroupName, Name, Slot, "1", request); }