2020-02-12 14:57:46 +03:00
# AzureSQLConnectivityChecker
2020-05-08 20:57:37 +03:00
This PowerShell script will run some connectivity checks from this machine to the server and database.
- Supports Single, Elastic Pools and Managed Instance (please provide FQDN, MI public endpoint is supported).
2020-05-08 21:02:07 +03:00
- Supports Azure Synapse / Azure SQL Data Warehouse (\*.sql.azuresynapse.net / \*.database.windows.net).
2020-05-08 21:05:10 +03:00
- Supports Public Cloud (\*.database.windows.net), Azure China (\*.database.chinacloudapi.cn) and Azure Germany (\*.database.cloudapi.de).
2020-02-12 14:57:46 +03:00
**In order to run it you need to:**
2020-03-12 19:31:13 +03:00
1. Open Windows PowerShell ISE in Administrator mode
2020-04-01 18:03:29 +03:00
For the better results, our recommendation is to use the advanced connectivity tests which demand to start PowerShell in Administrator mode. You can still run the basic tests, in case you decide not to run this way. Please note that script parameters 'RunAdvancedConnectivityPolicyTests' and 'CollectNetworkTrace' will only work if the admin privileges are granted.
2020-03-11 01:02:37 +03:00
2020-02-12 14:57:46 +03:00
2. Open a New Script window
2020-03-11 01:02:37 +03:00
2020-02-12 14:57:46 +03:00
3. Paste the following in the script window:
```powershell
$parameters = @{
Server = '.database.windows.net'
2020-03-11 01:02:37 +03:00
Database = '' # Set the name of the database you wish to test, 'master' will be used by default if nothing is set
User = '' # Set the login username you wish to use, 'AzSQLConnCheckerUser' will be used by default if nothing is set
Password = '' # Set the login password you wish to use, 'AzSQLConnCheckerPassword' will be used by default if nothing is set
2020-02-12 22:17:28 +03:00
2020-04-07 16:00:15 +03:00
## Optional parameters (default values will be used if omitted)
2020-03-11 01:02:37 +03:00
SendAnonymousUsageData = $true # Set as $true (default) or $false
2020-04-01 18:03:29 +03:00
RunAdvancedConnectivityPolicyTests = $true # Set as $true (default) or $false, this will load the library from Microsoft's GitHub repository needed for running advanced connectivity tests
2020-03-11 01:02:37 +03:00
CollectNetworkTrace = $true # Set as $true (default) or $false
#EncryptionProtocol = '' # Supported values: 'Tls 1.0', 'Tls 1.1', 'Tls 1.2'; Without this parameter operating system will choose the best protocol to use
2020-02-12 14:57:46 +03:00
}
2020-03-11 01:02:37 +03:00
2020-02-12 14:57:46 +03:00
$ProgressPreference = "SilentlyContinue";
2020-04-01 18:03:29 +03:00
$scriptUrlBase = 'raw.githubusercontent.com/Azure/SQL-Connectivity-Checker/master'
Invoke-Command -ScriptBlock ([Scriptblock]::Create((iwr ($scriptUrlBase+'/AzureSQLConnectivityChecker.ps1')).Content)) -ArgumentList $parameters
2020-02-12 14:57:46 +03:00
#end
```
2020-03-12 19:29:44 +03:00
4. Set the parameters on the script, you need to set server name. Database name, user and password are optional but desirable.
2020-02-12 14:57:46 +03:00
5. Run it.
2020-03-11 01:02:37 +03:00
6. The results can be seen in the output window.
2020-02-12 14:57:46 +03:00
If the user has the permissions to create folders, a folder with the resulting log file will be created.
When running on Windows, the folder will be opened automatically after the script completes.
2020-03-12 19:29:44 +03:00
A zip file with all the log files (AllFiles.zip) will be created.
2020-01-15 19:46:49 +03:00
# Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct ](https://opensource.microsoft.com/codeofconduct/ ).
For more information see the [Code of Conduct FAQ ](https://opensource.microsoft.com/codeofconduct/faq/ ) or
contact [opencode@microsoft.com ](mailto:opencode@microsoft.com ) with any additional questions or comments.