Hi @Shri Gowtham Tharun Reddy Abbireddy ,
Thank you for posting query in Microsoft Q&A Platform.
Selfhosted IR will be used to establish connection between Cloud and your private or onprem networks which are not publicly accessible. Click here to know more about selfhosted IR.
In your case, if your Azure VM is on public and its publicly accessible over internet and no firewall rules blockage of your database then we no need to use selfhosted IR. we can directly use Azure IR. But usually that will be not the case majorly. Your VM may be in some private network hence we have to use selfhosted IR.
You can consider creating an Azure IR in some specific region. That take IP addresses of that region IR to whitelist. But in this case too still you Azure VM needs to be publicly accessible. Check below link for Azure IR IP addresses.
https://learn.microsoft.com/en-us/azure/data-factory/azure-integration-runtime-ip-addresses
So, majority of cases we should consider using selfhosted IR to connect to Azure IaaS database from ADF.
Hope this helps. Please let me know if any further queries.
------------------
Please consider hitting Accept Answer
button. Accepted answers help community as well.