Azure / Azure/bicep-types-az

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

Open
#2,209 2 comments 0 reactions 0 assignees View on GitHub
Needs: Triage :mag:
Dominant language
TypeScript
Stars
108
Forks
44
Avg merge
18h 53m
Merged PRs (30d)
29

Description

**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:

```json
{
"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:

```powershell
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:

```powershell
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](https://learn.microsoft.com/en-us/azure/templates/microsoft.recoveryservices/vaults?pivots=deployment-language-bicep) 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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Microsoft.RecoveryServices/vaults resource definition for API versions 2024-01-01, 2024-02-01, 2024-04-01, and 2024-04-30-preview, then reproduce the two supplied Bicep templates. No repository file or test is named; done means identifying whether the type definition or Azure service rejects monitoringSettings and documenting or correcting the affected definition with coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, typescript
Domain
cloud, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.