简体   繁体   中英

Keep azure asp.net core webapi-only app on

I have a .NET core app deployed on azure consisting entirely of RESTful services that hits an azure sql db-- no front end. IIRC, for any app deployed on azure that has inactivity for a certain amount of time, azure will "shut down" the app and/or db. Once "shut down", it takes a while for the app/db to "wake up" when invoking a RESTful service.

Is there a way to prevent this happening on azure? I tried turning on "always on" but i think all that does is just ping the root, for which does nothing on my end. Problem for me is that sometimes the RESTful service times out due to azure taking some time to "wake up" the app/db.

It can be caused by Azure SQL DB. If you are using Basic tier level db it can be a problem. This tier is using predictable hourly transaction rate. Standard do have predictable per minute TR and Premium predictable per second TR. This can prioritize automatic DTU scaling for each tier.

If you do single request after some time the prediction will not be highly affected. You will need to do series of db transactions to get allocated DTU's for your db.

So, in your case it is a good idea to hit database in some reasonable intervals some time before you start to use the database.

You can achieve it by creating webjob that will hit some app endpoint that will do a query to db.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM