Skip to content

Commit 8027d38

Browse files
committed
2 parents 59e4327 + c8b7594 commit 8027d38

6 files changed

Lines changed: 568 additions & 30 deletions

File tree

samples/features/sql-big-data-cluster/deployment/aks/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Using this sample Python script, you will deploy a Kubernetes cluster in Azure u
1616
python -m pip install requests
1717
python -m pip install requests --upgrade
1818
```
19-
- Install mssqlctl CLI latest version using . Run the command below using elevated priviledges (sudo or admin cmd window):
19+
- Install latest version of the cluster management tool **azdata** (previously named mssqlctl) using below command. Run the command below using elevated priviledges (sudo or admin cmd window):
2020
```
21-
pip3 install -r https://private-repo.microsoft.com/python/ctp3.1/mssqlctl/requirements.txt
21+
pip3 install -r https://aka.ms/azdata
2222
```
2323
1. Login into your Azure account. Run this command:
2424
```

samples/features/sql-big-data-cluster/deployment/aks/deploy-sql-big-data-aks.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Prerequisites:
33
#
4-
# Azure CLI (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli), python3 (https://www.python.org/downloads), mssqlctl CLI (pip3 install -r https://private-repo.microsoft.com/python/ctp3.1/mssqlctl/requirements.txt)
4+
# Azure CLI (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli), python3 (https://www.python.org/downloads), azdata CLI (pip3 install -r https://aka.ms/azdata)
55
#
66
# Run `az login` at least once BEFORE running this script
77
#
@@ -38,21 +38,24 @@ def executeCmd (cmd):
3838
CLUSTER_NAME=input("Provide name of AKS cluster and SQL big data cluster - Press ENTER for using `sqlbigdata`:").strip() or "sqlbigdata"
3939

4040
#This password will be use for Controller user, Knox user and SQL Server Master SA accounts
41+
#
4142
CONTROLLER_USERNAME=input("Provide username to be used for Controller user - Press ENTER for using `admin`:").strip() or "admin"
4243
PASSWORD = getpass.getpass("Provide password to be used for Controller user, Knox user and SQL Server Master SA accounts - Press ENTER for using `MySQLBigData2019`").strip() or "MySQLBigData2019"
4344

44-
#docker registry details
45-
DOCKER_REGISTRY="private-repo.microsoft.com"
46-
DOCKER_REPOSITORY="mssql-private-preview"
47-
DOCKER_IMAGE_TAG="ctp3.1"
45+
# Docker registry details
46+
# Use this only if you are using a private registry different than mcr. If so, make sure you are also setting the environment variables for DOCKER_USERNAME and DOCKER_PASSWORD
47+
# DOCKER_REGISTRY="<your private registry>"
48+
# DOCKER_REPOSITORY="<your private repository>"
49+
# DOCKER_IMAGE_TAG="<your Docker image tag>"
4850

4951
print ('Setting environment variables')
5052
os.environ['MSSQL_SA_PASSWORD'] = PASSWORD
5153
os.environ['CONTROLLER_USERNAME'] = CONTROLLER_USERNAME
5254
os.environ['CONTROLLER_PASSWORD'] = PASSWORD
5355
os.environ['KNOX_PASSWORD'] = PASSWORD
54-
os.environ['DOCKER_USERNAME']=DOCKER_USERNAME
55-
os.environ['DOCKER_PASSWORD']=DOCKER_PASSWORD
56+
# Use this only if you are using a private registry different than mcr. If so, you must set the environment variables for DOCKER_USERNAME and DOCKER_PASSWORD
57+
# os.environ['DOCKER_USERNAME']=DOCKER_USERNAME
58+
# os.environ['DOCKER_PASSWORD']=DOCKER_PASSWORD
5659
os.environ['ACCEPT_EULA']="Yes"
5760

5861
print ("Set azure context to subcription: "+SUBSCRIPTION_ID)
@@ -71,29 +74,30 @@ def executeCmd (cmd):
7174
executeCmd (command)
7275

7376
print("Creating SQL Big Data cluster:" +CLUSTER_NAME)
74-
command="mssqlctl bdc config init --source aks-dev-test --target custom --force"
77+
command="azdata bdc config init --source aks-dev-test --target custom --force"
7578
executeCmd (command)
7679

77-
command="mssqlctl bdc config section set -c custom -j ""metadata.name=" + CLUSTER_NAME + ""
80+
command="azdata bdc config section set -c custom -j ""metadata.name=" + CLUSTER_NAME + ""
7881
executeCmd (command)
7982

80-
command="mssqlctl bdc config section set -c custom -j ""$.spec.controlPlane.spec.docker.registry=" + DOCKER_REGISTRY + ""
81-
executeCmd (command)
83+
# Use this only if you are using a private registry different than default Micrososft registry (mcr).
84+
# command="azdata bdc config section set -c custom -j ""$.spec.controlPlane.spec.docker.registry=" + DOCKER_REGISTRY + ""
85+
# executeCmd (command)
8286

83-
command="mssqlctl bdc config section set -c custom -j ""$.spec.controlPlane.spec.docker.repository=" + DOCKER_REPOSITORY + ""
84-
executeCmd (command)
87+
# command="azdata bdc config section set -c custom -j ""$.spec.controlPlane.spec.docker.repository=" + DOCKER_REPOSITORY + ""
88+
# executeCmd (command)
8589

86-
command="mssqlctl bdc config section set -c custom -j ""$.spec.controlPlane.spec.docker.imageTag=" + DOCKER_IMAGE_TAG + ""
87-
executeCmd (command)
90+
# command="azdata bdc config section set -c custom -j ""$.spec.controlPlane.spec.docker.imageTag=" + DOCKER_IMAGE_TAG + ""
91+
# executeCmd (command)
8892

89-
command="mssqlctl bdc create -c custom --accept-eula yes"
93+
command="azdata bdc create -c custom --accept-eula yes"
9094
executeCmd (command)
9195

92-
command="mssqlctl login --cluster-name " + CLUSTER_NAME
96+
command="azdata login --cluster-name " + CLUSTER_NAME
9397
executeCmd (command)
9498

9599
print("")
96100
print("SQL Server big data cluster endpoints: ")
97-
command="mssqlctl bdc endpoint list -o table"
101+
command="azdata bdc endpoint list -o table"
98102
executeCmd(command)
99103

samples/features/sql-big-data-cluster/deployment/offline/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ python push-bdc-images-to-custom-private-repo.py
2424
>```
2525
2626
When prompted, provide your input for:
27-
- Docker registry, repository and credentials to access Microsoft private registry where the images will be pulled from (source)
27+
- Docker registry, repository to access Microsoft registry where the images will be pulled from (source). Press enter to use default mcr registry.
2828
- Docker registry, repository and credentials to access your private registry where the images will be pushed to (target)
2929
3030
## Deploy with from your private repository

samples/features/sql-big-data-cluster/deployment/offline/push-bdc-images-to-custom-private-repo.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ def execute_cmd (cmd):
1313
if (stderr is not None):
1414
raise Exception(stderr)
1515

16-
SOURCE_DOCKER_REGISTRY = input("Provide Docker registry source - press ENTER for using `private-repo.microsoft.com`:") or "private-repo.microsoft.com"
17-
SOURCE_DOCKER_REPOSITORY = input("Provide Docker repository source - press ENTER for using `mssql-private-preview`:") or "mssql-private-preview"
18-
SOURCE_DOCKER_USERNAME = input("Provide Docker username for the source registry:")
19-
SOURCE_DOCKER_PASSWORD=getpass.getpass("Provide Docker password for the source registry:")
16+
SOURCE_DOCKER_REGISTRY = input("Provide Docker registry source - press ENTER for using `mcr.microsoft.com`:") or "mcr.microsoft.com"
17+
SOURCE_DOCKER_REPOSITORY = input("Provide Docker repository source - press ENTER for using `mssql/bdc`:") or "mssql/bdc"
18+
# Use this only if your source is a private Docker registry
19+
# SOURCE_DOCKER_USERNAME = input("Provide Docker username for the source registry:")
20+
# SOURCE_DOCKER_PASSWORD=getpass.getpass("Provide Docker password for the source registry:")
2021
SOURCE_DOCKER_TAG = input("Provide Docker tag for the images at the source: ") or "latest"
2122

2223
TARGET_DOCKER_REGISTRY = input("Provide Docker registry target:")
@@ -43,12 +44,14 @@ def execute_cmd (cmd):
4344
'mssql-service-proxy',
4445
'mssql-app-service-proxy',
4546
'mssql-ssis-app-runtime',
46-
'mssql-monitor-telegraf']
47+
'mssql-monitor-telegraf',
48+
'mssql-security-support']
4749

48-
print("Execute docker login to source registry: " + SOURCE_DOCKER_REGISTRY)
49-
cmd = "docker login " + SOURCE_DOCKER_REGISTRY + " -u " + SOURCE_DOCKER_USERNAME + " -p " + SOURCE_DOCKER_PASSWORD
50-
execute_cmd(cmd)
51-
print("")
50+
# Use this only if your source is a private Docker registry
51+
# print("Execute docker login to source registry: " + SOURCE_DOCKER_REGISTRY)
52+
# cmd = "docker login " + SOURCE_DOCKER_REGISTRY + " -u " + SOURCE_DOCKER_USERNAME + " -p " + SOURCE_DOCKER_PASSWORD
53+
# execute_cmd(cmd)
54+
# print("")
5255

5356

5457
print("Pulling images from source repository: " + SOURCE_DOCKER_REGISTRY + "/" + SOURCE_DOCKER_REPOSITORY)
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Delegate subnet for Managed Instance deployment
2+
3+
Script that validates and prepares virtual network and subnet for Managed Instance creation to comply with [networking requirements](https://docs.microsoft.com/azure/sql-database/sql-database-managed-instance-vnet-configuration#requirements).
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. PowerShell 5.1 or PowerShell Core 6.0
35+
2. Azure PowerShell Az module
36+
37+
**Azure prerequisites:**
38+
39+
1. Permission to manage Azure virtual network
40+
41+
<a name=run-this-sample></a>
42+
43+
## Run this sample
44+
45+
Run the script below from either Windows or Azure Cloud Shell
46+
47+
```powershell
48+
49+
$scriptUrlBase = 'https://raw.githubusercontent.com/Microsoft/sql-server-samples/master/samples/manage/azure-sql-db-managed-instance/delegate-subnet'
50+
51+
$parameters = @{
52+
subscriptionId = '<subscriptionId>'
53+
resourceGroupName = '<resourceGroupName>'
54+
virtualNetworkName = '<virtualNetworkName>'
55+
subnetName = '<subnetName>'
56+
}
57+
58+
Invoke-Command -ScriptBlock ([Scriptblock]::Create((iwr ($scriptUrlBase+'/delegateSubnet.ps1?t='+ [DateTime]::Now.Ticks)).Content)) -ArgumentList $parameters
59+
60+
```
61+
62+
<a name=sample-details></a>
63+
64+
## Sample details
65+
66+
This sample shows how to prepare Azure virtual network and subnet for Managed Instance deployment using PowerShell
67+
68+
This is done in three simple steps:
69+
- Validate - Selected virtual netwok and subnet are validated for Managed Instance networking requirements
70+
- Confirm - User is shown a set of changes that need to be made to prepare subnet for Managed Instance deployment and asked for consent
71+
- Prepare - Virtual network and subnet are configured properly
72+
73+
<a name=disclaimers></a>
74+
75+
## Disclaimers
76+
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.
77+
78+
<a name=related-links></a>
79+
80+
## Related Links
81+
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
82+
83+
For more information, see these articles:
84+
85+
- [What is a Managed Instance?](https://docs.microsoft.com/azure/sql-database/sql-database-managed-instance)
86+
- [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)