|
1 | 1 | ---
|
2 |
| -title: Quickstart - Create a service connection in Spring Cloud with the Azure CLI |
3 |
| -description: Quickstart showing how to create a service connection in Spring Cloud with the Azure CLI |
4 |
| -author: shizn |
5 |
| -ms.author: xshi |
| 2 | +title: Quickstart - Create a service connection in Azure Spring Apps with the Azure CLI |
| 3 | +description: Quickstart showing how to create a service connection in Azure Spring Apps with the Azure CLI |
| 4 | +displayName: |
| 5 | +author: maud-lv |
| 6 | +ms.author: malev |
6 | 7 | ms.service: service-connector
|
7 | 8 | ms.topic: quickstart
|
8 |
| -ms.date: 03/24/2022 |
| 9 | +ms.date: 08/09/2022 |
9 | 10 | ms.devlang: azurecli
|
10 |
| -ms.custom: event-tier1-build-2022 |
| 11 | +ms.custom: event-tier1-build-2022, devx-track-azurecli |
11 | 12 | ---
|
12 | 13 |
|
13 |
| -# Quickstart: Create a service connection in Spring Cloud with the Azure CLI |
| 14 | +# Quickstart: Create a service connection in Azure Spring Apps with the Azure CLI |
14 | 15 |
|
15 |
| -The [Azure CLI](/cli/azure) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation. This quickstart shows you several options to create an Azure Web PubSub instance with the Azure CLI. |
| 16 | +This quickstart shows you how to connect Azure Spring Apps to other Cloud resources using the Azure CLI and Service Connector. |
16 | 17 |
|
17 |
| -[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)] |
| 18 | +Service Connector lets you quickly connect compute services to cloud services, while managing your connection's authentication and networking settings. |
18 | 19 |
|
19 |
| -[!INCLUDE [azure-cli-prepare-your-environment.md](../../includes/azure-cli-prepare-your-environment.md)] |
| 20 | +## Prerequisites |
20 | 21 |
|
21 |
| -- Version 2.30.0 or higher of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed. |
| 22 | +- An Azure subscription. [!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)] |
22 | 23 |
|
23 |
| -- At least one Spring Cloud application running on Azure. If you don't have a Spring Cloud application, [create one](../spring-apps/quickstart.md). |
| 24 | +- At least one application hosted by Azure Spring Apps in a [region supported by Service Connector](./concept-region-support.md). If you don't have one, [deploy your first application to Azure Spring Apps](../spring-apps/quickstart.md). |
24 | 25 |
|
25 |
| -## View supported target service types |
| 26 | +[!INCLUDE [azure-cli-prepare-your-environment-no-header.md](../../includes/azure-cli-prepare-your-environment-no-header.md)] |
26 | 27 |
|
27 |
| -Use the Azure CLI [[az spring-cloud connection](quickstart-cli-spring-cloud-connection.md)] command to create and manage service connections to your Spring Cloud application. |
| 28 | +- Version 2.37.0 or higher of the Azure CLI must be installed. To upgrade to the latest version, run `az upgrade`. If using Azure Cloud Shell, the latest version is already installed. |
28 | 29 |
|
29 |
| -```azurecli-interactive |
30 |
| -az provider register -n Microsoft.ServiceLinker |
31 |
| -az spring-cloud connection list-support-types --output table |
32 |
| -``` |
| 30 | +- The Azure Spring Apps extension must be installed in the Azure CLI or the Cloud Shell. To install it, run `az extension add --name spring`. |
| 31 | + |
| 32 | +## Prepare to create a connection |
| 33 | + |
| 34 | +1. 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. |
| 35 | + |
| 36 | + ```azurecli-interactive |
| 37 | + az provider register -n Microsoft.ServiceLinker |
| 38 | + ``` |
| 39 | +
|
| 40 | +1. Run the command `az spring connection` to get a list of supported target services for Azure Spring Apps. |
| 41 | +
|
| 42 | + ```azurecli-interactive |
| 43 | + az spring connection list-support-types --output table |
| 44 | + ``` |
| 45 | +
|
| 46 | + > [!TIP] |
| 47 | + > 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`. |
33 | 48 |
|
34 | 49 | ## Create a service connection
|
35 | 50 |
|
36 |
| -### [Using an access key](#tab/Using-access-key) |
| 51 | +You can create a connection from Azure Spring Apps using an access key or a managed identity. |
37 | 52 |
|
38 |
| -Use the Azure CLI command `az spring-cloud connection` to create a service connection to an Azure Blob Storage with an access key, providing the following information: |
| 53 | +### [Access key](#tab/Using-access-key) |
39 | 54 |
|
40 |
| -- **Spring Cloud resource group name:** the resource group name of the Spring Cloud. |
41 |
| -- **Spring Cloud name:** the name of your Spring Cloud. |
42 |
| -- **Spring Cloud app name:** the name of your Spring Cloud app that connects to the target service. |
43 |
| -- **Target service resource group name:** the resource group name of the Blob Storage. |
44 |
| -- **Storage account name:** the account name of your Blob Storage. |
| 55 | +1. Run the `az spring connection create` command to create a service connection between Azure Spring Apps and an Azure Blob Storage with an access key. |
45 | 56 |
|
46 |
| -```azurecli-interactive |
47 |
| -az spring-cloud connection create storage-blob --secret |
48 |
| -``` |
| 57 | + ```azurecli-interactive |
| 58 | + az spring connection create storage-blob --secret |
| 59 | + ``` |
49 | 60 |
|
50 |
| -> [!NOTE] |
51 |
| -> If you don't have a Blob Storage, you can run `az spring-cloud connection create storage-blob --new --secret` to provision a new one and directly get connected to your app service. |
| 61 | +1. Provide the following information at the CLI or Cloud Shell's request: |
52 | 62 |
|
53 |
| -### [Using Managed Identity](#tab/Using-Managed-Identity) |
| 63 | + | Setting | Description | |
| 64 | + |---------------------------------------------------------|----------------------------------------------------------------------------------------------------| |
| 65 | + | `The resource group which contains the spring-cloud` | The name of the resource group that contains app hosted by Azure Spring Apps. | |
| 66 | + | `Name of the spring-cloud service` | The name of the Azure Spring Apps resource. | |
| 67 | + | `Name of the spring-cloud app` | The name of the application hosted by Azure Spring Apps that connects to the target service. | |
| 68 | + | `The resource group which contains the storage account` | The name of the resource group with the storage account. | |
| 69 | + | `Name of the storage account` | The name of the storage account you want to connect to. In this guide, we're using a Blob Storage. | |
| 70 | +
|
| 71 | +> [!TIP] |
| 72 | +> If you don't have a Blob Storage, you can run `az spring connection create storage-blob --new --secret` to provision a new Blob Storage and directly connect it to your application hosted by Azure Spring Apps using a connection string. |
| 73 | +
|
| 74 | +### [Managed Identity](#tab/Using-Managed-Identity) |
54 | 75 |
|
55 | 76 | > [!IMPORTANT]
|
56 |
| -> To use Managed Identity, you must have permission to manage [role assignments in Azure Active Directory](../active-directory/managed-identities-azure-resources/howto-assign-access-portal.md). If you don't have this permission, your connection creation will fail. You can ask your subscription owner to grant you a role assignment permission or use an access key to create the connection. |
| 77 | +> To use Managed Identity, you must have the permission to modify [role assignments in Azure Active Directory](../active-directory/managed-identities-azure-resources/howto-assign-access-portal.md). Without this permission, your connection creation will fail. Ask your subscription owner to grant you a role assignment permission or use an access key to create the connection. |
57 | 78 |
|
58 |
| -Use the Azure CLI command `az spring-cloud connection` to create a service connection to a Blob Storage with System-assigned Managed Identity, providing the following information: |
| 79 | +1. Run the `az spring connection create` command to create a service connection to a Blob Storage with a system-assigned managed identity |
59 | 80 |
|
60 |
| -- **Spring Cloud resource group name:** the resource group name of the Spring Cloud. |
61 |
| -- **Spring Cloud name:** the name of your Spring Cloud. |
62 |
| -- **Spring Cloud app name:** the name of your Spring Cloud app that connects to the target service. |
63 |
| -- **Target service resource group name:** the resource group name of the Blob Storage. |
64 |
| -- **Storage account name:** the account name of your Blob Storage. |
| 81 | +1. Provide the following information at the CLI or Cloud Shell's request: |
65 | 82 |
|
66 |
| -```azurecli-interactive |
67 |
| -az spring-cloud connection create storage-blob --system-identity |
68 |
| -``` |
| 83 | + ```azurecli-interactive |
| 84 | + az spring connection create storage-blob --system-identity |
| 85 | + ``` |
| 86 | +
|
| 87 | + | Setting | Description | |
| 88 | + |---------------------------------------------------------|----------------------------------------------------------------------------------------------------| |
| 89 | + | `The resource group which contains the spring-cloud` | The name of the resource group that contains an app hosted by Azure Spring Apps. | |
| 90 | + | `Name of the spring-cloud service` | The name of the Azure Spring Apps resource. | |
| 91 | + | `Name of the spring-cloud app` | The name of the application hosted by Azure Spring Apps that connects to the target service. | |
| 92 | + | `The resource group which contains the storage account` | The name of the resource group with the storage account. | |
| 93 | + | `Name of the storage account` | The name of the storage account you want to connect to. In this guide, we're using a Blob Storage. | |
69 | 94 |
|
70 |
| -> [!NOTE] |
71 |
| -> If you don't have a Blob Storage, you can run `az spring-cloud connection create --system-identity --new --secret` to provision a new one and directly get connected to your app service. |
| 95 | +> [!TIP] |
| 96 | +> If you don't have a Blob Storage, you can run `az spring connection create storage-blob --new --system-identity` to provision a new Blob Storage and directly connect it to your application hosted by Azure Spring Apps using a managed identity. |
72 | 97 |
|
73 | 98 | ---
|
74 | 99 |
|
75 | 100 | ## View connections
|
76 | 101 |
|
77 |
| -Use the Azure CLI [az spring-cloud connection](quickstart-cli-spring-cloud-connection.md) command to list connection to your Spring Cloud application, providing the following information: |
| 102 | +Run `az spring connection list` command to list all of your Azure Spring Apps' provisioned connections. |
| 103 | +
|
| 104 | +Replace the placeholders `<azure-spring-apps-resource-group>`, `<azure-spring-apps-name>`, and `<app-name>` from the command below with the name of your Azure Spring Apps resource group, the name of your Azure Spring Apps resource, and the name of your application. You can also remove the `--output table` option to view more information about your connections. |
78 | 105 |
|
79 | 106 | ```azurecli-interactive
|
80 |
| -az spring-cloud connection list -g <your-spring-cloud-resource-group> --spring-cloud <your-spring-cloud-name> |
| 107 | +az spring connection list --resource-group <azure-spring-apps-resource-group> --service <azure-spring-apps-name> --app <app-name>--output table |
81 | 108 | ```
|
82 | 109 |
|
| 110 | +The output also displays the provisioning state of your connections: failed or succeeded. |
| 111 | + |
83 | 112 | ## Next steps
|
84 | 113 |
|
85 |
| -Follow the tutorials listed below to start building your own application with Service Connector. |
| 114 | +Check the guides below for more information about Service Connector and Azure Spring Apps: |
| 115 | + |
| 116 | +> [!div class="nextstepaction"] |
| 117 | +> [Tutorial: Azure Spring Apps + MySQL](./tutorial-java-spring-mysql.md) |
86 | 118 |
|
87 | 119 | > [!div class="nextstepaction"]
|
88 |
| -> [Tutorial: Spring Cloud + MySQL](./tutorial-java-spring-mysql.md) |
89 |
| -> [Tutorial: Spring Cloud + Apache Kafka on Confluent Cloud](./tutorial-java-spring-confluent-kafka.md) |
| 120 | +> [Tutorial: Azure Spring Apps + Apache Kafka on Confluent Cloud](./tutorial-java-spring-confluent-kafka.md) |
0 commit comments