How to deploy Helm charts to AKS from an Azure Managed Application and pass parameters dynamically?

Padmanabhan M 220 Reputation points
2026-03-04T13:00:47.6866667+00:00

We previously deployed our application using Azure App Service inside a Managed Application. Now we have migrated the application to run on Azure Kubernetes Service (AKS) instead.

We have converted our existing Kubernetes YAML manifests into a Helm chart so that the application can be deployed to AKS using Helm.

Now we would like to understand the following:

How can we integrate or connect AKS with the Helm chart deployment when deploying through an Azure Managed Application?

What is the recommended approach to pass configuration values dynamically (such as environment variables, database connection strings, image tags, etc.) from the ARM template or Managed Application parameters into the Helm chart during deployment?

Are there best practices for managing these dynamic values when the Helm deployment is triggered from an ARM template or deployment script?

Any guidance or documentation references on implementing this architecture would be very helpful.

Azure Kubernetes Service
Azure Kubernetes Service

An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.


1 answer

Sort by: Oldest
  1. AI answer

    2026-03-04T13:01:07.66+00:00

    Helm deployment to AKS from an Azure Managed Application is done the same way as from any ARM/Bicep deployment: the Managed Application’s ARM template provisions AKS and then invokes Helm (or uses an existing Helm chart) with values supplied from template parameters.

    A practical approach, based on the patterns in the context, is:

    1. Package the application as a Helm chart
      • Create the chart with helm create and customize it for the application:
        • Define environment variables, connection strings, and other settings in values.yaml and reference them in templates/deployment.yaml via .Values (as shown in the App Configuration + Helm example):
                 # values.yaml
                 settings:
                   color: red
                   message: myMessage
          
                 # templates/deployment.yaml (snippet)
                 env:
                 - name: Color
                   value: {{ .Values.settings.color }}
                 - name: Message
                   value: {{ .Values.settings.message }}
          
        • For secrets, define a Secret template that reads from values and base64‑encodes them:
                 # templates/secrets.yaml
                 apiVersion: v1
                 kind: Secret
                 metadata:
                   name: mysecret
                 type: Opaque
                 data:
                   password: {{ .Values.secrets.password | b64enc }}
          
    2. Model dynamic values in the Helm chart
      Typical dynamic values:
      • Image repository and tag
      • Service type (ClusterIP/NodePort/LoadBalancer)
      • Environment variables and connection strings
      • Secrets
      Examples from the context:
      • Image and service type in values.yaml:
             image:
               repository: acr.azurecr.io/mymicroservice
               pullPolicy: IfNotPresent
             service:
               type: NodePort
               port: 80
        
      • Image tag passed at install/upgrade time:
             helm upgrade --install mymicroserviceapp . \
               --namespace=local \
               --set mymicroserviceapp.image.tag="0.1.0"
        
      • Environment variables wired to values (Redis backend name example):
             env:
               - name: REDIS
                 value: {{ .Values.backendName }}
        
    3. Invoke Helm with dynamic values from deployment
      From the deployment side (Managed Application/ARM), the pattern is:
      • Ensure AKS and ACR are provisioned and integrated, as described in the AKS + Helm guidance.
      • Use a deployment script or automation step that:
        • Receives ARM/Managed Application parameters (image tag, connection strings, etc.).
        • Calls helm install/helm upgrade with --set or --values to override defaults in values.yaml:
                 helm upgrade --install myrelease ./mychart \
                   --namespace my-namespace \
                   --set image.repository=${acrLoginServer}/myimage \
                   --set image.tag=${imageTag} \
                   --set settings.color=${color} \
                   --set settings.message=${message} \
                   --set secrets.password=${dbPassword}
          
      • This is the same mechanism used in the AKS Helm examples where image tags and other settings are overridden at deployment time.
    4. Use “Use existing Helm chart” in automated deployments where applicable
      The automated deployments guidance shows a pattern that is directly applicable:
      • Choose Use existing Helm chart.
      • Provide:
        • Charts path
        • values.yaml path
        • Optional Helm chart overrides
      • Those overrides are the dynamic values coming from deployment configuration (similar to ARM parameters) and are applied as Helm value overrides at deployment time.
    5. Best practices for managing dynamic values
      • Keep defaults in values.yaml, override only what is environment‑specific (image tags, connection strings, feature flags). This keeps the chart reusable across environments.
      • Use Secrets for sensitive data and map them from values as shown in the secrets.yaml example. Ensure the actual secret values are injected from deployment parameters and not hard‑coded in the chart.
      • Use a consistent naming scheme for values so ARM/Managed Application parameters map cleanly to .Values (for example, settings.*, secrets.*, image.*).
      • Use helm upgrade --install so the same deployment path handles both initial install and updates, as shown in the AKS Helm deployment example.
      • Integrate with Azure App Configuration if central configuration management is needed: the App Configuration + Helm sample shows using Helm values as defaults and letting the Azure App Configuration Kubernetes Provider overwrite them via ConfigMaps.
    6. Connecting AKS and Helm from a Managed Application
      • The Managed Application’s ARM template provisions:
        • AKS cluster (with integrated ACR if needed).
        • Any supporting resources (App Configuration, Key Vault, databases).
      • A deployment script or automation step (triggered as part of the Managed Application deployment) then:
        • Uses az aks get-credentials to connect to the AKS cluster.
        • Runs helm repo add/helm repo update if using remote charts, or points to the packaged chart.
        • Executes helm install/helm upgrade with values derived from ARM/Managed Application parameters.
      • This matches the documented pattern of using Helm as the primary deployment mechanism for AKS workloads, with configuration injected at deployment time.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.