Skip to content

Commit 4c2594c

Browse files
authored
Merge pull request #220 from microsoft/alex/hybridtoolkitbook
Azure SQL Hybrid Cloud Toolkit Jupyter Book addition
2 parents d8a3405 + ce0ef01 commit 4c2594c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+8622
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
{
2+
"metadata": {
3+
"kernelspec": {
4+
"name": "powershell",
5+
"display_name": "PowerShell"
6+
},
7+
"language_info": {
8+
"name": "powershell",
9+
"codemirror_mode": "shell",
10+
"mimetype": "text/x-sh",
11+
"file_extension": ".ps1"
12+
}
13+
},
14+
"nbformat_minor": 2,
15+
"nbformat": 4,
16+
"cells": [
17+
{
18+
"cell_type": "markdown",
19+
"source": [
20+
"# 0. Preparing the Credential"
21+
],
22+
"metadata": {
23+
"azdata_cell_guid": "140ce3a4-9596-47b5-ad22-87c3bd2057f6"
24+
}
25+
},
26+
{
27+
"cell_type": "code",
28+
"source": [
29+
"$functionKey = 'yourAzureFunctionKey'\r\n",
30+
"$Login = 'yourSqlServerLogin'\r\n",
31+
"$Password = 'yourSqlServerPassword'\r\n",
32+
"\r\n",
33+
"$headers = @{\r\n",
34+
" 'x-functions-key' = $functionKey\r\n",
35+
"}"
36+
],
37+
"metadata": {
38+
"azdata_cell_guid": "36fa6902-7640-462d-bc2e-6b49e9aaa0d9",
39+
"tags": []
40+
},
41+
"outputs": [],
42+
"execution_count": null
43+
},
44+
{
45+
"cell_type": "markdown",
46+
"source": [
47+
"# 1. Calling the ADP Orchestrator (Export)\r\n",
48+
"## 1.1 Submit the Export request to the source Azure SQL Server."
49+
],
50+
"metadata": {
51+
"azdata_cell_guid": "40c4517b-8145-4af1-bbbb-3be3b9b9a8a0"
52+
}
53+
},
54+
{
55+
"cell_type": "code",
56+
"source": [
57+
"$Url = 'https://adpcontrol.azurewebsites.net/api/subscriptions/0009fc4d-e310-4e40-8e63-c48a23e9cdc1/resourceGroups/seanadp01/Export'\n",
58+
"\n",
59+
"$Body = @{\n",
60+
" batchAccountUrl = 'https://adp.eastus.batch.azure.com'\n",
61+
" storageAccountName = 'adp01batch'\n",
62+
" sourceSqlServerResourceGroupName = 'SeanADP01Source'\n",
63+
" sourceSqlServerName = 'adpsvr01'\n",
64+
" userName = $Login \n",
65+
" password = $Password \n",
66+
"}\n",
67+
"\n",
68+
"$json = $Body | ConvertTo-Json\n",
69+
"$exportResponse = Invoke-RestMethod -Method 'Post' -Headers $headers -Uri $Url -Body $json -ContentType 'application/json'\n",
70+
"$exportResponse"
71+
],
72+
"metadata": {
73+
"azdata_cell_guid": "7e1d3261-5e61-4106-8063-7cd58ffd0cf1",
74+
"tags": []
75+
},
76+
"outputs": [],
77+
"execution_count": null
78+
},
79+
{
80+
"cell_type": "markdown",
81+
"source": [
82+
"## 1.2 Getting the Operation Status"
83+
],
84+
"metadata": {
85+
"azdata_cell_guid": "52204c15-abad-4ce5-8629-d290332f730b"
86+
}
87+
},
88+
{
89+
"cell_type": "code",
90+
"source": [
91+
"Invoke-RestMethod -Method 'Get' -Uri $exportResponse.statusQueryGetUri"
92+
],
93+
"metadata": {
94+
"azdata_cell_guid": "a0ba1261-3a26-4168-b149-1b9e44939432",
95+
"tags": [
96+
"hide_input"
97+
]
98+
},
99+
"outputs": [],
100+
"execution_count": null
101+
},
102+
{
103+
"cell_type": "markdown",
104+
"source": [
105+
"# 2. Calling the ADP Orchestrator (Import)\r\n",
106+
"## 2.1 Submit the Import request to the target Azure SQL Server."
107+
],
108+
"metadata": {
109+
"azdata_cell_guid": "2c862275-c380-476a-ab3d-a9aacdca963b"
110+
}
111+
},
112+
{
113+
"cell_type": "code",
114+
"source": [
115+
"$Url = 'https://adpcontrol.azurewebsites.net/api/subscriptions/0009fc4d-e310-4e40-8e63-c48a23e9cdc1/resourceGroups/seanadp01/Import'\r\n",
116+
"$Body = @{\r\n",
117+
" batchAccountUrl = 'https://adp.eastus.batch.azure.com'\r\n",
118+
" storageAccountName = 'adp01batch'\r\n",
119+
" containerName = 'adpsvr01-0428061710'\r\n",
120+
" targetSqlServerResourceGroupName = 'SeanADP01Target'\r\n",
121+
" targetSqlServerName = 'adpsvr03'\r\n",
122+
" userName = $Login \r\n",
123+
" password = $Password \r\n",
124+
"}\r\n",
125+
"\r\n",
126+
"$json = $Body | ConvertTo-Json\r\n",
127+
"$importResponse = Invoke-RestMethod -Method 'Post' -Headers $headers -Uri $Url -Body $json -ContentType 'application/json'\r\n",
128+
"$importResponse"
129+
],
130+
"metadata": {
131+
"azdata_cell_guid": "315859aa-e452-4ab3-acb5-92c7c8bd5857",
132+
"tags": []
133+
},
134+
"outputs": [],
135+
"execution_count": null
136+
},
137+
{
138+
"cell_type": "markdown",
139+
"source": [
140+
"## 2.2 Getting the Operation Status"
141+
],
142+
"metadata": {
143+
"azdata_cell_guid": "5da3293b-7d10-4315-8106-79e56cd657ea"
144+
}
145+
},
146+
{
147+
"cell_type": "code",
148+
"source": [
149+
"Invoke-RestMethod -Method 'Get' -Uri $importResponse.statusQueryGetUri"
150+
],
151+
"metadata": {
152+
"azdata_cell_guid": "328d3a27-4cdf-4623-a8c5-8230487efbed",
153+
"tags": [
154+
"hide_input"
155+
]
156+
},
157+
"outputs": [],
158+
"execution_count": null
159+
}
160+
]
161+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29920.165
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ADPControl", "ADPControl\ADPControl.csproj", "{6309D4C5-F118-4C89-A67E-E557CA41ABA2}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BatchWrapper", "BatchWrapper\BatchWrapper.csproj", "{E64CD92E-2D2C-48F1-B6B1-A7AF819B06F1}"
9+
EndProject
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SqlPackageWrapper", "SqlPackageWrapper\SqlPackageWrapper.csproj", "{A19335D3-9D80-43BE-9351-C3C3704689B0}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{6309D4C5-F118-4C89-A67E-E557CA41ABA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{6309D4C5-F118-4C89-A67E-E557CA41ABA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{6309D4C5-F118-4C89-A67E-E557CA41ABA2}.Release|Any CPU.ActiveCfg = Debug|Any CPU
21+
{6309D4C5-F118-4C89-A67E-E557CA41ABA2}.Release|Any CPU.Build.0 = Debug|Any CPU
22+
{E64CD92E-2D2C-48F1-B6B1-A7AF819B06F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{E64CD92E-2D2C-48F1-B6B1-A7AF819B06F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{E64CD92E-2D2C-48F1-B6B1-A7AF819B06F1}.Release|Any CPU.ActiveCfg = Debug|Any CPU
25+
{E64CD92E-2D2C-48F1-B6B1-A7AF819B06F1}.Release|Any CPU.Build.0 = Debug|Any CPU
26+
{A19335D3-9D80-43BE-9351-C3C3704689B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{A19335D3-9D80-43BE-9351-C3C3704689B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{A19335D3-9D80-43BE-9351-C3C3704689B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{A19335D3-9D80-43BE-9351-C3C3704689B0}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {3DB5F0CB-1D26-4E33-801D-7BBAE823C39D}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageReference Include="Microsoft.Azure.Batch" Version="13.0.0" />
8+
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.7.0-preview" />
9+
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="17.0.0" />
10+
<PackageReference Include="Microsoft.Azure.Services.AppAuthentication" Version="1.5.0" />
11+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.2.2" />
12+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.7" />
13+
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.21" />
14+
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.19" />
15+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<None Update="host.json">
19+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
20+
</None>
21+
<None Update="local.settings.json">
22+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
23+
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
24+
</None>
25+
</ItemGroup>
26+
</Project>

0 commit comments

Comments
 (0)