Skip to content

Commit 3a36f46

Browse files
Apply suggestions from code review
Co-authored-by: Erin Schaffer <[email protected]>
1 parent 021feeb commit 3a36f46

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed

articles/service-connector/tutorial-aks-sql.md

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -29,113 +29,113 @@ In this tutorial, you learn how to connect an application deployed to AKS, to an
2929

3030
## Create an Azure SQL Database
3131

32-
1. Create a resource group for this tutorial, where you'll store your Azure resources.
32+
1. Create a resource group to store the Azure resources you create in this tutorial using the [`az group create`](/cli/azure/group#az_group_create) command.
3333

3434
```azurecli-interactive
3535
az group create \
36-
--name MyResourceGroup \
36+
--name $RESOURCE_GROUP \
3737
--location eastus
3838
```
3939
40-
1. Follow these instructions to [create an Azure SQL Database](/azure/azure-sql/database/single-database-create-quickstart) in the resource group you created. Note your server name, database name, and the database credentials. You will need them later on.
40+
1. Follow the instructions to [create an Azure SQL Database](/azure/azure-sql/database/single-database-create-quickstart) in the resource group you created in the previous step. Make note of the server name, database name, and the database credentials for use throughout this tutorial.
4141
4242
## Create a service connection in AKS with Service Connector (preview)
4343
4444
### Register the Service Connector resource provider
4545
46-
If you're using Service Connector for the first time, start by running the command [az provider register](/cli/azure/provider#az-provider-register) to register the Service Connector resource provider.
46+
* If you're using Service Connector for the first time, register the Service Connector resource provider using the [`az provider register`](/cli/azure/provider#az-provider-register) command.
4747
48-
```azurecli
49-
az provider register -n Microsoft.ServiceLinker
50-
```
48+
```azurecli-interactive
49+
az provider register --namespace Microsoft.ServiceLinker
50+
```
5151
52-
> [!TIP]
53-
> You can check if the resource provider has already been registered by running the command `az provider show -n "Microsoft.ServiceLinker" --query registrationState`. If the output is `Registered`, then Service Connector has already been registered.
52+
> [!TIP]
53+
> You can check if the resource provider is already registered using the `az provider show --namespace "Microsoft.ServiceLinker" --query registrationState` command. If the output is `Registered`, then Service Connector is already registered.
5454
5555
<!-- check if registering RP is still necessary-->
5656
5757
### Create a new connection
5858
5959
Create a service connection between your AKS cluster and your SQL database in the Azure portal or the Azure CLI.
6060
61-
### [Portal](#tab/azure-portal)
61+
### [Azure portal](#tab/azure-portal)
6262
63-
Open your AKS cluster in the Azure portal, and select **Settings** > **Service Connector (Preview)** in the left menu. Select **Create** and select or enter information following the instructions and examples below. Leave all other settings with their default values.
63+
1. In the [Azure portal](https://portal.azure.com/), navigate to your AKS cluster resource.
64+
2. Select **Settings** > **Service Connector (Preview)** > **Create**.
65+
3. On the **Basics** tab, configure the following settings:
6466
65-
1. Basics tab:
66-
67-
| Setting | Example value | Description |
68-
|--------------------------|-------------------|------------------------------------------------------------------------------------------|
69-
| **Kubernetes namespace** | *default* | The Kubernetes service namespace. |
70-
| **Service type** | *SQL Database* | Select the target service type you want to connect your. |
71-
| **Connection name** | *sql_connection* | Use the connection name provided by Service Connector or enter your own connection name. |
72-
| **Subscription** | *My Subscription* | Select the subscription that includes the Azure SQL Database service. |
73-
| **SQL server** | *sql_server* | Select your SQL server. |
74-
| **SQL database** | *sql_db* | Select your SQL database. |
75-
| **Client type** | *Python* | The code language or framework you use to connect to the target service. |
67+
* **Kubernetes namespace**: Select **default**.
68+
* **Service type**: Select **SQL Database**.
69+
* **Connection name**: Use the connection name provided by Service Connector or enter your own connection name.
70+
* **Subscription**: Select the subscription that includes the Azure SQL Database service.
71+
* **SQL server**: Select your SQL server.
72+
* **SQL database**: Select your SQL database.
73+
* **Client type**: The code language or framework you use to connect to the target service, such as **Python**.
7674
7775
:::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.":::
7876
79-
1. In the authentication tab, the connection string authentication method is selected by default, as it's the only method currently supported. Enter your database username and password.
77+
4. Select **Next: Authentication**. On the **Authentication** tab, enter your database username and password.
78+
5. Select **Next: Networking** > **Next: Review + create** >**Create**.
79+
6. Once the deployment is successful, you can view information about the new connection in the **Service Connector** pane.
8080
81-
1. Select **Next** until you reach the **Review + Create** tab that lists a summary of the configuration entered for the connection. If you're satisfied with the configuration, select **Create**.
81+
### [Azure CLI](#tab/azure-cli)
8282
83-
1. Once the deployment is successful, you can view information about the new connection in the **Service Connector** pane.
84-
85-
## [Azure CLI](#tab/azure-cli)
86-
87-
1. Get access credentials for your AKS cluster using the [az aks get-credentials](/cli/azure/aks#az-aks-get-credentials) command.
83+
1. Get access credentials for your AKS cluster using the [`az aks get-credentials`](/cli/azure/aks#az-aks-get-credentials) command.
8884
8985
```azurecli-interactive
9086
az aks get-credentials \
91-
--resource-group MyResourceGroup \
92-
--name MyAKSCluster
87+
--resource-group $RESOURCE_GROUP \
88+
--name $CLUSTER_NAME
9389
```
9490
95-
1. Use the Azure CLI command [az aks connection create sql](/cli/azure/aks/connection/create#az-aks-connection-create-sql) to create a service connection to the SQL database. There are several ways you can construct this command. For example:
91+
1. 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.
9692
97-
- run the following interactive command to generate the new connection step by step.
93+
* Generate the new connection step by step.
9894
99-
```azurecli
95+
```azurecli-interactive
10096
az aks connection create sql
10197
```
10298
103-
- or run a command following the example below. Replace the placeholders `<source-subscription>`, `<source_resource_group>`, `<cluster>`, `<target-subscription>`, `<target_resource_group>`, `<server>`, `<database>`, and `<***>` with your own information.
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 `<***>`.
104100
105-
```azurecli
101+
```azurecli-interactive
106102
az aks connection create sql \
107103
--source-id /subscriptions/<source-subscription>/resourceGroups/<source_resource_group>/providers/Microsoft.ContainerService/managedClusters/<cluster> \
108-
--target-id /subscriptions/<target-subscription>/resourceGroups/<target_resource_group>/providers/Microsoft.Sql/servers/<server>/databases/<database> --secret name=<secret-name> secret=<secret>
104+
--target-id /subscriptions/<target-subscription>/resourceGroups/<target_resource_group>/providers/Microsoft.Sql/servers/<server>/databases/<database> \
105+
--secret name=<secret-name> secret=<secret>
109106
```
110107
111108
---
112109
113-
### Update your container
110+
## Update your container
114111
115-
Now that the connection between your AKS cluster and the database is created, retrieve the connection secrets and deploy them in your container.
112+
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.
116113
117-
1. In the **Service Connector (Preview)** menu, select the newly created connection using the checkbox. Then, select **Yaml snippet**. This action opens a panel displaying a sample YAML file generated by Service Connector.
114+
1. In the [Azure portal](https://portal.azure.com/) navigate to your AKS cluster resource and select **Service Connector (Preview)**.
115+
1. Select the newly created connection, and then select **YAML snippet**. This action opens a panel displaying a sample YAML file generated by Service Connector.
118116
1. To set the connection secrets as environment variables in your container, you have two options:
119-
- Directly create a deployment using the YAML sample code snippet provided. The snippet includes highlighted sections showing the secret object that will be injected as the environment variables. Select **Apply** to proceed with this method.
117+
118+
* Directly create a deployment using the YAML sample code snippet provided. The snippet includes highlighted sections showing the secret object that will be injected as the environment variables. Select **Apply** to proceed with this method.
120119
121-
:::image type="content" source="media/tutorial-ask-sql/sample-yaml-snippet.png" alt-text="Screenshot of the Azure portal showing the sample YAML snippet to create a new connection to a SQL database in AKS.":::
120+
:::image type="content" source="media/tutorial-ask-sql/sample-yaml-snippet.png" alt-text="Screenshot of the Azure portal showing the sample YAML snippet to create a new connection to a SQL database in AKS.":::
122121
123-
- Alternatively, under **Resource Type**, select **Kubernetes Workload** and select an existing Kubernetes workload. This action sets the secret object of your new connection as the environment variables for the selected workload. After selecting the workload, select **Apply** to use this method.
122+
* Alternatively, under **Resource Type**, select **Kubernetes Workload**, and then select an existing Kubernetes workload. This action sets the secret object of your new connection as the environment variables for the selected workload. After selecting the workload, select **Apply**.
124123
125-
:::image type="content" source="media/tutorial-ask-sql/kubernetes-snippet.png" alt-text="Screenshot of the Azure portal showing the Kubernetes snippet to create a new connection to a SQL database in AKS.":::
124+
:::image type="content" source="media/tutorial-ask-sql/kubernetes-snippet.png" alt-text="Screenshot of the Azure portal showing the Kubernetes snippet to create a new connection to a SQL database in AKS.":::
126125
127-
### Update your application code
126+
## Update your application code
128127
129-
As a final step, update your application code to use your environment variables, [following these instructions](how-to-integrate-sql-database.md#connection-string).
128+
* As a final step, update your application code to use your environment variables, by [following these instructions](how-to-integrate-sql-database.md#connection-string).
130129
131130
## Clean up resources
132131
133-
If you no longer need the resources you created when following this tutorial, remove them by deleting the resource group.
132+
If you no longer need the resources you created when following this tutorial, you can remove them by deleting the Azure resource group.
133+
134+
* Delete your resource group using the [`az group delete`](/cli/azure/group#az_group_delete) command.
134135
135-
```azurecli-interactive
136-
az group delete \
137-
--resource-group MyResourceGroup
138-
```
136+
```azurecli-interactive
137+
az group delete --resource-group $RESOURCE_GROUP
138+
```
139139
140140
## Related content
141141

0 commit comments

Comments
 (0)