You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documention is unclear on how to create an enhanced policy. It seems that - and -- are used. And the azure cli command do not work.
It is unclear how to use az backup policy create in conjunction of -PolicySubType "Enhanced"
Please provide better example and/or update documentation with working samples. Using list to get an online through GUI created policy and pushing it back with create does not work at all.
az backup policy create
--resource-group $backupResourceGroupName
--vault-name $serverrecoveryvault
--name $retentionpolicyname
--backup-management-type AzureIaasVM
--workload-type VM
--policy $customPolicy
list policies of type enhanced
az backup policy list
--resource-group $backupResourceGroupName
--vault-name $serverrecoveryvault
--backup-management-type AzureIaasVM
--workload-type VM
--policy-sub-type Enhanced
@V4A001
It would be great if you could add a link to the documentation you are following for these steps? This would help us redirect the issue to the appropriate team. Thanks!
Documention is unclear on how to create an enhanced policy. It seems that - and -- are used. And the azure cli command do not work.
It is unclear how to use az backup policy create in conjunction of -PolicySubType "Enhanced"
Please provide better example and/or update documentation with working samples. Using list to get an online through GUI created policy and pushing it back with create does not work at all.
My code:
`backupResourceGroupName="RecoveryVaultProd"
serverrecoveryvault="servers-recovery-vault-prod"
retentionpolicyname="servers-retention-policy"
Create vault in separate resource group
az group create --name $backupResourceGroupName --location $location
az backup vault create
--resource-group $backupResourceGroupName
--name $serverrecoveryvault
--location $location
az backup vault backup-properties set
--resource-group $backupResourceGroupName
--name $serverrecoveryvault
--backup-storage-redundancy "GeoRedundant"
customPolicy=$(cat <<EOF
{
"name": "${retentionpolicyname}",
"properties": {
"backupManagementType": "AzureIaasVM",
"instantRpDetails": {
"azureBackupRgNamePrefix": null,
"azureBackupRgNameSuffix": null
},
"instantRpRetentionRangeInDays": 2,
"policyType": "V2",
"protectedItemsCount": 0,
"resourceGuardOperationRequests": null,
"retentionPolicy": {
"dailySchedule": {
"retentionDuration": {
"count": 30,
"durationType": "Days"
},
"retentionTimes": [
"2024-11-07T18:00:00+00:00"
]
},
"monthlySchedule": {
"retentionDuration": {
"count": 12,
"durationType": "Months"
},
"retentionScheduleDaily": null,
"retentionScheduleFormatType": "Weekly",
"retentionScheduleWeekly": {
"daysOfTheWeek": [
"Sunday"
],
"weeksOfTheMonth": [
"First"
]
},
"retentionTimes": [
"2024-11-07T18:00:00+00:00"
]
},
"retentionPolicyType": "LongTermRetentionPolicy",
"weeklySchedule": null,
"yearlySchedule": null
},
"schedulePolicy": {
"dailySchedule": {
"scheduleRunTimes": [
"2024-11-07T18:00:00+00:00"
]
},
"hourlySchedule": null,
"schedulePolicyType": "SimpleSchedulePolicyV2",
"scheduleRunFrequency": "Daily",
"weeklySchedule": null
},
"snapshotConsistencyType": null,
"tieringPolicy": {
"ArchivedRP": {
"duration": 0,
"durationType": "Invalid",
"tieringMode": "DoNotTier"
}
},
"timeZone": "W. Europe Standard Time"
},
"resourceGroup": "${backupResourceGroupName}",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupPolicies"
}
EOF
)
echo $customPolicy
az backup policy create
--resource-group $backupResourceGroupName
--vault-name $serverrecoveryvault
--name $retentionpolicyname
--backup-management-type AzureIaasVM
--workload-type VM
--policy $customPolicy
list policies of type enhanced
az backup policy list
--resource-group $backupResourceGroupName
--vault-name $serverrecoveryvault
--backup-management-type AzureIaasVM
--workload-type VM
--policy-sub-type Enhanced
az backup protection enable-for-vm
--resource-group $printerserverGroupName
--vault-name $serverrecoveryvault
--vm $printservervmName
--policy-name $retentionpolicyname
vmid=$(az vm show -g $printerserverGroupName -n $printservervmName --query id | tr -d '"')
echo $vmid
az backup protection enable-for-vm
--resource-group $backupResourceGroupName
--vault-name $serverrecoveryvault
--vm $vmid
--policy-name "EnhancedPolicy"
--policy-name $retentionpolicyname`
The text was updated successfully, but these errors were encountered: