You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `ContainerAppClient` class provides a Python interface for managing Azure Container Apps jobs using the Azure SDK. It supports inspection, listing, existence checks, and starting jobs with custom commands and environment variables.
4
+
5
+
## Features
6
+
- Authenticate using Azure Managed Identity and environment variables
7
+
- List all jobs in a resource group
8
+
- Retrieve detailed job information
9
+
- Inspect container commands, images, and environment variables
10
+
- Check if a job exists
11
+
- Start jobs with custom commands, arguments, and environment variables
12
+
- Stop a running container app job
13
+
14
+
## Setup
15
+
16
+
1.**Install dependencies**
17
+
- The ContainerAppClient is available in the `cfa-cloudops` package. Install the package by executing the following code in your terminal.
- Initializes the client and loads environment variables.
77
+
-`list_jobs()`
78
+
- Returns a list of job names in the resource group.
79
+
-`check_job_exists(job_name)`
80
+
- Returns `True` if the job exists, `False` otherwise.
81
+
-`get_job_info(job_name)`
82
+
- Returns a dictionary of job details.
83
+
-`get_command_info(job_name)`
84
+
- Returns a list of container info dicts (name, image, command, args, env).
85
+
-`start_job(job_name, command, args, env)`
86
+
- Starts a job, optionally overriding command, args, and environment variables.
87
+
-`stop_job(job_name, job_execution_name)`
88
+
- Stops the specified job execution.
89
+
90
+
## Notes
91
+
- The client uses Azure Managed Identity for authentication. Ensure your environment supports this (e.g., Azure VM, App Service, or configure credentials).
92
+
- If you do not provide `resource_group`, `subscription_id`, or `job_name`, the client will attempt to use environment variables or values from the `.env` file.
93
+
- All operations are logged using Python's `logging` module for easier debugging.
0 commit comments