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/spring-apps/how-to-connect-to-app-instance-for-troubleshooting.md
+60-6Lines changed: 60 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
title: Connect to an app instance for troubleshooting
3
3
description: Learn how to connect to an app instance in Azure Spring Apps for troubleshooting.
4
-
author: karlerickson
4
+
author: KarlErickson
5
5
ms.author: xiangy
6
6
ms.service: spring-apps
7
7
ms.topic: article
8
-
ms.date: 11/09/2021
8
+
ms.date: 12/06/2022
9
9
ms.custom: devx-track-java, devx-track-azurecli
10
10
---
11
11
@@ -41,7 +41,30 @@ Although Azure Spring Apps offers various managed troubleshooting approaches, yo
41
41
42
42
Before connecting to an app instance, you must be granted the role *Azure Spring Apps Connect Role*. Connecting to an app instance requires the data action permission `Microsoft.AppPlatform/Spring/apps/deployments/connect/action`.
43
43
44
-
Use the following command to assign the *Azure Spring Apps Connect Role* role:
44
+
You can assign an Azure role using the Azure portal or Azure CLI.
45
+
46
+
### [Azure portal](#tab/azure-portal)
47
+
48
+
Use the following steps to assign an Azure role using the Azure portal.
49
+
50
+
1. Open the [Azure portal](https://portal.azure.com).
51
+
1. Open your existing Azure Spring Apps service instance.
52
+
1. Select **Access Control (IAM)** from the left menu.
53
+
1. Select **Add** in the command bar, and then select **Add role assignment**.
54
+
55
+
:::image type="content" source="media/how-to-connect-to-app-instance-for-troubleshooting/add-role-assignment.png" alt-text="Screenshot of the Access Control(IAM) page showing the Add role assignment command." lightbox="media/how-to-connect-to-app-instance-for-troubleshooting/add-role-assignment.png":::
56
+
57
+
1. Search for **Azure Spring Apps Connect Role** in the list, and then select **Next**.
58
+
59
+
:::image type="content" source="media/how-to-connect-to-app-instance-for-troubleshooting/connect-role.png" alt-text="Screenshot of the Add role assignment page showing the Azure Spring Apps Connect Role." lightbox="media/how-to-connect-to-app-instance-for-troubleshooting/connect-role.png":::
60
+
61
+
1. Select **Select members**, and then search for your username.
62
+
63
+
1. Select **Review + assign**.
64
+
65
+
### [Azure CLI](#tab/azure-cli)
66
+
67
+
Use the following command to assign the *Azure Spring Apps Connect Role* role using the Azure CLI:
45
68
46
69
```azurecli
47
70
az role assignment create \
@@ -50,9 +73,35 @@ az role assignment create \
50
73
--assignee '<your-identity>'
51
74
```
52
75
76
+
---
77
+
53
78
## Connect to an app instance
54
79
55
-
If your app contains only one instance, use the following command to connect to the instance:
80
+
You can connect to an app instance using the Azure portal or Azure CLI.
81
+
82
+
### [Azure portal](#tab/azure-portal)
83
+
84
+
Use the following steps to connect to an app instance using the Azure portal.
85
+
86
+
1. Open the [Azure portal](https://portal.azure.com).
87
+
1. Open your existing Azure Spring Apps service instance.
88
+
1. Select **Apps** from left the menu, then select one of your apps.
89
+
1. Select **Console** from the left menu.
90
+
1. Select an application instance.
91
+
92
+
:::image type="content" source="media/how-to-connect-to-app-instance-for-troubleshooting/console-instance.png" alt-text="Screenshot of the Azure portal Console page showing an app instance." lightbox="media/how-to-connect-to-app-instance-for-troubleshooting/console-instance.png":::
93
+
94
+
1. Select or input a shell to run in the container.
95
+
96
+
:::image type="content" source="media/how-to-connect-to-app-instance-for-troubleshooting/console-shell.png" alt-text="Screenshot of the Azure portal Console page showing a Custom Shell entry." lightbox="media/how-to-connect-to-app-instance-for-troubleshooting/console-shell.png":::
97
+
98
+
1. Select **Connect**.
99
+
100
+
:::image type="content" source="media/how-to-connect-to-app-instance-for-troubleshooting/console-connect.png" alt-text="Screenshot of the Azure portal Console page showing the Connect command." lightbox="media/how-to-connect-to-app-instance-for-troubleshooting/console-connect.png":::
101
+
102
+
### [Azure CLI](#tab/azure-cli)
103
+
104
+
If your app contains only one instance, use the following command to connect to the instance using the Azure CLI:
56
105
57
106
```azurecli
58
107
az spring app connect \
@@ -93,6 +142,8 @@ az spring app connect \
93
142
94
143
If your app is deployed with a custom image and shell, you can also use the `--shell-cmd` parameter to specify your shell.
95
144
145
+
---
146
+
96
147
## Troubleshoot your app instance
97
148
98
149
After you connect to an app instance, you can check the status of the heap memory.
@@ -140,15 +191,18 @@ You can also use JDK-bundled tools such as `jps`, `jcmd`, and `jstat`.
140
191
The available tools depend on your service tier and type of app deployment. The following table describes the availability of troubleshooting tools:
141
192
142
193
| Tier | Deployment type | Common tools | JDK tools | Notes |
| Basic / Standard tier | Source code / Jar | Y | Y (for Java workloads only) ||
145
196
| Basic / Standard tier | Custom image | N | N | Up to your installed tool set. |
146
197
| Enterprise Tier | Source code / Artifacts | Y (for full OS stack), N (for base OS stack) | Y (for Java workloads only) | Depends on the OS stack of your builder. |
147
198
| Enterprise Tier | Custom image | N | N | Depends on your installed tool set. |
148
199
200
+
> [!NOTE]
201
+
> JDK tools aren't included in the path for the *source code* deployment type. Run `export PATH="$PATH:/layers/paketo-buildpacks_microsoft-openjdk/jdk/bin"` before running any JDK commands.
202
+
149
203
## Limitations
150
204
151
-
Using the shell environment inside your application instances has the following limitation:
205
+
Using the shell environment inside your application instances has the following limitations:
152
206
153
207
- Because the app is running as a non-root user, you can't execute some actions requiring root permission. For example, you can't install new tools by using the system package manager `apt / yum`.
0 commit comments