@Soni Apologies for the delay in response and all the inconvenience caused because of the issue.
Passing secrets to VMs is probably best done via Batch’s KeyVault integration. You can read more about it here:
https://video2.skills-academy.com/en-us/azure/batch/credential-access-key-vault
Hope it helps!!!
Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics