C
C#11mo ago
Kilau

✅ Azure Webjobs CSV files do not get updated and reset to original state

Hello, I created a Telegram bot that is also reading and writing some CSV files in folders inside the root folder of my application (the debug folder inside bin folder of my VS solution). I created a Webjob by simply uploading a zip file of the root folder (together with the CSV sub-folders inside it) to the Webjob creation interface inside Azure App Services interface. I managed to get the application running as expected where the csv files are updated properly as confirmed by the commands that I run via interactions with the Telegram bot in the Telegram app. However, when I view the actual CSV files via Kudu Debug Console: C:\home\site\wwwroot\App_Data\jobs\continuous\TelBot\net8.0\CSV folders> all the csv files are still in its original states. I thought it could be a delay of some sort. But even after awhile, they are still not updated. Furthermore when I stopped and restarted the Webjob, all the changes that I've made before seems dissapear. Again, confirmed by the command that I run via Telegram bot in the Telegram app. Why is this happening? p/s: I'm very beginner in C# and Azure. So, this is the most I could do to get the app running as Webjob, so far. Thanks in advance.
10 Replies
Mayor McCheese
Mayor McCheese11mo ago
I'd advise avoiding writing to the file system on the app service plan, consider instead writing to a storage account.
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheese11mo ago
I was going to get into that; but I got pulled away
Kilau
Kilau11mo ago
I use the zip files only once during the deployment. After that, it's just writing and reading the csv files which are very small in size regarding the cause of files not updating, are there any specific reason or any settings that should be enabled? the program runs ok, meaning the csv files are being read and updated..however, the changes are somehow not reflected when opening it in Kudu.
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Kilau
Kilau11mo ago
so, are you saying that Azure is extracting my zip files to a temporary directory, run my program from there?
Mayor McCheese
Mayor McCheese11mo ago
Depending on how often you're reading/writing files, using a storage account is pretty cheap option. If you really really really want to use the file system iirc you can set a configuration key to allow it
Kilau
Kilau11mo ago
@🎄MayorMcCheese 🎄 @🦤🦤🦤 thanks for the answers and suggestions.. Will look into Storage Account
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheese11mo ago
yeah, there is a one you can set; for an app_service I don't think it's default
Want results from more Discord servers?
Add your server