Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
The Basic, Standard, and Enterprise plans will be deprecated starting from mid-March, 2025, with a 3 year retirement period. We recommend transitioning to Azure Container Apps. For more information, see the Azure Spring Apps retirement announcement.
The Standard consumption and dedicated plan will be deprecated starting September 30, 2024, with a complete shutdown after six months. We recommend transitioning to Azure Container Apps. For more information, see Migrate Azure Spring Apps Standard consumption and dedicated plan to Azure Container Apps.
This article applies to: ✅ Basic/Standard ✅ Enterprise
This article describes how to access the shell environment inside your application instances to do advanced troubleshooting.
Although Azure Spring Apps offers various managed troubleshooting approaches, you may want to do advanced troubleshooting using the shell environment. For example, you may want to accomplish the following troubleshooting tasks:
Azure CLI with the Azure Spring Apps extension. Use the following command to remove previous versions and install the latest extension. If you previously installed the spring-cloud
extension, uninstall it to avoid configuration and version mismatches.
az extension remove --name spring
az extension add --name spring
az extension remove --name spring-cloud
A deployed application in Azure Spring Apps.
If you've deployed a custom container, a shell program. The default is /bin/sh
.
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
.
You can assign an Azure role using the Azure portal or Azure CLI.
Use the following steps to assign an Azure role using the Azure portal.
Open the Azure portal.
Open your existing Azure Spring Apps service instance.
Select Access Control (IAM) from the left menu.
Select Add in the command bar, and then select Add role assignment.
Search for Azure Spring Apps Connect Role in the list, and then select Next.
Select Select members, and then search for your username.
Select Review + assign.
You can connect to an app instance using the Azure portal or Azure CLI.
Use the following steps to connect to an app instance using the Azure portal.
Open the Azure portal.
Open your existing Azure Spring Apps service instance.
Select Apps from left the menu, then select one of your apps.
Select Console from the left menu.
Select an application instance.
Select or input a shell to run in the container.
Select Connect.
After you connect to an app instance, you can check the status of the heap memory.
Use the following command to find the Java process ID, which is usually 1
:
jps
The output should look like the following example:
Then use the following command to run the JDK tool to check the result:
jstat -gc 1
The output should look like the following example:
When you're done troubleshooting, use the exit
command to disconnect from the app instance, or press Ctrl+d
.
The following list describes some of the pre-installed tools that you can use for troubleshooting:
lsof
- Lists open files.top
- Displays system summary information and current utilization.ps
- Gets a snapshot of the running process.netstat
- Prints network connections and interface statistics.nslookup
- Queries internet name servers interactively.ping
- Tests whether a network host can be reached.nc
- Reads from and writes to network connections using TCP or UDP.wget
- Lets you download files and interact with REST APIs.df
- Displays the amount of available disk space.You can also use JDK-bundled tools such as jps
, jcmd
, and jstat
.
The following list shows the tools available, which depend on your service plan and type of app deployment:
Note
JDK tools aren't included in the path for the source code deployment type. Run export PATH="$PATH:/layers/tanzu-buildpacks_microsoft-openjdk/jdk/bin"
before running any JDK commands.
Using the shell environment inside your application instances has the following limitations:
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
.
Because some Linux capabilities are prohibited, tools that require special privileges, such as tcpdump
, don't work.
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Deploy a Spring Boot app to Azure Container Apps - Training
In this module, you learn how to deploy a Spring Boot app to Azure Container Apps. You deploy a Spring Boot application to Azure Container Apps and maintain it using the built-in Java stack.
Documentation
Quickstart - Provision Azure Spring Apps Using Terraform
This quickstart shows you how to use Terraform to deploy an Azure Spring Apps cluster into an existing virtual network.
Enable diagnostics logging - Azure App Service
Learn how to enable diagnostic logging and add instrumentation to your application, as well as how to access the information logged by Azure.