Azure / bicep-types-az

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

Error BCP036: The property "gateway" expected a value of type "string" but the provided value is of type "object" #2057

Open eermen opened 9 months ago

eermen commented 9 months ago

Bicep version Since v0.25.3

Describe the bug We're getting the error:

Error BCP036: The property "gateway" expected a value of type "string" but the provided value is of type "object"

For the following resource and other similar resources:

resource resFileshareConnection 'Microsoft.Web/connections@2016-06-01' = {
  name: fileshareConnection.name
  location: general.location
  kind: 'V2'
  properties: {
    displayName: fileshareConnection.name
    customParameterValues: {}
    parameterValues: {
      rootfolder: fileshareConnection.rootfolder
      authType: fileshareConnection.authType
      gateway: {
        name: fileshareConnection.odgw.name
        id: resourceId(fileshareConnection.odgw.resourceGroup, 'Microsoft.Web/connectionGateways', fileshareConnection.odgw.name)
        type: 'Microsoft.Web/connectionGateways'
      }
      username: username
      password: password
    }
    api: {
      id: subscriptionResourceId('Microsoft.Web/locations/managedApis', general.location, 'filesystem')
    }
  }
}

To Reproduce Steps to reproduce the behavior:

Additional context With version v0.24.24 we don't have this error

karrelo commented 8 months ago

i have the same issue

jonashdlw commented 8 months ago

I'm experiencing the same issue

luirpvidal commented 8 months ago

Did anyone managed to resolve this?

eermen commented 8 months ago

Did anyone managed to resolve this?

The workaround for us is to install the version 0.24.24

jonashdlw commented 8 months ago

Is there an estimate when this will be fixed?

luirpvidal commented 8 months ago

I can now confirm that version 0.24.24 works. Thank you.

anthony-c-martin commented 8 months ago

A workaround with the latest version of Bicep is to use the any function:

      gateway: any({
        name: fileshareConnection.odgw.name
        id: resourceId(fileshareConnection.odgw.resourceGroup, 'Microsoft.Web/connectionGateways', fileshareConnection.odgw.name)
        type: 'Microsoft.Web/connectionGateways'
      })
anthony-c-martin commented 8 months ago

The root cause is that the API has been incorrectly defined in swagger by the RP - note that parameterValues has been defined as a dictionary with values of type "string": https://github.com/Azure/azure-rest-api-specs/blob/99686ad45c380cf8fbcf7811db9c984a0e9d6639/specification/web/resource-manager/Microsoft.Web/stable/2016-06-01/logicAppsManagementClient.json#L1877-L1897

microsoft-github-policy-service[bot] commented 8 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-logicapps-team. Please see https://aka.ms/biceptypesinfo for troubleshooting help.