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
Copy file name to clipboardExpand all lines: articles/service-connector/quickstart-cli-container-apps.md
+49-39Lines changed: 49 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,91 +5,101 @@ author: maud-lv
5
5
ms.author: malev
6
6
ms.service: service-connector
7
7
ms.topic: quickstart
8
-
ms.date: 05/24/2022
8
+
ms.date: 08/09/2022
9
9
ms.devlang: azurecli
10
10
---
11
11
12
12
# Quickstart: Create a service connection in Container Apps with the Azure CLI
13
13
14
-
This quickstart shows you how to create a service connection in Container Apps with the Azure CLI. 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.
14
+
This quickstart shows you how to connect Azure Container Apps to other Cloud resources using the Azure CLIand Service Connector. Service Connector lets you quickly connect compute services to cloud services, while managing your connection's authentication and networking settings.
> Service Connector in Container Apps is currently in preview.
18
+
> See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
-An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
24
+
-At least one application deployed to Container Apps in a [region supported by Service Connector](./concept-region-support.md). If you don't have one, [create and deploy a container to Container Apps](../container-apps/quickstart-portal.md).
23
25
24
-
- An application deployed to Container Apps in a [region supported by Service Connector](./concept-region-support.md). If you don't have one yet, [create and deploy a container to Container Apps](../container-apps/quickstart-portal.md).
> Service Connector in Container Apps is currently in preview.
28
-
> See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
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.
29
29
30
-
## View supported target services
30
+
- The Container Apps extension must be installed in the Azure CLI or the Cloud Shell. To install it, run `az extension add --name containerapp`.
31
31
32
-
Use the following Azure CLI command to create and manage service connections from Container Apps.
32
+
## Prepare to create a connection
33
33
34
-
```azurecli-interactive
35
-
az provider register -n Microsoft.ServiceLinker
36
-
az containerapp connection list-support-types --output table
37
-
```
34
+
1. Run the command [az provider register](/cli/azure/provider#az-provider-register) to start using Service Connector.
35
+
36
+
```azurecli-interactive
37
+
az provider register -n Microsoft.ServiceLinker
38
+
```
39
+
40
+
1. Run the command `az containerapp connection` to get a list of supported target services for Container Apps.
41
+
42
+
```azurecli-interactive
43
+
az containerapp connection list-support-types --output table
44
+
```
38
45
39
46
## Create a service connection
40
47
41
-
### [Using an access key](#tab/using-access-key)
48
+
You can create a connection using an access key or a managed identity.
49
+
50
+
### [Access key](#tab/using-access-key)
42
51
43
-
1.Use the following Azure CLI command to create a service connection from Container Apps to a Blob Storage with an access key.
52
+
1. Run the `az containerapp connection create` command to create a service connection between Container Apps and Azure Blob Storage with an access key.
44
53
45
54
```azurecli-interactive
46
55
az containerapp connection create storage-blob --secret
47
56
```
48
57
49
58
1. Provide the following information at the Azure CLI's request:
50
59
51
-
- **The resource group which contains the container app**: the name of the resource group with the container app.
52
-
- **Name of the container app**: the name of your container app.
53
-
- **The container where the connection information will be saved:** the name of the container, in your container app, that connects to the target service
54
-
- **The resource group which contains the storage account:** the name of the resource group name with the storage account. In this guide, we're using a Blob Storage.
55
-
- **Name of the storage account:** the name of the storage account that contains your blob.
| `The resource group that contains the container app` | The name of the resource group with the container app. |
63
+
| `Name of the container app` | The name of the container app. |
64
+
| `The container where the connection information will be saved` | The name of the container app's container. |
65
+
| `The resource group which contains the storage account` | The name of the resource group with the storage account. |
66
+
| `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. |
56
67
57
-
> [!NOTE]
58
-
> If you don't have a Blob Storage, you can run `az containerapp connection create storage-blob --new --secret` to provision a new Blob Storage and directly get connected to your app service.
68
+
> [!TIP]
69
+
> If you don't have a Blob Storage, you can run `az containerapp connection create storage-blob --new --secret` to provision a new Blob Storage and directly connect it to your container app using a connection string.
59
70
60
-
### [Using a managed identity](#tab/using-managed-identity)
> Using a managed identity requires you have the permission to [Azure AD role assignment](../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 this permission, or use an access key instead to create the connection.
74
+
> To use a managed identity, you must have the permission to modify [Azure AD role assignment](../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 this permission, or use an access key instead to create the connection.
64
75
65
-
1. Use the following Azure CLI command to create a service connection from Container Apps to a Blob Storage with a system-assigned managed identity.
76
+
1. Run the `az containerapp connection create` command to create a service connection from Container Apps to a Blob Storage with a system-assigned managed identity.
66
77
67
78
```azurecli-interactive
68
79
az containerapp connection create storage-blob --system-identity
69
80
```
70
81
71
82
1. Provide the following information at the Azure CLI's request:
72
83
73
-
- **The resource group which contains the container app**: the name of the resource group with the container app.
74
-
- **Name of the container app**: the name of your container app.
75
-
- **The container where the connection information will be saved:** the name of the container, in your container app, that connects to the target service
76
-
- **The resource group which contains the storage account:** the name of the resource group name with the storage account. In this guide, we're using a Blob Storage.
77
-
- **Name of the storage account:** the name of the storage account that contains your blob.
| `The resource group that contains the container app` | The name of the resource group with the container app. |
87
+
| `Name of the container app` | The name of the container app. |
88
+
| `The container where the connection information will be saved` | The name of the container app's container. |
89
+
| `The resource group which contains the storage account` | The name of the resource group with the storage account. |
90
+
| `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. |
78
91
79
92
> [!NOTE]
80
-
> If you don't have a Blob Storage, you can run `az containerapp connection create storage-blob --new --system-identity` to provision a new Blob Storage and directly get connected to your app service.
93
+
> If you don't have a Blob Storage, you can run `az containerapp connection create storage-blob --new --system-identity` to provision a new Blob Storage and directly connect it to your container app using a managed identity.
81
94
82
95
---
83
96
84
97
## View connections
85
98
86
-
Use the Azure CLI command `az containerapp connection list` to list all your container app's provisioned connections. Provide the following information:
87
-
88
-
- **Source compute service resource group name:** the resource group name of the container app.
89
-
- **Container app name:** the name of your container app.
99
+
Use the Azure CLI command `az containerapp connection list` to list all your container app's provisioned connections. Replace the placeholders `<container-app-resource-group>` and `<container-app-name>` from the command below with the resource group and name of your container app. You can also remove the `--output table` option to view more information about your connections.
90
100
91
101
```azurecli-interactive
92
-
az containerapp connection list -g "<your-container-app-resource-group>" --name "<your-container-app-name>" --output table
102
+
az containerapp connection list -g "<container-app-resource-group>" --name "<container-app-name>" --output table
93
103
```
94
104
95
105
The output also displays the provisioning state of your connections: failed or succeeded.
0 commit comments