Skip to content

Commit 9a58966

Browse files
committed
edits
1 parent ac2d45f commit 9a58966

File tree

2 files changed

+49
-47
lines changed

2 files changed

+49
-47
lines changed

articles/spring-apps/connect-managed-identity-to-azure-sql.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Use Managed identity to connect Azure SQL to Azure Spring Apps app
3-
description: Set up managed identity to connect Azure SQL to an Azure Spring Apps app.
2+
title: Use Managed identity to connect Azure SQL Database to an app deployed to Azure Spring Apps
3+
description: Set up managed identity to connect Azure SQL to an app deployed to Azure Spring Apps.
44
author: karlerickson
55
ms.author: karler
66
ms.service: spring-apps
@@ -9,23 +9,25 @@ ms.date: 09/26/2022
99
ms.custom: devx-track-java, event-tier1-build-2022, passwordless-java, service-connector
1010
---
1111

12-
# Use a managed identity to connect Azure SQL Database to an Azure Spring Apps app
12+
# Use a managed identity to connect Azure SQL Database to an app deployed to Azure Spring Apps
1313

1414
> [!NOTE]
1515
> Azure Spring Apps is the new name for the Azure Spring Cloud service. Although the service has a new name, you'll see the old name in some places for a while as we work to update assets such as screenshots, videos, and diagrams.
1616
1717
**This article applies to:** ✔️ Java ❌ C#
1818

19-
**This article applies to:** ✔️ Basic/Standard tier ✔️ Enterprise tier
19+
**This article applies to:** ✔️ Basic/Standard ✔️ Enterprise
2020

21-
This article shows you how to create a managed identity for an Azure Spring Apps app and use it to access Azure SQL Database.
21+
This article shows you how to create a managed identity for an app deployed to Azure Spring Apps and use it to access Azure SQL Database.
2222

2323
[Azure SQL Database](https://azure.microsoft.com/services/sql-database/) is the intelligent, scalable, relational database service built for the cloud. It’s always up to date, with AI-powered and automated features that optimize performance and durability. Serverless compute and Hyperscale storage options automatically scale resources on demand, so you can focus on building new applications without worrying about storage size or resource management.
2424

2525
## Prerequisites
2626

27+
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
28+
* [Azure CLI](/cli/azure/install-azure-cli) version 2.45.0 or higher.
2729
* Follow the [Spring Data JPA tutorial](/azure/developer/java/spring-framework/configure-spring-data-jpa-with-azure-sql-server) to provision an Azure SQL Database and get it work with a Java app locally
28-
* Follow the [Azure Spring Apps system-assigned managed identity tutorial](./how-to-enable-system-assigned-managed-identity.md) to provision an Azure Spring Apps app with MI enabled
30+
* Follow the [Azure Spring Apps system-assigned managed identity tutorial](./how-to-enable-system-assigned-managed-identity.md) to provision an an in Azure Spring Apps with MI enabled
2931

3032
## Connect to Azure SQL Database with a managed identity
3133

@@ -61,18 +63,15 @@ spring.datasource.url=jdbc:sqlserver://$AZ_DATABASE_NAME.database.windows.net:14
6163

6264
#### [Service Connector](#tab/service-connector)
6365

64-
Configure your app deployed to Azure Spring to connect to an SQL Database with a system-assigned managed identity using the `az spring connection create` command, as shown in the following example.
66+
Configure your app deployed to Azure Spring Apps to connect to an Azure SQL Database with a system-assigned managed identity using the `az spring connection create` command, as shown in the following example.
6567

66-
> [!NOTE]
67-
> These commands require [Azure CLI](/cli/azure/install-azure-cli) version 2.45.0 or higher.
68-
69-
1. Install the Service Connector passwordless extension for the Azure CLI.
68+
1. Use the following command to install the Service Connector passwordless extension for the Azure CLI:
7069

7170
```azurecli
7271
az extension add --name serviceconnector-passwordless --upgrade
7372
```
7473

75-
2. Run the `az spring connection create` command, as shown in the following example.
74+
1. Use the following command to connect to the database:
7675

7776
```azurecli
7877
az spring connection create sql \
@@ -85,7 +84,9 @@ Configure your app deployed to Azure Spring to connect to an SQL Database with a
8584
--database $DATABASE_NAME \
8685
--system-identity
8786
```
88-
3. Run the `az spring connection list-configuration` command as below to check the creation result.
87+
88+
1. Use the following command to check the creation result:
89+
8990
```azurecli
9091
CONNECTION_NAME=$(az spring connection list \
9192
--resource-group $SPRING_APP_RESOURCE_GROUP \
@@ -99,7 +100,8 @@ Configure your app deployed to Azure Spring to connect to an SQL Database with a
99100
--service $SPRING_APP_SERVICE_NAME \
100101
--app $APP_NAME \
101102
--connection $CONNECTION_NAME
102-
```
103+
```
104+
103105
---
104106

105107
## Build and deploy the app to Azure Spring Apps

articles/spring-apps/how-to-bind-cosmos.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.custom: devx-track-java, event-tier1-build-2022, ignite-2022, service-connect
1616
1717
**This article applies to:** ✔️ Java ❌ C#
1818

19-
**This article applies to:** ✔️ Basic/Standard tier ✔️ Enterprise tier
19+
**This article applies to:** ✔️ Basic/Standard ✔️ Enterprise
2020

2121
Instead of manually configuring your Spring Boot applications, you can automatically bind select Azure services to your applications by using Azure Spring Apps. This article demonstrates how to bind your application to an Azure Cosmos DB database.
2222

@@ -76,50 +76,50 @@ If you don't have a deployed Azure Spring Apps instance, follow the steps in the
7676

7777
### [Service Connector](#tab/Service-Connector)
7878

79-
#### Using Azure CLI
79+
#### Use the Azure CLI
8080

81-
1. Use the Azure CLI to configure your Spring app to connect to a Cosmos SQL Database with a system-assigned managed identity by using the `az spring connection create` command, as shown in the following example.
81+
Use the following command to configure your Spring app to connect to a Cosmos SQL Database with a system-assigned managed identity:
8282

83-
> [!NOTE]
84-
> Updating Azure Cosmos DB database settings can take a few minutes to complete.
85-
86-
```azurecli
87-
az spring connection create cosmos-sql \
88-
--resource-group $AZURE_SPRING_APPS_RESOURCE_GROUP \
89-
--service $AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME \
90-
--app $APP_NAME \
91-
--deployment $DEPLOYMENT_NAME \
92-
--target-resource-group $COSMOSDB_RESOURCE_GROUP \
93-
--account $COSMOSDB_ACCOUNT_NAME \
94-
--database $DATABASE_NAME \
95-
--system-assigned-identity
96-
```
83+
> [!NOTE]
84+
> Updating Azure Cosmos DB database settings can take a few minutes to complete.
85+
86+
```azurecli
87+
az spring connection create cosmos-sql \
88+
--resource-group $AZURE_SPRING_APPS_RESOURCE_GROUP \
89+
--service $AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME \
90+
--app $APP_NAME \
91+
--deployment $DEPLOYMENT_NAME \
92+
--target-resource-group $COSMOSDB_RESOURCE_GROUP \
93+
--account $COSMOSDB_ACCOUNT_NAME \
94+
--database $DATABASE_NAME \
95+
--system-assigned-identity
96+
```
9797

98-
> [!NOTE]
99-
> If you're using [Service Connector](../service-connector/overview.md) for the first time, start by running the command `az provider register --namespace Microsoft.ServiceLinker` to register the Service Connector resource provider.
100-
>
101-
> If you're using Cosmos Cassandra, use a `--key_space` instead of `--database`.
98+
> [!NOTE]
99+
> If you're using [Service Connector](../service-connector/overview.md) for the first time, start by running the command `az provider register --namespace Microsoft.ServiceLinker` to register the Service Connector resource provider.
100+
>
101+
> If you're using Cosmos Cassandra, use a `--key_space` instead of `--database`.
102102
103-
> [!TIP]
104-
> Run the command `az spring connection list-support-types --output table` to get a list of supported target services and authentication methods for Azure Spring Apps. If the `az spring` command isn't recognized by the system, check that you have installed the required extension by running `az extension add --name spring`.
103+
> [!TIP]
104+
> Run the command `az spring connection list-support-types --output table` to get a list of supported target services and authentication methods for Azure Spring Apps. If the `az spring` command isn't recognized by the system, check that you have installed the required extension by running `az extension add --name spring`.
105105
106-
#### Using Azure Portal
106+
#### Use the Azure portal
107107

108-
1. Alternately, you can use the Azure portal to configure this connection by completing the following steps. The Azure portal provides the same capabilities as the Azure CLI and provides an interactive experience.
108+
Alternately, you can use the Azure portal to configure this connection by completing the following steps. The Azure portal provides the same capabilities as the Azure CLI and provides an interactive experience.
109109

110-
1. Select your Azure Spring Apps instance in the Azure portal and select **Apps** from the navigation menu. Choose the app you want to connect and select **Service Connector** on the navigation menu.
110+
1. Select your Azure Spring Apps instance in the Azure portal and select **Apps** from the navigation menu. Choose the app you want to connect and select **Service Connector** on the navigation menu.
111111

112-
1. Select **Create**.
112+
1. Select **Create**.
113113

114-
1. On the **Basics** tab, for service type, select Cosmos DB, then choose a subscription. For API type, select Core (SQL), choose a Cosmos DB account, and a database. For client type, select Java, then select **Next: Authentication**. If you haven't created your database yet, see [Quickstart: Create an Azure Cosmos DB account, database, container, and items from the Azure portal](../cosmos-db/nosql/quickstart-portal.md).
114+
1. On the **Basics** tab, for service type, select Cosmos DB, then choose a subscription. For API type, select Core (SQL), choose a Cosmos DB account, and a database. For client type, select Java, then select **Next: Authentication**. If you haven't created your database yet, see [Quickstart: Create an Azure Cosmos DB account, database, container, and items from the Azure portal](../cosmos-db/nosql/quickstart-portal.md).
115115

116-
1. On the **Authentication** tab, choose **Connection string**. Service Connector automatically retrieves the access key from your Cosmos DB account. Select **Next: Networking**.
116+
1. On the **Authentication** tab, choose **Connection string**. Service Connector automatically retrieves the access key from your Cosmos DB account. Select **Next: Networking**.
117117

118-
1. On the **Networking** tab, select **Configure firewall rules to enable access to target service**, then select **Next: Review + Create**.
118+
1. On the **Networking** tab, select **Configure firewall rules to enable access to target service**, then select **Next: Review + Create**.
119119

120-
1. On the **Review + Create** tab, wait for the validation to pass and then select **Create**. The creation can take a few minutes to complete.
120+
1. On the **Review + Create** tab, wait for the validation to pass and then select **Create**. The creation can take a few minutes to complete.
121121

122-
1. Once the connection between your Spring apps and your Cosmos DB database has been generated, you can see it in the Service Connector page and select the unfold button to view the configured connection variables.
122+
1. Once the connection between your Spring apps and your Cosmos DB database has been generated, you can see it in the Service Connector page and select the unfold button to view the configured connection variables.
123123

124124
### [Service Binding](#tab/Service-Binding)
125125

@@ -156,7 +156,7 @@ Azure Cosmos DB has five different API types that support binding. The following
156156

157157
### [Terraform](#tab/Terraform)
158158

159-
The following Terraform script shows how to set up an Azure Spring Apps app with an Azure Cosmos DB account.
159+
The following Terraform script shows how to set up an app deployed to Azure Spring Apps with an Azure Cosmos DB account.
160160

161161
```terraform
162162
provider "azurerm" {

0 commit comments

Comments
 (0)