There is a REST API available for Azure. For the database specific part, look here:
Azure SQL Database REST API reference | Microsoft Docs[
^]
You also have a dotnet sdk. I found this example with a quick google search, so I do not know if it is up to date:
‘How to create an Azure SQL Database programmatically’ with less frustration · GitHub[
^] - the namespaces etc in the sample should provide a starting point to find more information.
You will have to make sure your service is authenticated to create databases. I would look into Managed Identity:
Managed identities for Azure resources | Microsoft Docs[
^]
Then you avoid having to deal with keys that expire and other mess - but it will only work from a deployed azure service, not your dev-box. So as with everything security, it is complicated to find the least annoying way for your specific setup.