| title | BCP029 |
|---|---|
| description | The resource type isn't valid. Specify a valid resource type of format <types>@<apiVersion>. |
| ms.topic | reference |
| ms.custom | devx-track-bicep |
| ms.date | 09/17/2025 |
This diagnostic occurs when you specify an invalid format of a resource type.
The resource type isn't valid. Specify a valid resource type of format <types>@<apiVersion>.
Error
Use the valid format of resource type.
The following example raises the diagnostic because the Microsoft.Storage/storageAccounts resource type requires an API version:
param location string = resourceGroup().location
resource storage 'Microsoft.Storage/storageAccounts' = {
name: 'mystorageacct'
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
}You can fix the diagnostic by providing an API version:
param location string = resourceGroup().location
resource storage 'Microsoft.Storage/storageAccounts@2025-01-01' = {
name: 'mystorageacct'
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
}For more information about Bicep diagnostics, see Bicep core diagnostics.