Skip to content

Commit 7f7dcd4

Browse files
committed
add workload id in aks tutorial
1 parent 1ee6d67 commit 7f7dcd4

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

articles/service-connector/tutorial-python-aks-sql-database-connection-string.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ ms.author: malev
88
ms.service: service-connector
99
ms.topic: tutorial
1010
ms.date: 07/23/2024
11+
zone_pivot_group_filename: service-connector/zone-pivot-groups.json
12+
zone_pivot_groups: howto-authtype
1113
---
1214

1315
# Tutorial: Connect an AKS app to Azure SQL Database (preview)
@@ -64,6 +66,8 @@ az provider register --namespace Microsoft.KubernetesConfiguration
6466

6567
Create a service connection between your AKS cluster and your SQL database in the Azure portal or the Azure CLI.
6668

69+
::: zone pivot="connection-string"
70+
6771
### [Azure portal](#tab/azure-portal)
6872

6973
1. In the [Azure portal](https://portal.azure.com/), navigate to your AKS cluster resource.
@@ -105,6 +109,53 @@ Create a service connection to the SQL database using the [`az aks connection cr
105109
106110
---
107111
112+
::: zone-end
113+
114+
::: zone pivot="workload-id"
115+
116+
### [Azure portal](#tab/azure-portal)
117+
118+
1. In the [Azure portal](https://portal.azure.com/), navigate to your AKS cluster resource.
119+
2. Select **Settings** > **Service Connector (Preview)** > **Create**.
120+
3. On the **Basics** tab, configure the following settings:
121+
122+
* **Kubernetes namespace**: Select **default**.
123+
* **Service type**: Select **SQL Database**.
124+
* **Connection name**: Use the connection name provided by Service Connector or enter your own connection name.
125+
* **Subscription**: Select the subscription that includes the Azure SQL Database service.
126+
* **SQL server**: Select your SQL server.
127+
* **SQL database**: Select your SQL database.
128+
* **Client type**: The code language or framework you use to connect to the target service, such as **Python**.
129+
130+
:::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.":::
131+
132+
4. Select **Next: Authentication**. On the **Authentication** tab, select **Workload Identity** and choose one **User assigned managed identity**.
133+
5. Select **Next: Networking** > **Next: Review + create** >**Create On Cloud Shell**.
134+
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.
135+
136+
### [Azure CLI](#tab/azure-cli)
137+
138+
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:
139+
140+
* generate the new connection step by step.
141+
142+
```azurecli-interactive
143+
az aks connection create sql
144+
```
145+
146+
* 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 `<***>`.
147+
148+
```azurecli-interactive
149+
az aks connection create sql \
150+
--source-id /subscriptions/<source-subscription>/resourceGroups/<source_resource_group>/providers/Microsoft.ContainerService/managedClusters/<cluster> \
151+
--target-id /subscriptions/<target-subscription>/resourceGroups/<target_resource_group>/providers/Microsoft.Sql/servers/<server>/databases/<database> \
152+
--workload-identity /subscriptions/<identity-subscription>/resourcegroups/<resource_group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity_name>
153+
```
154+
155+
---
156+
157+
::: zone-end
158+
108159
## Update your container
109160
110161
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.

articles/service-connector/zone-pivot-groups.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ groups:
2424
title: Connection string
2525
- id: service-principal
2626
title: Service principal
27+
- id: workload-id
28+
title: Workload ID

0 commit comments

Comments
 (0)