Search

Please login in for more filter options


Kickstart your project with AVM templates.

app-job

report
Report Package app-job

If you believe that this package or its contents contain harmful information, please inform us.
Please be aware that we will never share your credentials.

Please let us know what this package contains.
Please enter a valid email address.

This Terraform Azure Verified Module deploys: terraform-azurerm-avm-res-app-job

ipm add --package avm-terraform/app-job --version 0.2.0 

Published: 19-07-2025

Project URL: https://ipmhub.io/avm-terraform

Package Type: Terraform

License: MIT


terraform-azurerm-avm-res-app-job

This Terraform module creates and manages Azure Container App Jobs with support for secrets, environment variables, and various trigger configurations.

Features

  • Container App Job Creation: Deploy container applications as jobs in Azure Container Apps
  • Secret Management: Support for both plain text secrets and Azure Key Vault references
  • Flexible Triggers: Manual, scheduled, and event-based trigger configurations
  • Environment Variables: Configure environment variables with support for secret references
  • Managed Identity: Built-in support for system-assigned and user-assigned managed identities
  • Init Containers: Support for initialization containers
  • Volume Mounting: Storage volume mounting capabilities

Secret Support

This module supports two types of secrets:

  1. Plain Text Secrets: Store secret values directly in the configuration
  2. Azure Key Vault Secrets: Reference secrets stored in Azure Key Vault with proper identity configuration

For production workloads, Azure Key Vault secrets are recommended for enhanced security.

Requirements

The following requirements are needed by this module:

Resources

The following resources are used by this module:

Required Inputs

The following input variables are required:

container_app_environment_resource_id

Description: The ID of the Container App Environment to host this Container App.

Type: string

location

Description: The Azure region where this and supporting resources should be deployed.

Type: string

name

Description: The name for this Container App.

Type: string

resource_group_name

Description: (Required) The name of the resource group in which the Container App Environment is to be created. Changing this forces a new resource to be created.

Type: string

template

Description: The template block describes the configuration for the Container App Job.
It defines the main container, optional init containers, resource requirements,
environment variables, probes (liveness, readiness, startup), and volume mounts.
Use this variable to specify the container image, CPU/memory, commands, arguments,
environment variables, and any additional configuration needed for the job's execution environment.

Type:

object({
    max_replicas = optional(number)
    min_replicas = optional(number)
    container = object({
      name    = string
      image   = string
      cpu     = number
      memory  = string
      command = optional(list(string))
      args    = optional(list(string))
      env = optional(list(object({
        name        = string
        secret_name = optional(string)
        value       = optional(string)
      })))
      liveness_probe = optional(list(object({
        port                    = number
        transport               = string
        failure_count_threshold = number
        period                  = number
        header = optional(list(object({
          name  = string
          value = string
        })))
        host             = optional(string)
        initial_delay    = optional(number)
        interval_seconds = optional(number)
        path             = optional(string)
        timeout          = optional(number)
      })))
      readiness_probe = optional(list(object({
        port                    = number
        transport               = string
        failure_count_threshold = number
        header = optional(list(object({
          name  = string
          value = string
        })))
        host                    = optional(string)
        interval_seconds        = optional(number)
        path                    = optional(string)
        success_count_threshold = optional(number)
        timeout                 = optional(number)
      })))
      startup_probe = optional(list(object({
        port                    = number
        transport               = string
        failure_count_threshold = number
        header = optional(list(object({
          name  = string
          value = string
        })))
        host             = optional(string)
        interval_seconds = optional(number)
        path             = optional(string)
        timeout          = optional(number)
      })))
      volume_mounts = optional(list(object({
        name = string
        path = string
      })))
    })
    init_container = optional(list(object({
      name    = string
      image   = string
      cpu     = number
      memory  = string
      command = list(string)
      args    = list(string)
      env = optional(list(object({
        name        = string
        secret_name = optional(string)
        value       = optional(string)
      })))
      volume_mounts = optional(list(object({
        name = string
        path = string
      })))
    })))
    volume = optional(list(object({
      name         = optional(string)
      storage_type = optional(string)
      storage_name = optional(string)
    })))
  })

Optional Inputs

The following input variables are optional (have default values):

enable_telemetry

Description: This variable controls whether or not telemetry is enabled for the module.
For more information see https://aka.ms/avm/telemetryinfo.
If it is set to false, then no telemetry will be collected.

Type: bool

Default: false

managed_identities

Description: Controls the Managed Identity configuration on this resource. The following properties can be specified:

  • system_assigned - (Optional) Specifies if the System Assigned Managed Identity should be enabled.
  • user_assigned_resource_ids - (Optional) Specifies a list of User Assigned Managed Identity resource IDs to be assigned to this resource.

Type:

object({
    system_assigned            = optional(bool, false)
    user_assigned_resource_ids = optional(set(string), [])
  })

Default: {}

registries

Description: A list of container registries used by the Container App Job. Each registry can be defined with:

  • identity - (Optional) The identity to use for accessing the registry. This can either be the Resource ID of a User Assigned Identity, or System for the System Assigned Identity.
  • password_secret_name - (Optional) The name of the secret that contains the registry password.
  • server - (Required) The hostname of the registry server.
  • username - (Optional) The username to use for this registry.

NOTE: identity cannot be used with username and password_secret_name. When using identity, the identity must have access to the container registry.

Type:

list(object({
    identity             = optional(string)
    password_secret_name = optional(string)
    server               = string
    username             = optional(string)
  }))

Default: []

replica_retry_limit

Description: (Optional) The maximum number of retries before considering a Container App Job execution failed.

Type: number

Default: null

replica_timeout_in_seconds

Description: The timeout in seconds for the job to complete.

Type: number

Default: 300

secrets

Description: A list of secrets for the Container App Job. Each secret can be defined with:

  • name - (Required) The secret name.
  • identity - (Optional) The identity to use for accessing the Key Vault secret reference. This can either be the Resource ID of a User Assigned Identity, or System for the System Assigned Identity.
  • key_vault_secret_id - (Optional) The ID of a Key Vault secret. This can be a versioned or version-less ID.
  • value - (Optional) The value for this secret.

NOTE: identity must be used together with key_vault_secret_id. When using key_vault_secret_id, ignore_changes should be used to ignore any changes to value. value will be ignored if key_vault_secret_id and identity are provided.

Type:

list(object({
    name                = string
    identity            = optional(string)
    key_vault_secret_id = optional(string)
    value               = optional(string)
  }))

Default: []

tags

Description: (Optional) A mapping of tags to assign to the Container App Job.

Type: map(string)

Default: null

trigger_config

Description: Configuration for the trigger. Only one of manual_trigger_config, event_trigger_config, or schedule_trigger_config can be specified.

Type:

object({
    manual_trigger_config = optional(object({
      parallelism              = optional(number)
      replica_completion_count = optional(number)
    }))
    event_trigger_config = optional(object({
      parallelism              = optional(number)
      replica_completion_count = optional(number)
      scale = optional(object({
        max_executions              = optional(number)
        min_executions              = optional(number)
        polling_interval_in_seconds = optional(number)
        rules = optional(list(object({
          name             = optional(string)
          custom_rule_type = optional(string)
          metadata         = optional(map(string))
          authentication = optional(object({
            secret_name       = optional(string)
            trigger_parameter = optional(string)
          }))
        })))
      }))
    }))
    schedule_trigger_config = optional(object({
      cron_expression          = optional(string)
      parallelism              = optional(number)
      replica_completion_count = optional(number)
    }))
  })

Default:

{
  "manual_trigger_config": {
    "parallelism": 1,
    "replica_completion_count": 1
  }
}

workload_profile_name

Description: (Optional) The name of the workload profile within the Container App Environment to place this Container App Job.

Type: string

Default: null

Outputs

The following outputs are exported:

container_app_job_name

Description: The name of the Container App Job.

managed_identities

Description: The managed identities for the Container App Job.

resource_id

Description: The ID of the Container App Job.

Modules

No modules.

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

Release History

Version 0.2.0 - 2025-07-18

What's Changed

New Contributors

Full Changelog: https://github.com/Azure/terraform-azurerm-avm-res-app-job/compare/0.1.0...v0.2.0

Version 0.1.0 - 2025-05-20

What's Changed

New Contributors

Full Changelog: https://github.com/Azure/terraform-azurerm-avm-res-app-job/commits/0.1.0

 
 {
  "workingFolder": "packages",
  "packages": [
    // packages defined earlier
    {
      "name": "avm-terraform/app-job",
      "version": "0.2.0"
    }
  ]
}

This package has no dependencies

Stats

Selected version:

0.2.0

Downloads this version:

0

Downloads all versions:

0

Latest version:

0.2.0

Latest update:

19-07-2025

avm-terraform

Other versions (2)