Azure / bicep-types-az

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

APIM Backend type Pool - mandatory field protocol is not supported #2047

Closed tcyran closed 8 months ago

tcyran commented 8 months ago

Bicep version Bicep CLI version 0.25.3 (862708594a)

Describe the bug I'm trying to create a backend type Pool in APIM. I'm using simple guide from here

Once I'm trying to deploy it I'm getting error:

az deployment group create --name demoRGDeployment --resource-group GPT --template-file backends.bicep                                   

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/eba19cb8-af90-44c2-ac0b-f0a65149efa4/resourceGroups/GPT/providers/Microsoft.Resources/deployments/demoRGDeployment","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"protocol","message":"Protocol is not supported"}]}]}}

and once I comment out protocol line I'm getting error that protocol is mandatory:

az deployment group create --name demoRGDeployment --resource-group GPT --template-file backends.bicep                                        Warning BCP035: The specified "object" declaration is missing the following required properties: "protocol". If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues]

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/eba19cb8-af90-44c2-ac0b-f0a65149efa4/resourceGroups/GPT/providers/Microsoft.Resources/deployments/demoRGDeployment","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"protocol","message":"'protocol' should not be empty."}]}]}}

To Reproduce

Definition of object:

resource symbolicname 'Microsoft.ApiManagement/service/backends@2023-05-01-preview' = {
  name: 'hyp-test-openapi/myBackendPool'
  properties: {
    description: 'Load balancer for multiple backends'
    type: 'Pool'
    protocol: 'https'
    url: 'https://example.com'
    pool: {
      services: [
        {
          id: '/backends/hyptest'
        }
        {
          id: '/backends/westus'
        }
      ]
    }
  }
}
hgjura commented 5 months ago

I am getting the same error. It seems like a bug. If bicep value of protocol is 'https' it fails with this error, if it is 'http' it passes.