Azure / bicep-types-az

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

Incorrect schema for Microsoft.Web/hostingEnvironments api-version 2022-03-01 #1350

Open smichtch opened 2 years ago

smichtch commented 2 years ago

Bicep version VS Code Bicep Extension: v0.9.1 Bicep PowerShell module: 2.3.1
Build-Bicep prints version: 0.9.1.41621

Describe the bug Microsoft.Web/hostingEnvironments@2022-03-01 has incorrect schema for properties.networkingConfiguration (AseV3NetworkingConfiguration type).

resource webHostEnv 'Microsoft.Web/hostingEnvironments@2022-03-01' existing = {
  name: 'foo'
}

// Bicep compiler is happy but fails at runtime. Note the second "properties" level.
output badReference array = webHostEnv.properties.networkingConfiguration.properties.internalInboundIpAddresses

// Generates warning BCP053: The type "AseV3NetworkingConfiguration" does not contain property "internalInboundIpAddresses".
// But works at runtime.
output goodReference array = webHostEnv.properties.networkingConfiguration.internalInboundIpAddresses

To Reproduce See bug description above.

Additional context The schema published here doesn't look right either: https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2022-03-01/hostingenvironments?pivots=deployment-language-bicep#asev3networkingconfiguration Bicep's view doesn't seem to quite match what's published on the page either - e.g. Bicep knows about internalInboundIpAddresses which is not mentioned anywhere on that page.

If you "View JSON" on an ASE in Azure Portal it looks like this (note absence of properties under networkingConfiguration):

{
    "id": "...",
    "name": "foo",
    "type": "Microsoft.Web/hostingEnvironments",
    "kind": "ASEV3",
    "location": "West US 3",
    ...
    "properties": {
        "networkingConfiguration": {
            "windowsOutboundIpAddresses": [...],
            "linuxOutboundIpAddresses": [...],
            "externalInboundIpAddresses": [],
            "internalInboundIpAddresses": [...],
            "allowNewPrivateEndpointConnections": true,
            "ftpEnabled": false,
            "remoteDebugEnabled": false,
            "numberOfOutboundIpAddresses": 2,
            "inboundIpAddressOverride": null,
            "targetNumberOfOutboundIpAddresses": 0
        },
        ...
    }
}
matferrari-msft commented 1 year ago

@alex-frankel Is there any update on this? Thanks!

alex-frankel commented 1 year ago

No update - this will be on the resource provider to correct their swagger. Tagging @naveedaz / @seligj95 to triage.

seligj95 commented 1 year ago

Acknowledeing and taking to engineering for further investigation

sjwaight commented 1 year ago

Just came here to +1 this. Also, if you're looking to suppress a linter warning here's what to put on the line before you get the warning.

#disable-next-line BCP053 // https://github.com/Azure/bicep-types-az/issues/1350