Skip to content
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

Microsoft.RecoveryServices/vaults@2024-04-01: "monitoringSettings parameter is invalid" error #2209

Open
MarcoJanse opened this issue Jun 21, 2024 · 0 comments

Comments

@MarcoJanse
Copy link

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:

monitoringSettings parameter is invalid. Please provide a valid monitoringSettings (Code: InvalidRestApiParameter)

Raw error:

{
  "code": "DeploymentFailed",
  "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
  "details": [
    {
      "code": "InvalidRestApiParameter",
      "message": "monitoringSettings parameter is invalid. Please provide a valid monitoringSettings"
    }
  ]

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:

  • 2024-04-30-preview
  • 2024-04-01
  • 2024-02-01

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:

param location string = resourceGroup().location

param tags object = {
  Environment: 'Test'
}

resource RecoveryServicesVault  'Microsoft.RecoveryServices/vaults@2024-04-01' = {
  name: 'rsv-bicep-tst-001'
  location: location
  tags: tags
  sku: {
    name: 'RS0'
    tier: 'standard'
  }
  properties: {
    securitySettings: {
      softDeleteSettings: {
        softDeleteRetentionPeriodInDays: 14
        softDeleteState: 'Enabled'
        enhancedSecurityState: 'Enabled'
      }
    }
    redundancySettings: {
      standardTierStorageRedundancy: 'LocallyRedundant'
      crossRegionRestore: 'Disabled'
    }
    publicNetworkAccess: 'Enabled'
    restoreSettings: {
      crossSubscriptionRestoreSettings: {
        crossSubscriptionRestoreState: 'Disabled'
      }
    }
  }
}

With monitoring settings

Use the following Bicep template to deploy a Recovery Services Vault with monitoring settings:

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: {
        alertsForAllJobFailures: 'Enabled'
      }
      classicAlertSettings: {
        alertsForCriticalOperations: 'Enabled'
      }
    }
    redundancySettings: {
      standardTierStorageRedundancy: 'LocallyRedundant'
      crossRegionRestore: 'Disabled'
    }
    publicNetworkAccess: 'Enabled'
    restoreSettings: {
      crossSubscriptionRestoreSettings: {
        crossSubscriptionRestoreState: 'Disabled'
      }
    }
  }
}

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.

@stephaniezyen stephaniezyen transferred this issue from Azure/bicep Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant