コード例 #1
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            var backup = WebsitesClient.DeleteBackup(ResourceGroupName, Name, Slot, BackupId);

            WriteObject(BackupRestoreUtils.BackupItemToAppBackup(backup, ResourceGroupName, Name, Slot));
        }
コード例 #2
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 configuration = WebsitesClient.GetWebAppBackupConfiguration(ResourceGroupName, Name, Slot);

            WriteObject(BackupRestoreUtils.BackupRequestToAppBackupConfiguration(configuration, ResourceGroupName, Name, Slot));
        }
コード例 #4
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            var list = WebsitesClient.ListSiteBackups(ResourceGroupName, Name, Slot);

            AzureWebAppBackup[] backups = new AzureWebAppBackup[list.Count()];
            for (int i = 0; i < backups.Length; i++)
            {
                backups[i] = BackupRestoreUtils.BackupItemToAppBackup(list.ElementAt(i), ResourceGroupName, Name, Slot);
            }
            WriteObject(backups, true);
        }
コード例 #5
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            BackupRequest request = new BackupRequest()
            {
                StorageAccountUrl = this.StorageAccountUrl,
                BackupName        = this.BackupName,
                Databases         = this.Databases
            };
            var backup = WebsitesClient.BackupSite(ResourceGroupName, Name, Slot, request);

            WriteObject(BackupRestoreUtils.BackupItemToAppBackup(backup, ResourceGroupName, Name, Slot));
        }
コード例 #6
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            BackupRequest request = new BackupRequest()
            {
                // Location is required by Resource (base class of BackupRequest)
                // to not be null, but is not actually significant for the request.
                Location          = "",
                StorageAccountUrl = this.StorageAccountUrl,
                BackupRequestName = this.BackupName,
                Databases         = this.Databases
            };
            var backup = WebsitesClient.BackupSite(ResourceGroupName, Name, Slot, request);

            WriteObject(BackupRestoreUtils.BackupItemToAppBackup(backup, ResourceGroupName, Name, Slot));
        }