Skip to content

Commit b695f00

Browse files
Merge pull request #435 from srdan-bozovic-msft/master
managedinstance-tde-upload
2 parents 6bf4acb + 68c8aff commit b695f00

2 files changed

Lines changed: 552 additions & 0 deletions

File tree

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Upload certificate to Azure SQL Managed Instance using Azure PowerShell
2+
3+
Script that takes path to .cer and .pvk files and uploads them to SQL MI. See [more](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-migrate-tde-certificate).
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+
15+
<a name=about-this-sample></a>
16+
17+
## About this sample
18+
19+
- **Applies to:** Azure SQL Database
20+
- **Key features:** Managed Instance
21+
- **Workload:** n/a
22+
- **Programming Language:** PowerShell
23+
- **Authors:** Srdan Bozovic
24+
- **Update history:** n/a
25+
26+
<a name=before-you-begin></a>
27+
28+
## Before you begin
29+
30+
To run this sample, you need the following prerequisites.
31+
32+
**Software prerequisites:**
33+
34+
1. Running Microsoft Windows operating system (as script uses PInvoke for crypto api)
35+
2. PowerShell 5.0 or higher installed
36+
3. AzureRM.Sql module version 4.10.0 or higher
37+
38+
**Azure prerequisites:**
39+
40+
1. Permission to manage Azure SQL Managed Instance
41+
42+
<a name=run-this-sample></a>
43+
44+
## Run this sample
45+
46+
Run the script below from either Windows or Azure Cloud Shell
47+
48+
```powershell
49+
50+
$scriptUrlBase = 'https://raw.githubusercontent.com/Microsoft/sql-server-samples/master/samples/manage/azure-sql-db-managed-instance/upload-tde-certificate'
51+
52+
$parameters = @{
53+
subscriptionId = '<subscriptionId>'
54+
resourceGroupName = '<resourceGroupName>'
55+
managedInstanceName = '<managedInstanceName>'
56+
publicKeyFile = '<publicKeyFile>'
57+
privateKeyFile = '<privateKeyFile>'
58+
password = '<password>'
59+
}
60+
61+
Invoke-Command -ScriptBlock ([Scriptblock]::Create((iwr ($scriptUrlBase+'/uploadTDECertificate.ps1?t='+ [DateTime]::Now.Ticks)).Content)) -ArgumentList $parameters
62+
63+
```
64+
65+
<a name=sample-details></a>
66+
67+
## Sample details
68+
69+
This sample shows how to convert .cer and .pvk files to base64 .pfx blob and upload it to SQL MI using PowerShell.
70+
71+
<a name=disclaimers></a>
72+
73+
## Disclaimers
74+
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.
75+
76+
<a name=related-links></a>
77+
78+
## Related Links
79+
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
80+
81+
For more information, see these articles:
82+
83+
- [What is a Managed Instance (preview)?](https://docs.microsoft.com/azure/sql-database/sql-database-managed-instance)
84+
- [Configure a VNet for Azure SQL Database Managed Instance](https://docs.microsoft.com/azure/sql-database/sql-database-managed-instance-vnet-configuration)

0 commit comments

Comments
 (0)