I'm working on a university project where I need to create a simple API using HTTP methods like GET, POST, DELETE, and PUT. I've managed to test it locally, and everything works fine until I added a new file called 'storage.py' that contains functions for saving and retrieving notes from Blob Storage. However, I'm on a student account and chose the flex consumption plan, which means I'm not sure if I'm allowed to use a storage account given my instructor mentioned data might not persist after an app restart. If Azure Functions are stateless, how can I retrieve data after posting it without a storage account? After adding the storage code, none of my API endpoints are showing up, and I'm convinced that my 'storage.py' file is causing the issue. As a cybersecurity major, I'm not very comfortable with coding, and I really need help sorting this out. Sorry for the messy code!
2 Answers
It sounds like there’s a bit of confusion with what your instructor meant about data disappearing after a restart. Storage accounts actually retain data even when the function app restarts. Azure Functions absolutely need storage accounts to operate. Regarding your functions, are you mapping them correctly to your HTTP requests? I noticed you've copied code snippets which could be causing some issues. You should define three functions in your function app: the two you have plus an orchestrator for the REST calls. When publishing your app, everything should be deployed together. To get back on track, try checking the Function Apps extension in VSCode to help you set this up right!
For your setup, remember to avoid initializing BlobServiceClient at the import level; that can cause errors at startup, preventing your functions from loading properly. All initialization should happen inside the save and get functions themselves.
You can try using Azurite for local storage testing, which is a good emulator for Blob Storage. For production, consider giving your function a managed identity with the right RBAC permissions for your storage account, like Storage Data Contributor. Check to make sure your endpoint is accessible, and if you’ve set any networking rules or integration—you didn’t mention that, so it might be public by now. Use DefaultAzureCredential for smoother local and remote deployment without hard-coding credentials.
I’ve set up continuous deployment from GitHub to Azure for my function app. Right now, I haven’t configured any NSGs or VNets, so everything is public. I’d rather not get too complicated, but I do get what you mean!

Yeah, for Python v2, make sure you’re using decorators for each function with specific routes. If your endpoints are missing after adding the storage functions, it might indicate a configuration error. Once I get to my PC, I’ll share how my main function code is structured!