[FREE] Hosting ASP.NET Web Apps with a SQLite database on Azure

Поділитися
Вставка
  • Опубліковано 25 жов 2024

КОМЕНТАРІ • 20

  • @RubenHeerenDev
    @RubenHeerenDev  3 роки тому

    Join the Discord community to chat with other devs and get help if you're stuck on something.
    discord.gg/dcvmDnegsn

  • @007ffflearning
    @007ffflearning 3 роки тому +2

    This was one of the most clear and working Blazor Server CRUD tutorials I"ve seen. I followed along end-to-end, while updating some terminology from Posts to my data set. And all was working as you showed (as expected :))
    Some questions:
    - how to ask for a confirmation before updating or deleting a record?
    - can I migrate SQL Server DB to SQLite (my database only has 25 records for now, not immediately growing)

    • @RubenHeerenDev
      @RubenHeerenDev  3 роки тому +2

      Thank you! I appreciate the good feedback.
      So for your questions:
      _- how to ask for a confirmation before updating or deleting a record?_
      I use Bootstrap modals and extra booleans for this. An example name would be "modalConfirmed".
      See getbootstrap.com/docs/5.0/components/modal/
      _- can I migrate SQL Server DB to SQLite (my database only has 25 records for now, not immediately growing)?_
      I don't know how big your records are but I'd do only 25 records manually.
      Also found this SO question on how to do it with code: stackoverflow.com/questions/10960433/fastest-way-to-migrate-from-sql-server-to-sqlite-for-large-datasets
      Hope this helps!

  • @Teemu_TV
    @Teemu_TV Рік тому +1

    Thank you for fantastic tutorial! It's always greatly appreciated when EVERY step is shown from start to finish.

  • @sreddydk
    @sreddydk Рік тому

    Great tutorial Ruben 👌

  • @ivandzurah7598
    @ivandzurah7598 3 роки тому +1

    Thank you very much. Greetings from Ukraine.

  • @JohannQ
    @JohannQ 2 роки тому

    Excellent tutorial. Thanks for sharing

  • @I_Mimic_I
    @I_Mimic_I 7 місяців тому

    I make a simple TODO Task telegram bot and decide where to store the data. I'm currently using free Azure SQL, but I don't like that it pauses after a period of inactivity. So I'm thinking of either changing my plan from the current free plan to 5 DTUs for $5/month or using the SQLite method.
    So I have a few questions.
    What will happen to the database when I publish a new version of the application (given that Copy to Output directory is set to Do not copy)? Will the data remain? Or is it possible that the database will be deleted when the Web App is restarted? Also, will this work if I use the F1 Web App plan?

  • @ecurbokareka
    @ecurbokareka 2 роки тому +3

    Hi Ruben, Thank you for terrific turorial.
    I just downloaded your source code and had app running successfully on my development machine. I then tried publishing to my Azure account. Tried to run there and got a SQLite type error (see below). Any ideas ?
    Thanks again Ruben.
    An unhandled exception occurred while processing the request.
    SqliteException: SQLite Error 14: 'unable to open database file'. Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(int rc, sqlite3 db)
    Microsoft.Data.Sqlite.SqliteConnection.Open()..etc etc.

    • @ecurbokareka
      @ecurbokareka 2 роки тому +2

      Don't worry thanks Ruben .. I sorted it. The db wasn't been copied to Azure ('Copy to Output Directory' property wasn't set for AppDB.db).

    • @RubenHeerenDev
      @RubenHeerenDev  2 роки тому +1

      Yep happened to me a lot too. Glad you figured it out!

  • @RupOase
    @RupOase 2 роки тому +1

    Hello Ruben,
    Does this setup support concurrent writes?
    E.g.: two or more persons that access the website and would like to make a new entry into the DB.
    Thank you!

    • @RubenHeerenDev
      @RubenHeerenDev  2 роки тому +1

      Hey Dan,
      Yes. SQLite supports concurrency somewhat.
      Concurrent writes at like the exact same millisecond aren't supported. Each write takes a few milliseconds so usually it shouldn't give problems. For reads concurrency is supported.
      I recommend taking a look at the SQLite FAQ and then entry (5):
      www.sqlite.org/faq.html
      Hope this helps.
      - Ruben

    • @RupOase
      @RupOase 2 роки тому

      @@RubenHeerenDev Thank you! Yes, I saw the documentation, but in my use case, with a Blazor Wasm + WebAPI hosted on a mini-pc, it sometimes failed to write, because it did not had exclusive access to the db file.
      I built a hobby project in which a group of car enthusiasts share our car's travel, consumption, cost of ownership, issues with them, etc. and it happened several times to fail adding new records, when only 5 people were doing it (not all at the same time). Based on my research it could handle 50 sessions, but it failed for only 5. So I kinda' switched to MSSQL Express, although even that is an overkill, for the size of the app. However, when I tried to move it to the Azure cloud, because I was using the MSSQL database, costs were a bit on the higher end, and I went on keeping the app on my mini-pc.

  • @emreaka3965
    @emreaka3965 2 роки тому

    Thank you. ^^

  • @paaabl0.
    @paaabl0. 3 роки тому +1

    With free tier for the app service your sqlite database will be killed every time your app is not used for some time. So it's just a temporary solution.

    • @RubenHeerenDev
      @RubenHeerenDev  3 роки тому +1

      Yes, on the free tier you have a cold start, but changing from SQLite to another database provider might not fix that issue. With Entity Framework changing the database provider shouldn't take too long though.

  • @mrt7948
    @mrt7948 2 роки тому

    A tutorial on master detail please that use POS

    • @RubenHeerenDev
      @RubenHeerenDev  2 роки тому

      Could you clarify?

    • @mrt7948
      @mrt7948 2 роки тому

      @@RubenHeerenDev Master: Client Name, Total Amount, Discount, Paid(editable) === Detail: Item Name, Rate, Qty(editable), Discount(editable) . Items coming from Item List with Rate. Thank you. much appreciated.