MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.24k stars 21.41k forks source link

Local storage #58573

Open pekspro opened 4 years ago

pekspro commented 4 years ago

On the Service limits table on this page:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#hosting-plans-comparison

It says that storage is 5 TB for consumption plan, and 250 GB for premium plan. Is this right? I would assume that consumption plan had less storage than premium plan, and in my experience that is the case.

Also, is this value for local storage? If I read the foot note it makes me think so. But you could also use network storage were 5 TB is the default value for consumption plan as I understand it. The local storage for consumption plan is only 500 MB, which I got when I run this code:

using System.Net;
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;

public static IActionResult Run(HttpRequest req, ILogger logger)
{
    Stopwatch stopwatch = Stopwatch.StartNew();
    string tmpFileName = Path.GetTempFileName();
    logger.LogInformation($"Testing maximum file size with {tmpFileName }");
    string bestSize = "?";
    byte[] data = new byte[50 * 1024 * 1024];

    for (int fiftyMegs = 1; fiftyMegs <= 10; fiftyMegs++)
    {
        try
        {
            logger.LogInformation($"Saving file with size { fiftyMegs * 50 } MB...");

            using FileStream file = new FileStream(tmpFileName, FileMode.OpenOrCreate);
            file.Position = file.Length;
            file.Write(data);
            bestSize = $"Saving file with size { fiftyMegs * 50 } MB succeded.";

            logger.LogInformation($"Saving file with size { fiftyMegs * 50 } MB succeded.");
        }
        catch (Exception ex)
        {
            bestSize += Environment.NewLine + $"Saving file with size { fiftyMegs * 50 } MB failed: {ex.Message}";
            logger.LogError($"Saving file with size { fiftyMegs * 50 } MB failed: {ex.Message}");
            break;
        }
    }

    File.Delete(tmpFileName);
    logger.LogInformation($"Saving file test completed.");
    bestSize += Environment.NewLine + stopwatch.Elapsed.ToString();

    return new OkObjectResult(bestSize);
}

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ChaitanyaNaykodi-MSFT commented 4 years ago

@pekspro Thank you for your feedback! We will review and update as appropriate.

PramodValavala-MSFT commented 4 years ago

@ggailey777 @jeffhollan Looks like this is a recent update. Could you please share insights on this?

PramodValavala-MSFT commented 4 years ago

@pekspro Looks like the 500MB is for the default temp storage

image

while the Azure Files mount is under /d/home

image

PramodValavala-MSFT commented 4 years ago

@pekspro Hope my previous comment clears things up. The only difference based on the above is that the 5TB storage is here is more of a permanent storage rather than temporary.

We have assigned this issue to the content author to review and update accordingly.

pekspro commented 4 years ago

@PramodValavala-MSFT, yes it cleared things up for me and fit my own experience very well :)