How can I use Terraform to run a script to initialise the database on a newly-created Azure mssql_virtual_machine?
I’ve created an Azure Windows virtual machine using the MicrosoftSQLServer/sql2022-ws2022 source image, and I’ve attached to it an E: drive containing pre-existing SQL Server databases. I have a script that will perform a several initialisation tasks. One is to attach those databases and set up the SQL authentication so that the DBs can be used by my application. If I log onto the machine via RDP and run that script manually, everything works well.