Skip to content

azurerm_container_app_job add InitialDelaySeconds for readiness and startup probes#31796

Merged
mstroob merged 2 commits intomainfrom
mstroob/azurerm_container_app_job-initial-delaay-fix
Feb 23, 2026
Merged

azurerm_container_app_job add InitialDelaySeconds for readiness and startup probes#31796
mstroob merged 2 commits intomainfrom
mstroob/azurerm_container_app_job-initial-delaay-fix

Conversation

@mstroob
Copy link
Contributor

@mstroob mstroob commented Feb 21, 2026

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

InitialDelaySeconds was not being set for readiness and startup probes so it would alwasy be set as 0 in azure (the default)

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Config:

resource "azurerm_container_app_job" "test" {
  name                         = "acctest-cajob20260220"
  resource_group_name          = azurerm_resource_group.test.name
  location                     = azurerm_resource_group.test.location
  container_app_environment_id = azurerm_container_app_environment.test.id

  replica_timeout_in_seconds = 10
  replica_retry_limit        = 10
  manual_trigger_config {
    parallelism              = 4
    replica_completion_count = 1
  }

   template {
    container {
      name   = "example"
      image  = "nginx:latest"
      cpu    = 0.5
      memory = "1Gi"

      startup_probe {
        transport               = "TCP"
        port                    = 8080
        initial_delay           = 30 
        timeout                 = 5
        failure_count_threshold = 10
      }

      readiness_probe {
        transport               = "TCP"
        port                    = 8080
        initial_delay           = 30 
        timeout                 = 5
        failure_count_threshold = 3
      }
    }
  }
}

new terraform output:
image

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_resource - support for the thing1 property [GH-00000]

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #31739

AI Assistance Disclosure

  • AI Assisted - This contribution was made by, or with the assistance of, AI/LLMs

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the provider.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@mstroob
Copy link
Contributor Author

mstroob commented Feb 21, 2026

Team City Test Results:

PR Number: 31796
Build Number: 616437

All Tests
Status Test Name Duration
------------ ------------ ------------
❌ FAIL TestAccContainerAppJob_withIdentityUpdate
------- Stdout: ------- === RUN TestAccContainerAppJob_withIdentityUpdate === PAUSE TestAccContainerAppJob_withIdentityUpdate === CONT TestAccContainerAppJob_withIdentityUpdate testcase.go:192: Step 1/9 error: Error running apply: exit status 1
    Error: creating Job (Subscription: "*******"
    Resource Group Name: "acctest-CAJob260221012423851980"
    Job Name: "acctest-cajob260221012423851980"): performing CreateOrUpdate: unexpected status 409 (409 Conflict) with error: ContainerAppsJobOperationInProgress: Cannot modify a container apps job 'acctest-cajob260221012423851980' because there is an active provisioning operation in progress. OperationId: '887af948-c5c7-4dcf-9684-48a1a6ca2f52'.
    
      with azurerm_container_app_job.test,
      on terraform_plugin_test.tf line 57, in resource "azurerm_container_app_job" "test":
      57: resource "azurerm_container_app_job" "test" {
    
    creating Job (Subscription: "*******"
    Resource Group Name: "acctest-CAJob260221012423851980"
    Job Name: "acctest-cajob260221012423851980"): performing CreateOrUpdate:
    unexpected status 409 (409 Conflict) with error:
    ContainerAppsJobOperationInProgress: Cannot modify a container apps job
    'acctest-cajob260221012423851980' because there is an active provisioning
    operation in progress. OperationId: '887af948-c5c7-4dcf-9684-48a1a6ca2f52'.
panic.go:615: Error running post-test destroy, there may be dangling resources: exit status 1
    
    Error: deleting Managed Environment (Subscription: "*******"
    Resource Group Name: "acctest-CAJob260221012423851980"
    Managed Environment Name: "acctest-CAEnv260221012423851980"): performing Delete: unexpected status 409 (409 Conflict) with error: ManagedEnvironmentHasContainerAppsJobs: The specified environment acctest-CAEnv260221012423851980 cannot be deleted because it still contains 1 Container Apps Jobs.
    
    deleting Managed Environment (Subscription:
    "*******"
    Resource Group Name: "acctest-CAJob260221012423851980"
    Managed Environment Name: "acctest-CAEnv260221012423851980"): performing
    Delete: unexpected status 409 (409 Conflict) with error:
    ManagedEnvironmentHasContainerAppsJobs: The specified environment
    acctest-CAEnv260221012423851980 cannot be deleted because it still contains 1
    Container Apps Jobs.

--- FAIL: TestAccContainerAppJob_withIdentityUpdate (242.84s)
FAIL

242.84s
✅ PASS TestAccContainerAppJob_basic 580.68s
✅ PASS TestAccContainerAppJob_withUserAssignedIdentity 591.14s
✅ PASS TestAccContainerAppJob_manualTrigger 592.62s
✅ PASS TestAccContainerAppJob_withSystemAssignedIdentity 598.23s
✅ PASS TestAccContainerAppJob_withSystemAndUserAssignedIdentity 639.46s
✅ PASS TestAccContainerAppJob_eventTrigger 642.60s
✅ PASS TestAccContainerAppJob_scheduleTrigger 646.16s
✅ PASS TestAccContainerAppJob_allProbes 653.77s
✅ PASS TestAccContainerAppJob_complete 569.15s
✅ PASS TestAccContainerAppJob_completeUpdate 626.64s
❌ FAIL TestAccContainerAppJob_withWorkloadProfile
------- Stdout: ------- === RUN TestAccContainerAppJob_withWorkloadProfile === PAUSE TestAccContainerAppJob_withWorkloadProfile === CONT TestAccContainerAppJob_withWorkloadProfile testcase.go:192: Step 1/3 error: After applying this test step, the refresh plan was not empty. stdout
    Note: Objects have changed outside of Terraform
    
    Terraform detected the following changes made outside of Terraform since the
    last "terraform apply" which may have affected this plan:
    
      # azurerm_container_app_environment.test has changed
      ~ resource "azurerm_container_app_environment" "test" {
            id                                          = "/subscriptions/*******/resourceGroups/acctestRG-CAE-260221012423866197/providers/Microsoft.App/managedEnvironments/acctest-CAEnv260221012423866197"
            name                                        = "acctest-CAEnv260221012423866197"
            tags                                        = {
                "Foo"    = "Bar"
                "secret" = "sauce"
            }
            # (17 unchanged attributes hidden)
    
          + workload_profile {
              + maximum_count         = 0
              + minimum_count         = 0
              + name                  = "Consumption"
              + workload_profile_type = "Consumption"
            }
    
            # (1 unchanged block hidden)
        }
    
    
    Unless you have made equivalent changes to your configuration, or ignored the
    relevant attributes using ignore_changes, the following plan may include
    actions to undo or respond to these changes.
    
    ─────────────────────────────────────────────────────────────────────────────
    
    Terraform used the selected providers to generate the following execution
    plan. Resource actions are indicated with the following symbols:
      ~ update in-place
    
    Terraform will perform the following actions:
    
      # azurerm_container_app_job.test will be updated in-place
      ~ resource "azurerm_container_app_job" "test" {
            id                           = "/subscriptions/*******/resourceGroups/acctestRG-CAE-260221012423866197/providers/Microsoft.App/jobs/acctest-cajob260221012423866197"
            name                         = "acctest-cajob260221012423866197"
            tags                         = {}
          ~ workload_profile_name        = "D4-01" -> "Consumption"
            # (7 unchanged attributes hidden)
    
            # (2 unchanged blocks hidden)
        }
    
    Plan: 0 to add, 1 to change, 0 to destroy.

--- FAIL: TestAccContainerAppJob_withWorkloadProfile (1504.24s)
FAIL

1504.24s
✅ PASS TestAccContainerAppJob_withKeyVaultSecret 928.12s
✅ PASS TestAccContainerAppJob_withKeyVaultSecretVersioningUpdate 983.34s
✅ PASS TestAccContainerAppJob_withKeyVaultSecretIdentityUpdate 1061.50s

Total Passed: 13
Total Failed: 2
Total Tests: 15

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mstroob LGTM!

@mstroob mstroob merged commit 6959cbd into main Feb 23, 2026
53 checks passed
@mstroob mstroob deleted the mstroob/azurerm_container_app_job-initial-delaay-fix branch February 23, 2026 14:56
@github-actions github-actions bot added this to the v4.62.0 milestone Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azurerm_container_app_job: initial_delay not sent/read for startup_probe and readiness_probe

2 participants