Need help running a SQL Query against a different Node that it is assigned too.


I'm not really sure how to do this, basically, we have a DB in Azure that I need to run a query against, however, it fails to access being restricted for only internal sources.  When I create the "SQL Server User Experience Monitor" I set the "Test Node" to be the Azure DB, but apparently, it also tries to run the Query from that server.  There isn't an out of the box way to separate the two.  I did read that a Powershell script may be able to acheive this, but I pretty much suck at Powershell and would greatly appreciate any help with this.

Please let me know if any additional details are needed and thanks again for any help given.



  • Normally when you assign a "SQL Server User Experiance monitor" to a node, the query is run from the polling engine against the SQL server. BUT, I wounder if you have an agent on the monitored SQL server, if its run from the agent, locally, to the SQL Engine. Not sure but might be a solution. 

    If the db in azure is a "Azure SQL" och managed instance, that might be difficult though. Can't install an agent on those. Then again we are back to powershell that is run from another vm in azure against the db. Invoke-SQLcmd might be the command for you. Check this page to get started: