Skip to content

Commit c9c6ced

Browse files
authored
Merge pull request #224155 from vmagelo/passwordless-work2
Add passwordless path through article.
2 parents 7a3896a + cb129eb commit c9c6ced

12 files changed

+318
-40
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/23/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync / Async](#tab/sync+async)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="constants":::
16+
17+
---
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/19/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync](#tab/sync)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_client":::
16+
17+
#### [Async](#tab/async)
18+
19+
> [!IMPORTANT]
20+
> Put the client instance in a coroutine function named `manage_cosmos`. Within the coroutine function, define the new client with the `async with` keywords. Outside of the coroutine function, use the `asyncio.run` function to execute the coroutine asynchronously.
21+
22+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="24-26":::
23+
24+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="70":::
25+
26+
---
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/19/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync](#tab/sync)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_database":::
16+
17+
#### [Async](#tab/async)
18+
19+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="28-29":::
20+
21+
---
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/19/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync / Async](#tab/sync+async)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="environment_variables":::
16+
17+
---
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/19/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync](#tab/sync)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="imports":::
16+
17+
#### [Async](#tab/async)
18+
19+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" id="imports":::
20+
21+
Note the `.aio` import for the async versions.
22+
23+
---
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/19/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync](#tab/sync)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_partition_key":::
16+
17+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_container":::
18+
19+
#### [Async](#tab/async)
20+
21+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="31":::
22+
23+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="33-36":::
24+
25+
---
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/23/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync / Async](#tab/sync+async)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app_cred.py" id="constants":::
16+
17+
---
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/23/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync](#tab/sync)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app_cred.py" id="create_client":::
16+
17+
#### [Async](#tab/async)
18+
19+
> [!IMPORTANT]
20+
> Put the client instance in a coroutine function named `manage_cosmos`. Within the coroutine function, define the new client with the `async with` keywords. Outside of the coroutine function, use the `asyncio.run` function to execute the coroutine asynchronously.
21+
22+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app_cred.py" range="25-27":::
23+
24+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app_cred.py" range="69":::
25+
26+
---
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/23/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync / Async](#tab/sync+async)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app_cred.py" id="environment_variables":::
16+
17+
---
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "include file"
3+
description: "include file"
4+
services: cosmosdb
5+
author: diberry
6+
ms.service: cosmosdb
7+
ms.topic: include
8+
ms.date: 01/23/2023
9+
ms.author: diberry
10+
ms.custom: include file
11+
---
12+
13+
#### [Sync](#tab/sync)
14+
15+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app_cred.py" id="imports":::
16+
17+
#### [Async](#tab/async)
18+
19+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app_cred.py" id="imports":::
20+
21+
---

0 commit comments

Comments
 (0)