@NeerajV-6011
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:
https://azure.microsoft.com/en-us/resources/templates/301-multi-vmss-linux-lb-zones/
https://azure.microsoft.com/en-us/resources/templates/201-vmss-custom-script-windows/
Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics.