Lesson Learned #236: What? …. How much time you said? (CloudShell version)

Posted by

This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .

We usually have service requests when our customers, using different drivers, need to know the connection latency, execution time spent or validate the connection, in this article you could find an example code to perform this operation. 

 

We received feedback to test using directly in CloudShell without deploying or having Virtual Machine on Azure. In this URL you could find the version for CloudShell.

 

Unfortunately, this CloudShellversion only supports SQLCLIENT and ODBC but the remaining features are the same. 

 

To execute the PowerShell script CloudShell:

 

  • Upload the file in your $home folder using the upload/download file in CloudShell
  • Run this PowerShell script
  • This script will create a log file in the same folder with the results of the execution. There is not needed to modify the PowerShell script, basically, you need to execute this as follows:

 

 

./SQLConnectivityTestCloudShell.ps1 -DatabaseServer servername.database.windows.net -Database databasename -UserName username -Driver SQLCLIENT -NumberExecutions 20 -Password password

 

 

Example how to execute the PowerShell Script

 

Jose_Manuel_Jurado_1-1660954431720.png

 

Example how to edit the file if needed.

 

Jose_Manuel_Jurado_0-1660954308134.png

 

 

Enjoy!

This articles are republished, there may be more discussion at the original link. But if you found this helpful, you're more than welcome to let us know!

This site uses Akismet to reduce spam. Learn how your comment data is processed.