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
# Tutorial: Connect an AKS app to Azure SQL Database (preview)
@@ -21,8 +23,6 @@ In this tutorial, you learn how to connect an application deployed to AKS, to an
21
23
> * Update your application code
22
24
> * Clean up Azure resources.
23
25
24
-
> [!WARNING]
25
-
> Microsoft recommends that you use the most secure authentication flow available. The authentication flow described in this procedure requires a very high degree of trust in the application, and carries risks that are not present in other flows. You should only use this flow when other more secure flows, such as managed identities, aren't viable. See the [tutorial using a managed identity](tutorial-python-aks-storage-workload-identity.md).
26
26
27
27
## Prerequisites
28
28
@@ -62,7 +62,59 @@ az provider register --namespace Microsoft.KubernetesConfiguration
62
62
63
63
### Create a new connection
64
64
65
-
Create a service connection between your AKS cluster and your SQL database in the Azure portal or the Azure CLI.
65
+
::: zone pivot="workload-id"
66
+
67
+
Create a service connection between your AKS cluster and your SQL database using Microsoft Entra Workload ID
68
+
69
+
### [Azure portal](#tab/azure-portal)
70
+
71
+
1. In the [Azure portal](https://portal.azure.com/), navigate to your AKS cluster resource.
3. On the **Basics** tab, configure the following settings:
74
+
75
+
***Kubernetes namespace**: Select **default**.
76
+
***Service type**: Select **SQL Database**.
77
+
***Connection name**: Use the connection name provided by Service Connector or enter your own connection name.
78
+
***Subscription**: Select the subscription that includes the Azure SQL Database service.
79
+
***SQL server**: Select your SQL server.
80
+
***SQL database**: Select your SQL database.
81
+
***Client type**: The code language or framework you use to connect to the target service, such as **Python**.
82
+
83
+
:::image type="content" source="media/tutorial-ask-sql/create-connection.png" alt-text="Screenshot of the Azure portal showing the form to create a new connection to a SQL database in AKS.":::
84
+
85
+
4. Select **Next: Authentication**. On the **Authentication** tab, select **Workload Identity** and choose one **User assigned managed identity**.
6. The Cloud Shell will be launched and execute the commands to create a connection. You may need to confirm some configuration changes during the command processing. Once command runs successfully, it will show connection information, and you can click refresh button in **Service Connector** pane to show the latest result.
88
+
89
+
### [Azure CLI](#tab/azure-cli)
90
+
91
+
Create a service connection to the SQL database using the [`az aks connection create sql`](/cli/azure/aks/connection/create#az-aks-connection-create-sql) command. You can run this command in two different ways:
92
+
93
+
* generate the new connection step by step.
94
+
95
+
```azurecli-interactive
96
+
az aks connection create sql
97
+
```
98
+
99
+
* generate the new connection at once. Make sure you replace the following placeholders with your own information: `<source-subscription>`, `<source_resource_group>`, `<cluster>`, `<target-subscription>`, `<target_resource_group>`, `<server>`, `<database>`, and `<***>`.
> Microsoft recommends that you use the most secure authentication flow available. The authentication flow described in this procedure requires a very high degree of trust in the application, and carries risks that are not present in other flows. You should only use this flow when other more secure flows, such as managed identities, aren't viable. Select the authentication method *[Workload ID (Recommended)](tutorial-python-aks-sql-database-connection-string.md?pivots=workload-id#create-a-new-connection)*.
116
+
117
+
Create a service connection between your AKS cluster and your SQL database using a connection string
66
118
67
119
### [Azure portal](#tab/azure-portal)
68
120
@@ -105,6 +157,8 @@ Create a service connection to the SQL database using the [`az aks connection cr
105
157
106
158
---
107
159
160
+
::: zone-end
161
+
108
162
## Update your container
109
163
110
164
Now that you created a connection between your AKS cluster and the database, you need to retrieve the connection secrets and deploy them in your container.
0 commit comments