
Monitoring Azure SFTP logs is crucial for identifying and resolving connectivity issues between your Azure SFTP server and clients.
You can access Azure SFTP logs through the Azure portal, specifically in the 'Activity Log' section.
Azure SFTP logs provide valuable information about user activity, such as login attempts, file transfers, and errors.
This data can help you troubleshoot connectivity issues and identify potential security threats.
To view Azure SFTP logs, navigate to the Azure portal, select your SFTP server, and click on 'Activity Log'.
See what others are reading: Windows Server 2022 Azure Edition
Getting Started
To get started with Azure SFTP logs, you need to configure the log agent in SFTP Gateway. You can do this by going to your Log Analytics Workspace and navigating to Agents Management.
Click on the Linux Servers tab and find the Download Agent For Linux field, then click the copy button to copy the agent download and onboarding link.
SSH to your SFTP Gateway server and paste the copied link to download and install the Azure log agent. This will also run the onboarding script that connects the agent to your Log Analytics Workspace.
Here's an interesting read: Azure on Linux
Introduction

Troubleshooting connectivity issues can be a real challenge, but understanding how to use Azure diagnostic logs can make all the difference.
In this article, we'll explore the importance of Azure diagnostic logs in resolving connectivity problems.
Azure diagnostic logs provide valuable insights into system performance and behavior, helping you identify and fix issues quickly.
By leveraging these logs, you'll be able to pinpoint the root cause of connectivity issues and take corrective action.
Azure diagnostic logs can be used to troubleshoot a wide range of connectivity problems, from network outages to application errors.
With the right tools and knowledge, you can resolve connectivity issues and keep your systems running smoothly.
A unique perspective: Azure Diagnostic Logs
Configure SFTP Gateway
To configure your SFTP Gateway, you'll need to start by going to the Log Analytics Workspace and navigating to Agents Management.
From there, click on the Linux Servers tab and locate the Download Agent For Linux field. You'll see a copy button - click on that to get the agent download and onboarding link.
A different take: Azure Arc Linux Agent
Now, SSH to your SFTP Gateway server and paste the link. This will download the Azure log agent and run through the onboarding script, which will install the agent and connect it to your Log Analytics Workspace.
This process is straightforward and should only take a few minutes to complete.
Recommended read: Azure Arc Agent Logs
Testing and Checking
To test and check Azure SFTP logs, start by navigating to the Logs section under Monitoring for the storage account in the Azure portal. You can then copy and paste a specific Log Analytics query to view the latest connection attempts.
Replace the "OperationName" in the query with a suitable option, such as SftpConnect, to troubleshoot access or network-related issues. This operation is sufficient for identifying the source of the problem.
If you're using Consumption Logic Apps connected to the same Azure region as your storage account, the CallerIpAddress will show as local IP addresses instead of the outbound addresses listed in Microsoft's documentation.
You can use the following query to view the latest connection attempts, ordered by the latest events.
Intriguing read: Terraform Azure Storage Account
Log Management
Log Management can be a challenge when it comes to Azure SFTP logs. You just need to enable Azure Monitor logging in diagnostics settings to get the logs you need.
Azure Monitor logging is supported, and you can refer to the documentation on Azure Monitor Logs for more information.
To troubleshoot connections coming from user accounts, you can use the Insights panel and drill down into individual SftpConnect results. However, not all pre-auth connection attempt failures are logged in the $logs container.
For another approach, see: Azure App Insights vs Azure Monitor
Detection
Detection is crucial in log management, and it starts with identifying specific events that need attention. A simple KQL query can look for SFTP access from logs.
To detect SFTP access, you can use a KQL query like the one mentioned earlier, which is designed to catch any SFTP access from the logs.
Detecting failure attempts with wrong passwords is also essential. A KQL query can be used to identify these attempts, as shown in the example for detecting SFTP access using localuserpassword.
Connection Logs Location

Connection logs for Azure Blob Storage SFTP can be found in the Azure Monitor logging in diagnostics settings.
Azure Monitor Logs is a feature that allows you to collect and analyze log data from your Azure resources, including Azure Blob Storage. To enable it, you just need to go to your Azure storage account's diagnostics settings.
In the Azure Monitor Logs, you can find API endpoints related to SFTP, which can be useful for troubleshooting connections coming from user accounts. However, to drill into individual SftpConnect results, you may need to use the Insights panel.
Here are some ways to find connection logs for Azure Blob Storage SFTP:
- Enable Azure Monitor logging in diagnostics settings
- Use the Insights panel to find API endpoints related to SFTP
- Check the $logs container for Classic Storage Analytics logging
Note that not all pre-auth connection attempt failures are logged in the $logs container.
Featured Images: pexels.com

