Skip to content

Bicep / Container App Image field fails on format check #1691

@mcrio

Description

@mcrio

This issue is a: (mark with an x)

  • [ x] bug report -> please search issues before submitting
  • documentation issue or request
  • regression (a behavior that used to work and stopped in a new release)

Issue description

  • Using Bicep to deploy a container app
  • properties::template::containers::image is dynamically constructed using value from myContainerRegistry.properties.loginServer
  • Failure: Container image value is not accepted due to invalid format

I believe during the initial check Bicep does not resolve the properties to a string value so the image input parameter validation fails. This particular check should probably not be part of the initial validation.

loginServer value is used as autoGeneratedDomainNameLabelScope is set for the container registry so the FQDN has a suffix added to the registry name which we do not know before the resource is deployed.

Steps to reproduce

param imageRepositoryName string
param imageTag string

resource containerRegistry 'Microsoft.ContainerRegistry/registries@2026-01-01-preview' existing = {
  name: name
}

resource containerApp 'Microsoft.App/containerApps@2025-10-02-preview' = {
...
properties: {
  template: {
    containers: {
      image: '${containerRegistry.properties.loginServer)/${imageRepositoryName}:${imageTag}'
    }
  }
}
}

Expected behavior
Image value dynamically constructed using container registry property is accepted.

Actual behavior
Fails with formatting error:

Container with name '***' has an invalid image format '[format('{0}/{1}:{2}', reference('/subscriptions/***/resourceGroups/**/providers/Microsoft.ContainerRegistry/registries/***', '2026-01-01-preview').loginServer, '***', '***')]'. Image must match format [registry/]repository[:tag][@digest].

Additional context

Bicep deployment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARM/Biceprelated to arm/bicep deployment challengesbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions