bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Unable to read properties from referenced, existing API Management Service API

Open tobylo opened this issue 3 years ago • 0 comments

Bicep version 0.4.1008 (223b8d227a)

Describe the bug Unable to read properties of a referenced, existing API Management Service API, getting validation error that:

The property "properties" on type "Microsoft.ApiManagement/service/apis" is write-only. Write-only properties cannot be accessed.bicep(BCP077)

Properties here is of type ApiCreateOrUpdateProperties.

To Reproduce Bicep that shows the error:

param apimServiceName string
param resourceGroupName string
param apiName string

resource apimService 'Microsoft.ApiManagement/service@2021-08-01' existing = {
  name: apimServiceName
  scope: resourceGroup(resourceGroupName)

  resource someApi 'apis' existing = {
    name: apiName
  }
}

var appServiceValue = '${apimService.properties.gatewayUrl}/${apimService::someApi.properties.path}'

tobylo avatar Sep 29 '22 11:09 tobylo