Hello , Welcome to MS Q&A
I think there are no direct method to kill a specific session in Azure Container Apps. However, you can manage the lifecycle of your container by implementing logic within the container itself. Here are a few approaches you might consider:
- Graceful Shutdown from Inside the Container:
- You can modify your application code to exit the container process once the user-submitted code has finished running. This will cause the container to stop, effectively ending the session.
- For example, in a Python application, you could use sys.exit() to terminate the process.
- Using Azure Container Apps Job:
- If your workload is short-lived and runs for a few seconds, consider using Azure Container Apps Jobs. Jobs are designed for running tasks that start, run to completion, and then stop. This might be more suitable for your use case than a long-running container app.
References:
Please let me know if any more questions
Kindly accept if it helps
Thanks
Deepanshu