Skip to content

Commit 1c68b3e

Browse files
committed
docs(tutorials, 001): Add example for Azure Native IDP AD
1 parent 0f11228 commit 1c68b3e

File tree

1 file changed

+47
-18
lines changed

1 file changed

+47
-18
lines changed

tutorials/001 - Connecting to Amazon Redshift.ipynb

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@
399399
},
400400
{
401401
"cell_type": "markdown",
402+
"metadata": {},
402403
"source": [
403404
"# Connecting to a Redshift Serverless Endpoint\n",
404405
"\n",
@@ -407,14 +408,12 @@
407408
"### Using Database credentials (Native authentication)\n",
408409
"\n",
409410
"Provide the Redshift Serverless Endpoint to the `host` parameter of `redshift_connector.connect()`."
410-
],
411-
"metadata": {
412-
"collapsed": false
413-
}
411+
]
414412
},
415413
{
416414
"cell_type": "code",
417415
"execution_count": null,
416+
"metadata": {},
418417
"outputs": [],
419418
"source": [
420419
"import redshift_connector\n",
@@ -426,25 +425,21 @@
426425
" # port value of 5439 is specified by default\n",
427426
") as conn:\n",
428427
" pass"
429-
],
430-
"metadata": {
431-
"collapsed": false
432-
}
428+
]
433429
},
434430
{
435431
"cell_type": "markdown",
432+
"metadata": {},
436433
"source": [
437434
"### Using IAM or Identity Provider (IdP) Plugins\n",
438435
"\n",
439436
"Provide the Redshift Serverless Endpoint to the `host` parameter of `redshift_connector.connect()` along with the necessary connection parameter."
440-
],
441-
"metadata": {
442-
"collapsed": false
443-
}
437+
]
444438
},
445439
{
446440
"cell_type": "code",
447441
"execution_count": null,
442+
"metadata": {},
448443
"outputs": [],
449444
"source": [
450445
"import redshift_connector\n",
@@ -459,15 +454,49 @@
459454
" region='us-east-2'\n",
460455
" ) as conn:\n",
461456
" pass\n"
462-
],
463-
"metadata": {
464-
"collapsed": false
465-
}
457+
]
458+
},
459+
{
460+
"cell_type": "markdown",
461+
"metadata": {},
462+
"source": [
463+
"# Connecting using Azure Native Identity Provider Plugin (IdP)\n",
464+
"\n",
465+
"To establish a connection to Redshift using Native Azure AD, the following connection parameters may be used."
466+
]
467+
},
468+
{
469+
"cell_type": "code",
470+
"execution_count": null,
471+
"metadata": {},
472+
"outputs": [],
473+
"source": [
474+
"import redshift_connector\n",
475+
"\n",
476+
"with redshift_connector.connect(\n",
477+
" iam=True,\n",
478+
" credentials_provider='BrowserAzureOAuth2CredentialsProvider',\n",
479+
" host='test-cluster.abcdefghijkl.us-east-1.redshift.amazonaws.com',\n",
480+
" scope='api://123456-7891-j3jk3-9dd2-c423434f0037/jdbc_login',\n",
481+
" idp_tenant='e42343b2-1234-5678-8768-5db01232131d72',\n",
482+
" cluster_identifier='test-cluster',\n",
483+
" region='us-east-1',\n",
484+
" listen_port=7890,\n",
485+
" idp_response_timeout=50,\n",
486+
" client_id='343432-492d-j3jk3-9dd2-c423434f0037',\n",
487+
" database='dev',\n",
488+
" ssl=True,\n",
489+
" sslmode='verify-ca',\n",
490+
" #ssl_insecure=False\n",
491+
" # port value of 5439 is specified by default\n",
492+
") as conn:\n",
493+
" pass"
494+
]
466495
}
467496
],
468497
"metadata": {
469498
"kernelspec": {
470-
"display_name": "Python 3",
499+
"display_name": "Python 3 (ipykernel)",
471500
"language": "python",
472501
"name": "python3"
473502
},
@@ -481,7 +510,7 @@
481510
"name": "python",
482511
"nbconvert_exporter": "python",
483512
"pygments_lexer": "ipython3",
484-
"version": "3.9.6"
513+
"version": "3.9.0"
485514
}
486515
},
487516
"nbformat": 4,

0 commit comments

Comments
 (0)