You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: azure-sql/database/azure-sql-python-quickstart.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,9 @@ This quickstart describes how to connect an application to a database in Azure S
26
26
27
27
- An [Azure subscription](https://azure.microsoft.com/pricing/purchase-options/azure-account?icid=azurefreeaccountpython/).
28
28
- An Azure SQL database configured with Microsoft Entra authentication. You can create one using the [Quickstart: Create a single database - Azure SQL Database](single-database-create-quickstart.md).
29
-
- The latest version of the [Azure CLI](/cli/azure/get-started-with-azure-cli).
30
29
- Visual Studio Code with the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python).
31
30
- Python 3.10 or later.
31
+
- The [Azure CLI](/cli/azure/install-azure-cli) (required for `ActiveDirectoryDefault` authentication).
32
32
33
33
## Configure the database
34
34
@@ -97,9 +97,9 @@ For local development, create a `.env` file in your project folder to store your
97
97
98
98
The mssql-python driver has built-in support for Microsoft Entra authentication. Use the `Authentication` parameter to specify the authentication method.
99
99
100
-
## [DefaultAzureCredential](#tab/sql-default)
100
+
## [ActiveDirectoryDefault](#tab/sql-default)
101
101
102
-
`ActiveDirectoryDefault` automatically discovers credentials from multiple sources (Azure CLI, environment variables, Visual Studio, etc.) without requiring interactive login. This is convenient for local development but is slower due to credential discovery.
102
+
`ActiveDirectoryDefault` automatically discovers credentials from multiple sources (Visual Studio Code, Azure CLI, environment variables, etc.) without requiring interactive login. This is convenient for local development but is slower due to credential discovery.
For local development, make sure you're signed-in with the same Azure AD account you want to use to access Azure SQL Database. You can authenticate via popular development tools, such as the Azure CLI or Azure PowerShell. The development tools with which you can authenticate vary across languages.
13
+
For local development, make sure you're signedin with the same Microsoft Entra account you want to use to access Azure SQL Database. You can authenticate via popular development tools, such as the Azure CLI or Azure PowerShell. The development tools with which you can authenticate vary across languages.
15
14
16
15
### [Azure CLI](#tab/sign-in-azure-cli)
17
16
18
-
Sign-in to Azure through the Azure CLI using the following command:
17
+
Signin to Azure through the Azure CLI using the following command. This works on Windows, macOS, and Linux.
19
18
20
19
```azurecli
21
20
az login
@@ -27,28 +26,29 @@ Select the **Sign in** button in the top right of Visual Studio.
27
26
28
27
:::image type="content" source="../../database/media/passwordless-connections/sign-in-visual-studio-small.png" alt-text="Screenshot showing the button to sign in to Azure using Visual Studio.":::
29
28
30
-
Sign-in using the Azure AD account you assigned a role to previously.
29
+
Signin using the Microsoft Entra account you assigned a role to previously.
31
30
32
31
:::image type="content" source="../../database/media/passwordless-connections/sign-in-visual-studio-account-small.png" alt-text="Screenshot showing the account selection.":::
33
32
34
33
### [Visual Studio Code](#tab/sign-in-visual-studio-code)
35
34
36
-
You will need to [install the Azure CLI](/cli/azure/install-azure-cli) to work with `DefaultAzureCredential` through Visual Studio Code.
35
+
For Visual Studio Code, sign in using the Azure CLI in the integrated terminal:
37
36
38
-
On the main menu of Visual Studio Code, navigate to **Terminal > New Terminal**.
37
+
1. Open the terminal in VS Code (**Terminal > New Terminal**).
38
+
1. Sign in to Azure with the following command:
39
39
40
-
Sign-in to Azure through the Azure CLI using the following command:
40
+
```azurecli
41
+
az login
42
+
```
41
43
42
-
```azurecli
43
-
az login
44
-
```
44
+
This method works reliably across Windows, macOS, and Linux.
45
45
46
46
### [PowerShell](#tab/sign-in-powershell)
47
47
48
-
Sign-in to Azure using PowerShell via the following command:
48
+
Signin to Azure using PowerShell via the following command:
0 commit comments