Storing state locally with Azure Functions
Asked Answered
P

3

13

Does Azure Functions offer a local (state) storage to eliminate a need in invoking additional services such as storage, docDB, etc?

Propertied answered 2/5, 2016 at 1:51 Comment(0)
A
15

Functions are built on Azure App Service, which offers the ability to store persistent files. e.g. you can store files under %HOME%\data\SomeFolderOfYourChoice.

Asthenosphere answered 2/5, 2016 at 1:58 Comment(3)
Nice to know it's possible. But is it a good idea? Any gotchas? AWS explicitly tells us to not make any assumptions about the function execution environment.Bareback
My take is that a 'pure' function shouldn't do that. But it's available for those who need it in some scenarios.Asthenosphere
Assume this only plays to app service plan functions and not consumption plan unless that state is replicated across all potential underlying machines.Jeggar
I
2

As was told, Azure Functions can interact with its folder structure and is able to store some stuffs into its folders. But, remember, Azure Functions are billed for resources consumption, that is even more resources your Functions will need, even more cost you'll have on your billing.

Sometimes is more cheap use Azure PaaS services than store stuffs into your Functions. This was a TIP ! :)

Indevout answered 31/5, 2017 at 15:0 Comment(1)
Consumption and App Service plan. For something like this, you'd probably want to use the later.Bicarb
C
1

As per David Ebbo's response, Azure Functions are built on the main Azure serverless platform which is App Service.

This link will explain more but I've copied some key pieces in case the link rots.

https://github.com/projectkudu/kudu/wiki/Understanding-the-Azure-App-Service-file-system

Persisted files are those of your deployed program and they are rooted in %HOME% or /home on Linux/Containers. These files are shared between scaled-out instances. You get 1GB.

Temp files can be written to %APPDATA% or %TMP%. These are not shared and they're volatile within restarts of your web app. You get 500MB.

Kudu is the name of the web portal tooling to let you get at the Web App environment but apparently you won't see temp files you've written unless you turn off SCM separation, see link.

Casar answered 4/2, 2020 at 13:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.