I am currently trying to automate the whole process for working with Sandboxes in my company. As of now, we have a CLI tool which both refreshes the sandboxes and executes an Apex anonymous script to seed the DB and set some Custom Settings, etc.
The issue I have is I would now like to further automate this so that our git remote repository is pushed to the Sandbox once the refresh as been completed.
Initially, I thought of setting up a quick web application in Azure which a Sandbox PostCopy script would call once it had finished but the main stopper I have found is how to obtain the credentials programatically.
AFAIK, you can reset passwords, security tokens, etc. via the Tooling API, but I don't know a way to give my Azure service the current credentials for the Sandbox once it has been refreshed.
My idea is to have this whole pipeline automated. Is it possible?