Skip to content

[AppService]: fix #5833 Edit-AzureRmWebAppBackupConfiguration always sets Enabled to True #21221

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

Merged
merged 4 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function Test-EditAndGetWebAppBackupConfiguration
-ResourceGroupName $rgName -Name $wName -StorageAccountUrl $sasUri `
-FrequencyInterval $frequencyInterval -FrequencyUnit $frequencyUnit `
-RetentionPeriodInDays $retentionPeriod -StartTime $startTime `
-KeepAtLeastOneBackup
-KeepAtLeastOneBackup -Enabled

# Assert
Assert-True { $config.Enabled }
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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
* Fixed `Edit-AzWebAppBackupConfiguration` to pass backup configuration enabled or not
* Updated `Get-AzWebApp` and `Get-AzWebAppSlot` to expose `VirtualNetwork Integration Info` [#10665]
* Added a new parameter `-CopyIdentity` for `New-AzWebAppSlot` to copy the identity from the parent app to the slot.
* Updated `New-AzWebAppSSLBinding` to support -WhatIf parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public class EditAzureWebAppBackupConfiguration : WebAppOptionalSlotBaseCmdlet
[Parameter(Position = 9, Mandatory = false, HelpMessage = "True if one backup should always be kept in the storage account, regardless of how old it is.", ValueFromPipelineByPropertyName = true)]
public SwitchParameter KeepAtLeastOneBackup { get; set; }

[Parameter(Position = 10, Mandatory = false, HelpMessage = "To enable backup configuration.", ValueFromPipelineByPropertyName = true)]
public SwitchParameter Enabled { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();
Expand All @@ -59,7 +62,7 @@ public override void ExecuteCmdlet()
RetentionPeriodInDays, StartTime);
BackupRequest request = new BackupRequest()
{
Enabled = true,
Enabled = this.Enabled.IsPresent,
StorageAccountUrl = this.StorageAccountUrl,
BackupSchedule = schedule,
Databases = this.Databases,
Expand All @@ -76,7 +79,7 @@ public override void ExecuteCmdlet()
StartTime = this.StartTime,
KeepAtLeastOneBackup = this.KeepAtLeastOneBackup.IsPresent,
Databases = this.Databases,
Enabled = true
Enabled = this.Enabled.IsPresent
};
WriteObject(config);
}
Expand Down
19 changes: 17 additions & 2 deletions src/Websites/Websites/help/Edit-AzWebAppBackupConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ schema: 2.0.0
### FromResourceName
```
Edit-AzWebAppBackupConfiguration [-FrequencyInterval] <Int32> [-FrequencyUnit] <String>
[-RetentionPeriodInDays] <Int32> [[-StartTime] <DateTime>] [-KeepAtLeastOneBackup]
[-RetentionPeriodInDays] <Int32> [[-StartTime] <DateTime>] [-KeepAtLeastOneBackup] [Enabled]
[-ResourceGroupName] <String> [-Name] <String> [[-Slot] <String>] [-DefaultProfile <IAzureContextContainer>]
[-StorageAccountUrl] <String> [[-Databases] <DatabaseBackupSetting[]>] [<CommonParameters>]
```

### FromWebApp
```
Edit-AzWebAppBackupConfiguration [-FrequencyInterval] <Int32> [-FrequencyUnit] <String>
[-RetentionPeriodInDays] <Int32> [[-StartTime] <DateTime>] [-KeepAtLeastOneBackup] [-WebApp] <PSSite>
[-RetentionPeriodInDays] <Int32> [[-StartTime] <DateTime>] [-KeepAtLeastOneBackup] [Enabled] [-WebApp] <PSSite>
[-DefaultProfile <IAzureContextContainer>] [-StorageAccountUrl] <String>
[[-Databases] <DatabaseBackupSetting[]>] [<CommonParameters>]
```
Expand Down Expand Up @@ -74,6 +74,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Enabled
Keep At Least One Backup Option

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -FrequencyInterval
Frequency Interval

Expand Down