Below are few suggestions for your ask:
If you have a custom image already built with all necessary configurations (IIS and DB connections), you can deploy that image to VMSS (VM can be deployed into VMSS only at creation time). And then can connect to SQL server. Here is the doc reference on this.
Another consideration is to use Custom script extension. With this you can avoid building custom image every-time there is a change. You can have scripts to do the configuration on the VM. You can also consider using Azure Key Vault for storing DB string. Please refer this document.
Also, below are few quick start templates that you can check:
Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics.