Hi Mohit Seoda,
Thanks for reaching out to Microsoft Q&A.
Yes, it is possible with the help of technical configuration settings for VM
Add public ports that will be automatically opened on a deployed virtual machine. You can specify the ports individually or via a range along with the supported protocol – TCP, UDP, or both. Be sure to use a hyphen if specifying a port range (Ex: 80-150).
Please refer to this document for details- https://zcusa.951200.xyz/en-us/partner-center/marketplace-offers/azure-vm-plan-technical-configuration
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.