Open MarcoJanse opened 2 months ago
Hi @MarcoJanse,
I've just been working on this exact same issue and have found a way to get my deployment to work.
When specifying the monitoringSettings section, you must specify values for all 5 of the possible settings. As long as all 5 are present, the deployment succeeds.
This was my working deployment, using your template:
param location string = resourceGroup().location
param tags object = {
Environment: 'Test'
}
resource RecoveryServicesVault 'Microsoft.RecoveryServices/vaults@2024-04-01' = {
name: 'rsv-bicep-tst-002'
location: location
tags: tags
sku: {
name: 'RS0'
tier: 'standard'
}
properties: {
securitySettings: {
softDeleteSettings: {
softDeleteRetentionPeriodInDays: 14
softDeleteState: 'Enabled'
enhancedSecurityState: 'Enabled'
}
}
monitoringSettings: {
azureMonitorAlertSettings: {
alertsForAllReplicationIssues: 'Enabled'
alertsForAllFailoverIssues: 'Enabled'
alertsForAllJobFailures: 'Enabled'
}
classicAlertSettings: {
alertsForCriticalOperations: 'Disabled'
emailNotificationsForSiteRecovery: 'Disabled'
}
redundancySettings: {
standardTierStorageRedundancy: 'LocallyRedundant'
crossRegionRestore: 'Disabled'
}
publicNetworkAccess: 'Enabled'
restoreSettings: {
crossSubscriptionRestoreSettings: {
crossSubscriptionRestoreState: 'Disabled'
}
}
}
}
Hope that helps, and hopefully this information can make its way into the documentation at some point, or preferably make it so that we can specify individual settings as required.
This is exactly the same behaviour with an ARM template as with bicep, so it is not a compilation issue.
Thank you for your providing this solution. Let's hope the documentation will soon be updated to reflect these properties are mandatory in order to successfully deploy.
Bicep version Bicep CLI version 0.28.1 (ba1e9f8c1e)
Describe the bug When trying to deploy a Recovery Services Vault using Bicep and
Microsoft.RecoveryServices/vaults@2024-04-01
, the following error occurs:Raw error:
When using 'Microsoft.RecoveryServices/vaults@2024-01-01', it deploys without error. However, even if specifying monitoringSettings, the deployment still fails.
Using the following API versions all give the same error:
Versions from 2024-01-01 work fine.
To Reproduce Steps to reproduce the behavior:
Without monitoring settings
Use the following Bicep template to deploy a Recovery Services Vault without monitoring settings specified:
With monitoring settings
Use the following Bicep template to deploy a Recovery Services Vault with monitoring settings:
The documentation Microsoft.RecoveryServices vaults | Microsoft Learn does not have the latest API versions. The latest version in de documentation is 2023-01-01. So it's hard to see if I'm doing anything wrong, as the documentation is outdated.