Azure File Share attached to an Azure App Service gets 72 transactions per minute without any actual usage

Róbert Mazán 20 Reputation points
2024-12-02T14:10:04.3433333+00:00

Steps to reproduce:

  1. Create a container-based Azure App Service (no matter what image)
  2. Create a Storage Account and a File Share
  3. Mount the File Share to the Azure App Service (using SMB, mount point does not matter, the app does not have to use it - for example the image can be appsvc/staticsite:latest from mcr with /test as mount point)
  4. Check Metrics for the Storage Account
  5. In the File namespace checking the Transactions metric you can see 72 transaction per minute without any actual usage on the App Service side (24 Open + 24 QueryInfo + 24 Close)

I've tried sending all diagnostics to a Log Analytics workspace, but could not find anything in the logs that would explain this storage usage pattern...

If you attach another File Share under another mount point you can see the transactions doubling.

Any ideas what can cause this?

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,329 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,084 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vinod Kumar Reddy Chilupuri 1,915 Reputation points Microsoft Vendor
    2024-12-02T19:31:13.6433333+00:00

    Hi @Róbert Mazán

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    What are transactions in Azure Files, and how are they billed?
    Protocol transactions occur any time a user, application, script, or service interacts with Azure file shares (writing, reading, listing, deleting files, etc.). It's important to remember that some actions that you might perceive as a single operation might actually involve multiple transactions. For standard Azure file shares billed on a pay-as-you-go model, different types of transactions have different prices based on their impact on the file share. Transactions don't affect billing for premium file shares, which are billed using a provisioned model.

    Additional information:

    LRS write operations in your Azure Storage account, and you suspect that one of the file shares mounted by your Azure Container Apps environment is causing the issue. However, you're unable to drill down to find which file share is causing the high transaction counts.

    To troubleshoot this issue, you can try the following steps: Use the Azure Storage Explorer tool to view the transaction counts for each file share in your storage account. You can connect to your storage account using the tool and navigate to the File Shares section to view the transaction counts for each file share. This can help you identify which file share is causing the high transaction counts. If you're unable to identify the file share causing the issue using the Azure Storage Explorer tool, you can try using Azure Monitor to create a log query that shows the transaction counts for each file share. Here's an example query that you can use:

    AzureMetrics
    

    This query shows the transaction counts for each file share in your storage account, grouped by hour. You can modify the query to filter by a specific time range or to group the results differently. Once you've identified the file share causing the high transaction counts, you can investigate further to determine the root cause of the issue. Some possible causes of high transaction counts include frequent file uploads or deletions, high file access rates, or inefficient application code that generates excessive file I/O operations.

    Check Diagnostic Settings that you have configured the correct diagnostic settings for both the Azure Storage account and the Azure App Service. This includes enabling the collection of metrics and logs specific to Azure Files.

    Doubling of Transactions with Multiple File Shares

    • Independent Connections: Each mounted file share functions independently. When an additional file share is attached, it may establish its own connections and perform its own operations (such as opening and closing files), resulting in doubled transactions.
    • SMB Protocol Behavior: The SMB protocol may cause regular operations like Open, QueryInfo, and Close to be duplicated for each mounted file share. This is expected behavior when multiple shares are mounted.
    • Monitoring Each Share: Use Azure Storage Explorer or Azure Monitor to examine the transaction counts for each individual file share. This can help you to identify if one share is significantly more active than others.

    User's image

    SMB transactions against Azure Files vs Billing transaction count
    This article provides detailed information on Azure Files billing

    Please let us know if you have any further queries. I’m happy to assist you further.    

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.