@Pratibha . (SC-ALT) There is a similar scenario documented by using Azure Functions and PowerShell Remoting. While this doc refers to using Hybrid Connection since the VM is on-premises, in your case you could directly connect to the VM if it is exposed to the internet. In the code shown in this section of the doc, you would just have to update the $Script
variable to your requirement.
Finally, you could just call this Azure Function from your Logic App.