A simple class containing fields for all metadata associated with a backup configuration.
Beispiel #1
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            var            freq     = BackupRestoreUtils.StringToFrequencyUnit(FrequencyUnit);
            BackupSchedule schedule = new BackupSchedule(
                FrequencyInterval, freq,
                KeepAtLeastOneBackup.IsPresent,
                RetentionPeriodInDays, StartTime);
            BackupRequest request = new BackupRequest()
            {
                Enabled           = true,
                StorageAccountUrl = this.StorageAccountUrl,
                BackupSchedule    = schedule,
                Databases         = this.Databases,
            };

            WebsitesClient.UpdateWebAppBackupConfiguration(ResourceGroupName, Name, Slot, request);
            var config = new AzureWebAppBackupConfiguration()
            {
                Name = this.Name,
                ResourceGroupName     = this.ResourceGroupName,
                StorageAccountUrl     = this.StorageAccountUrl,
                FrequencyInterval     = this.FrequencyInterval,
                FrequencyUnit         = this.FrequencyUnit,
                RetentionPeriodInDays = this.RetentionPeriodInDays,
                StartTime             = this.StartTime,
                KeepAtLeastOneBackup  = this.KeepAtLeastOneBackup.IsPresent,
                Databases             = this.Databases,
                Enabled = true
            };

            WriteObject(config);
        }
 public override void ExecuteCmdlet()
 {
     base.ExecuteCmdlet();
     var freq = BackupRestoreUtils.StringToFrequencyUnit(FrequencyUnit);
     BackupSchedule schedule = new BackupSchedule(freq, FrequencyInterval, KeepAtLeastOneBackup.IsPresent,
         RetentionPeriodInDays, StartTime);
     BackupRequest request = new BackupRequest()
     {
         Location = "",
         Enabled = true,
         StorageAccountUrl = this.StorageAccountUrl,
         BackupSchedule = schedule,
         Databases = this.Databases,
         BackupRequestType = BackupRestoreOperationType.Default
     };
     WebsitesClient.UpdateWebAppBackupConfiguration(ResourceGroupName, Name, Slot, request);
     var config = new AzureWebAppBackupConfiguration()
     {
         Name = this.Name,
         ResourceGroupName = this.ResourceGroupName,
         StorageAccountUrl = this.StorageAccountUrl,
         FrequencyInterval = this.FrequencyInterval,
         FrequencyUnit = this.FrequencyUnit,
         RetentionPeriodInDays = this.RetentionPeriodInDays,
         StartTime = this.StartTime,
         KeepAtLeastOneBackup = this.KeepAtLeastOneBackup.IsPresent,
         Databases = this.Databases,
         Enabled = true
     };
     WriteObject(config);
 }