Closed
Description
- Package Name: azure-mgmt-appcontainers
- Package Version: 3.0.0
- Operating System: macOS Ventura 13.6.4
- Python Version: 3.11.7
Describe the bug
When retrieving a Container Apps job using ContainerAppsAPIClient.job_execution()
, some properties are empty. Instead, they need to be accessed using additional_properties
.
To Reproduce
Steps to reproduce the behavior:
- Create a Container Apps environment and job using Azure CLI:
az containerapp env create -n test-jobs -g test-jobs -l northcentralus az containerapp job create -n test -g test-jobs --environment test-jobs --image mcr.microsoft.com/k8se/quickstart-jobs:latest --trigger manual
- Start a job execution:
az containerapp job start -n test -g test-jobs
- Retrieve the job using the SDK:
This prints (reformatted for readability):
import os from azure.identity import DefaultAzureCredential from azure.mgmt.appcontainers import ContainerAppsAPIClient credential = DefaultAzureCredential() client = ContainerAppsAPIClient(credential, os.environ['AZURE_SUBSCRIPTION_ID']) job_execution = client.job_execution("test-jobs", "test", "ENTER_JOB_EXECUTION_ID_HERE") print(job_execution)
Notice that{ "additional_properties": { "properties": { "status": "Succeeded", "startTime": "2024-02-24T00:09:17+00:00", "endTime": "2024-02-24T00:09:37+00:00", "template": { "containers": [ { "image": "mcr.microsoft.com/k8se/quickstart-jobs:latest", "name": "test", "env": [ { "name": "CONTAINER_APP_JOB_NAME", "value": "test" }, { "name": "CONTAINER_APP_JOB_EXECUTION_NAME", "value": "" }, { "name": "CONTAINER_APP_REPLICA_NAME", "value": "" } ], "resources": { "cpu": 0.5, "memory": "1Gi", "ephemeralStorage": "" } } ], "initContainers": [] } } }, "name": "test-g4y3l32", "id": "/subscriptions/****/resourceGroups/test-jobs/providers/Microsoft.App/jobs/test/executions/test-****", "type": "Microsoft.App/jobs/executions", "status": None, "start_time": None, "end_time": None, "template": None }
status
,start_time
,end_time
, andtemplate
at the root of the job areNone
. The actual values are tucked underadditional_properties.properties
.
Expected behavior
status
,start_time
,end_time
, andtemplate
should be filled in.additional_properties
don't need to be included.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.