Azure / azure-functions-on-container-apps

Docs , samples and issues for Azure Functions on Azure Container Apps
MIT License
74 stars 18 forks source link

Bicep template needs example how to provide private registry #45

Closed eduards-vavere closed 6 months ago

eduards-vavere commented 9 months ago

In Azure portal can create function app with private registry - works good

But how to define this in bicep?

I tried using the APP_SETTINGS fields (from other github issues), but something did not work (and no documentation). Need proper specification/example

If it's ACR why am I using it as private registry?

Because my app is in DEV subscription, but registry is in PROD subscription, and not possible to link it as ACR across-subscriptions

2024-02-28 13_41_41-maintainer-tasks-dev - Microsoft Azure - Vivaldi

raorugan commented 8 months ago

Sure @eduards-vavere .. will update this and keep this thread posted

eduards-vavere commented 8 months ago

Looks like these sets of env vars seem to do the trick :)


siteConfig: {
      linuxFxVersion: 'DOCKER|myreg.azurecr.io/test-sender:pipeline-2024-02-26_11-44-13'
      appSettings: [

        {
          name: 'DOCKER_REGISTRY_SERVER_URL'
          value: 'myreg.azurecr.io'
        }
        {
          name: 'DOCKER_REGISTRY_SERVER_USERNAME'
          value: 'myreg'
        }
        {
          name: 'DOCKER_REGISTRY_SERVER_PASSWORD'
          value: containerRegistryRef.listCredentials().passwords[0].value
        }
        {
          name: 'DOCKER_CUSTOM_IMAGE_NAME'
          value: 'DOCKER|myreg.azurecr.io/test-sender:pipeline-2024-02-26_11-44-13'
        }
raorugan commented 8 months ago

yes registry_server, registry_username , password and image are needed apart from linuxFxVersion value

raorugan commented 6 months ago

the query has been addressed