I'm still getting familiar with Azure Storage and need a simple, reliable way to save a variable's state so it can be loaded the next time an Azure WebJob runs. I initially tried writing the value to a local file from the process, but the environment doesn't allow that. Should I use Blob Storage, Table Storage, or another Azure service?
3 Answers
If this is a long-running or asynchronous workflow rather than a simple scheduled job, Durable Functions may be worth considering. They provide built-in patterns for checkpoints and persisted orchestration state. For a basic WebJob variable, though, Blob or Table Storage should be enough.
For a single value, Blob Storage is probably the simplest option. Your WebJob can read the state from a blob when it starts and write the updated value when it finishes. For example, you could use the connection string from the AzureWebJobsStorage environment variable, load the current value, do the work, and then save the new value. Local files aren’t reliable for WebJobs because the filesystem may be restricted or temporary.
Blob Storage works well for one small piece of state. If you need several structured fields, multiple records, or to query values, Azure Table Storage is usually a better fit. It gives you a simple key-value style data store without requiring a full database.

Thank you so much! That clears up why the file-based approach wasn’t working.