This guide is to help you troubleshoot Azure SQL connectivity and authentication issues on Linux App Services.
Note: At the time of writing this cannot be executed in Linux Function Apps, since we don't have access to the environmental variables needed to run the commands.
On Windows App Services you can performance such connectivity and authentication troubleshooting by running MSI Validator, but on Linux App Services we need to leverage the WebSSH functionality to troubleshoot.
So, to address below you can find a list of commands to test connectivity and access to Azure SQL Server Database on Linux App Services.
Connectivity troubleshooting steps
We would need to follow the 4 steps mentioned below to test the connectivity:
1. WebSSH into your Web App:
Browse to the Kudu site of the App Service and click on WebSSH.
Note: If you are using a custom Docker Image and do not have SSH (Secure Shell) enabled, you need to first follow these steps here before going forward with the next steps.
a. If you are using system-assigned manage identity:
The below command assumes that system assigned managed identity is already enabled, since the environmental variables IDENTITY_ENDPOINT and IDENTITY_HEADER should be injected to the container automatically by the platform.
Option 1 (works on most blessed images. For Alpine, follow option 2):