Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
86 stars 27 forks source link

Bicep resource schema doesn't match documentation (or its own example) #2272

Open WhitWaldo opened 2 months ago

WhitWaldo commented 2 months ago

Bicep version Bicep CLI version 0.29.47 (132ade51bc)

Describe the bug I'm typing out a Bicep file in Visual Studio Code and the schema it's using for a resource doesn't match the ARM documentation. Looking at the property for an Azure Container App: properties.template.containers[].resources.cpu, the field expects a JSON object providing a decimal value (e.g. 0.25) as a string.

Rather, in VS Code, it's indicating this should be an integer even though the example it gives isn't even an integer.

image

To Reproduce Hammer out a brief resource definition in a Bicep file. Here's one to get you started that demonstrates the issue:

resource MyContainerApp 'Microsoft.App/containerApps@2024-03-01' = {
  name: 'MyApp'
  location: resourceGroup().location
  properties: {
    template: {
      containers: [
        {
          resources: {
            cpu: 0.25
          }
        }
      ]
    }
  }
}

Additional context I think that about covers it.

WhitWaldo commented 2 months ago

Despite the type shown in the Intellisense, if I just put a value of json('0.25'), it does accept it and removes the squiggly. But whatever is initially thinking this should be an int should be corrected as it's not right.

stephaniezyen commented 1 month ago

This is a types issue with Microsoft.App RP unfortunately. I would open up a support ticket with that team to get this fixed.