About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
powershell_heavy
⚠️
windows_first
⚠️
missing_linux_example
Summary:
The documentation page demonstrates a Windows bias by providing only PowerShell deployment instructions and examples, with no equivalent Azure CLI or Bash examples for Linux/macOS users. The prerequisites specifically mention installing the Azure PowerShell module, and the deployment workflow is described exclusively in terms of PowerShell commands. Azure CLI and Bash are only mentioned in passing in the 'Next steps' section, not in the main deployment flow.
Recommendations:
- Add Azure CLI and Bash examples for deploying the Bicep/ARM template, alongside the PowerShell example.
- In the prerequisites, mention both Azure PowerShell and Azure CLI as options for users, with installation links for each.
- Present deployment instructions for both Windows (PowerShell) and Linux/macOS (Bash/CLI), or use a tabbed interface to allow users to select their preferred environment.
- Ensure that all steps, including tracking and restoring backups, have parity between PowerShell and CLI/Bash instructions.
- Avoid assuming the use of PowerShell or Windows-specific workflows as the default; instead, provide cross-platform guidance.
Create pull request
Flagged Code Snippets
@description('Name of the existing Resource Group in which the existing Storage Account is present.')
param existingResourceGroupName string = resourceGroup().name
@description('Name of the existing Storage Account in which the existing File Share to be protected is present.')
param existingStorageAccountName string
@description('Name of the existing File Share to be protected.')
param existingFileShareName string
@description('Location of the existing Storage Account containing the existing File Share to be protected. New Recovery Services Vault will be created in this location. (Ignore if using existing Recovery Services Vault).')
param location string = resourceGroup().location
@description('Set to true if a new Recovery Services Vault is to be created; set to false otherwise.')
param isNewVault bool = true
@description('Set to true if a new Backup Policy is to be created for the Recovery Services Vault; set to false otherwise.')
param isNewPolicy bool = true
@description('Set to true if the existing Storage Account has to be registered to the Recovery Services Vault; set to false otherwise.')
param registerStorageAccount bool = true
@description('Name of the Recovery Services Vault. (Should have the same location as the Storage Account containing the File Share to be protected in case of an existing Recovery Services Vault).')
param vaultName string = 'RSVault-${substring(uniqueString(resourceGroup().id), 6)}'
@description('Name of the Backup Policy.')
param policyName string = 'HourlyBackupPolicy'
@description('Time of day when backup should be triggered in 24 hour HH:MM format, where MM must be 00 or 30. (Ignore if using existing Backup Policy).')
param scheduleRunTime string = '05:30'
@description('Any valid timezone, for example: UTC, Pacific Standard Time. Refer: https://msdn.microsoft.com/en-us/library/gg154758.aspx (Ignore if using existing Backup Policy).')
param timeZone string = 'UTC'
@description('Number of days for which the daily backup is to be retained. (Ignore if using existing Backup Policy).')
param dailyRetentionDurationCount int = 5
@description('Array of days on which backup is to be performed for Weekly Retention. (Ignore if using existing Backup Policy).')
param daysOfTheWeek array = [
'Sunday'
'Tuesday'
'Thursday'
]
@description('Number of weeks for which the weekly backup is to be retained. (Ignore if using existing Backup Policy).')
param weeklyRetentionDurationCount int = 12
@description('Number of months for which the monthly backup is to be retained. Backup will be performed on the 1st day of every month. (Ignore if using existing Backup Policy).')
param monthlyRetentionDurationCount int = 60
@description('Array of months on which backup is to be performed for Yearly Retention. Backup will be performed on the 1st day of each month of year provided. (Ignore if using existing Backup Policy).')
param monthsOfYear array = [
'January'
'May'
'September'
]
@description('Number of years for which the yearly backup is to be retained. (Ignore if using existing Backup Policy).')
param yearlyRetentionDurationCount int = 10
@description('Hourly Schedule window start time')
param scheduleWindowStartTime string = '${substring(utcNow('2020-01-01T{0}:00Z'), 0, 11)}08:00:00.000Z'
@description('Hourly backup frequency (Ignore if using existing Backup Policy).')
param backupFrequency int = 4
var backupFabric = 'Azure'
var backupManagementType = 'AzureStorage'
var scheduleRunTimes = [
'2020-01-01T${scheduleRunTime}:00Z'
]
resource vault 'Microsoft.RecoveryServices/vaults@2021-12-01' = if (isNewVault) {
name: vaultName
location: location
sku: {
name: 'RS0'
tier: 'Standard'
}
properties: {
}
}
resource backupPolicy 'Microsoft.RecoveryServices/vaults/backupPolicies@2022-02-01' = if (isNewPolicy) {
parent: vault
name: policyName
properties: {
backupManagementType: backupManagementType
schedulePolicy: {
schedulePolicyType: 'SimpleSchedulePolicy'
scheduleRunFrequency: 'Hourly'
scheduleRunTimes: scheduleRunTimes
hourlySchedule: {
interval: backupFrequency
scheduleWindowStartTime: scheduleWindowStartTime
scheduleWindowDuration: 12
}
}
retentionPolicy: {
dailySchedule: {
retentionTimes: scheduleRunTimes
retentionDuration: {
count: dailyRetentionDurationCount
durationType: 'Days'
}
}
weeklySchedule: {
daysOfTheWeek: daysOfTheWeek
retentionTimes: scheduleRunTimes
retentionDuration: {
count: weeklyRetentionDurationCount
durationType: 'Weeks'
}
}
monthlySchedule: {
retentionScheduleFormatType: 'Daily'
retentionScheduleDaily: {
daysOfTheMonth: [
{
date: 1
isLast: false
}
]
}
retentionTimes: scheduleRunTimes
retentionDuration: {
count: monthlyRetentionDurationCount
durationType: 'Months'
}
}
yearlySchedule: {
retentionScheduleFormatType: 'Daily'
monthsOfYear: monthsOfYear
retentionScheduleDaily: {
daysOfTheMonth: [
{
date: 1
isLast: false
}
]
}
retentionTimes: scheduleRunTimes
retentionDuration: {
count: yearlyRetentionDurationCount
durationType: 'Years'
}
}
retentionPolicyType: 'LongTermRetentionPolicy'
}
timeZone: timeZone
workLoadType: 'AzureFileShare'
}
}
resource protectionContainer 'Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers@2021-12-01' = if (registerStorageAccount) {
name: '${vaultName}/${backupFabric}/storagecontainer;Storage;${existingResourceGroupName};${existingStorageAccountName}'
dependsOn: [
vault
backupPolicy
]
properties: {
backupManagementType: backupManagementType
containerType: 'StorageContainer'
sourceResourceId: resourceId(existingResourceGroupName, 'Microsoft.Storage/storageAccounts', existingStorageAccountName)
}
}
resource protectedItem 'Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems@2021-12-01'={
name:'${split('${vaultName}/${backupFabric}/storagecontainer;Storage;${existingResourceGroupName};${existingStorageAccountName}', '/')[0]}/${split('${vaultName}/${backupFabric}/storagecontainer;Storage;${existingResourceGroupName};${existingStorageAccountName}', '/')[1]}/${split('${vaultName}/${backupFabric}/storagecontainer;Storage;${existingResourceGroupName};${existingStorageAccountName}', '/')[2]}/AzureFileShare;${existingFileShareName}'
dependsOn:[
vault
]
properties:{
protectedItemType:'AzureFileShareProtectedItem'
sourceResourceId:resourceId(existingResourceGroupName, 'Microsoft.Storage/storageAccounts', existingStorageAccountName)
policyId:backupPolicy.id
}
}