@John Wong Yek Hon Thanks for your patience on this. I have checked with Container Apps engineering team on this and sharing the below.
- Is there a way for the job process to retrieve the replica name?
You can use the environment variable CONTAINER_APP_JOB_EXECUTION_NAME to retrieve the job Name and to further save in Cosmos DB.
- Is there a way to terminate / destroy particular replica programmatically. -->
In your webapp you can call the ARM stop job execution API to stop the job execution by using the Job name. If there is a supported management SDK for your language used, they can use them as well.
Hope this helps, let me know if you have any further questions on this.