bicep icon indicating copy to clipboard operation
bicep copied to clipboard

ResourceDefinedTypes - Emit warning for type mismatches

Open levimatheri opened this issue 6 months ago • 0 comments

Is your feature request related to a problem? Please describe. When using resource defined types, assigning a mismatched type to a property does not emit a warning. For example:

param container resource<'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2024-05-15'>.properties.resource.indexingPolicy

resource sa 'Microsoft.Storage/storageAccounts@2023-05-01'  = {
  location: resourceGroup().location
  sku: { name: 'Standard_GRS' }
  kind: 'StorageV2'
  name: 'my-sa'
  properties: {
    accessTier: 'Hot'
    azureFilesIdentityBasedAuthentication: container // does not emit warning
  }
}

image

Describe the solution you'd like In the example above, it would be nice if the compiler emitted a warning indicating that the container param type did not match expected AzureFilesIdentityBasedAuthentication.

levimatheri avatar Aug 21 '24 21:08 levimatheri