When working on developing modern applications that need to be hosted on the cloud, you need to make sure that the applications are stateless. Statelessness is an essential factor for developing cloud-aware applications. For example, you should avoid persisting any data in the resource that is specific to any virtual machine (VM) instance that's provisioned to any Azure Service (for example, an app service, the API, and so on). If you do so, you cannot leverage some of the services, such as auto-scaling functionality, as the provisioning of instances is dynamic. If you depend on any VM-specific resources, you will end up facing issues with unexpected behaviors.
Having said that, the downside of the previously mentioned approach is that you end up working on identifying ways of persisting data in different mediums, depending on your application architecture.