Skip to content

Commit 50432bd

Browse files
Merge pull request #868 from srdan-bozovic-msft/master
Script to get TDS certificate from Azure SQL
2 parents 8eb17c2 + 90906ae commit 50432bd

2 files changed

Lines changed: 715 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Get TDS certificate from Azure SQL using PowerShell
2+
3+
Script that downloads TDS certificate with public key only from Azure SQL
4+
5+
### Contents
6+
7+
[About this sample](#about-this-sample)<br/>
8+
[Before you begin](#before-you-begin)<br/>
9+
[Run this sample](#run-this-sample)<br/>
10+
[Sample details](#sample-details)<br/>
11+
[Disclaimers](#disclaimers)<br/>
12+
[Related links](#related-links)<br/>
13+
14+
<a name=about-this-sample></a>
15+
16+
## About this sample
17+
18+
- **Applies to:** Azure SQL
19+
- **Key features:** Database, Managed Instance
20+
- **Workload:** n/a
21+
- **Programming Language:** PowerShell
22+
- **Authors:** Srdan Bozovic
23+
- **Update history:** n/a
24+
25+
<a name=before-you-begin></a>
26+
27+
## Before you begin
28+
29+
To run this sample, you need the following prerequisites.
30+
31+
**Software prerequisites:**
32+
33+
1. PowerShell 5.0 or higher installed
34+
35+
<a name=run-this-sample></a>
36+
37+
## Run this sample
38+
39+
Run the script below from either Windows or Azure Cloud Shell
40+
41+
```powershell
42+
43+
$scriptUrlBase = 'https://raw.githubusercontent.com/Microsoft/sql-server-samples/master/samples/manage/get-tds-certificate'
44+
45+
$parameters = @{
46+
hostName = '<hostName>'
47+
port = '<port>'
48+
publicCertificateFile = '<publicCertificateFile>'
49+
}
50+
51+
Invoke-Command -ScriptBlock ([Scriptblock]::Create((iwr ($scriptUrlBase+'/getTDSCertificate.ps1?t='+ [DateTime]::Now.Ticks)).Content)) -ArgumentList $parameters
52+
53+
```
54+
55+
<a name=sample-details></a>
56+
57+
## Sample details
58+
59+
This sample shows how to retreive Azure SQL TDS certificate and save it to DER encoded X509 binary.
60+
61+
<a name=disclaimers></a>
62+
63+
## Disclaimers
64+
The scripts and this guide are copyright Microsoft Corporations and are provided as samples. They are not part of any Azure service and are not covered by any SLA or other Azure-related agreements. They are provided as-is with no warranties express or implied. Microsoft takes no responsibility for the use of the scripts or the accuracy of this document. Familiarize yourself with the scripts before using them.
65+
66+
<a name=related-links></a>
67+
68+
## Related Links
69+
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
70+
71+
This sample reuses code from [Azure SQL Connectivity Checker](https://github.com/Azure/SQL-Connectivity-Checker)

0 commit comments

Comments
 (0)