question

ShayBarak-6650 avatar image
0 Votes"
ShayBarak-6650 asked HuryShenMSFT-3800 commented

How to deploy ASGI on IIS?

Hi everyone,

I have an api server written in FastAPI framework(python) and I would like to
know how to deploy it with IIS on Windows server 2019.
In order to run it locally, the application uses uvicorn(ASGI server).
So basically what I want to know is how to deploy ASGI server on top of IIS,
because right now I'm just running the app via CMD, which is definitely not a good idea at all.
Every time the server for some is going down and then up, I have to restart the app and this is
something that I would like to be automatically.
I looked up for some tutorials on the Internet but I couldn't find one for FastAPI.

Does someone know how to do so?

Many thanks, Shay.

windows-server-2019windows-server-iis
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Here is a post which is similar with your requirement. One of the comments under the post mentioned IIS can run as a reverse proxy, just like nginx and provide the document. Please check.

0 Votes 0 ·

1 Answer

MotoX80 avatar image
0 Votes"
MotoX80 answered MotoX80 edited

Disclaimer: I do not know anything about FastAPI framework(python) or uvicorn(ASGI server).

I do have experience with using IIS as a front end for Tomcat. This involved installing an ISAPI filter into IIS (listening on HTTP and HTTPS) and configuring it to do port forwarding to whatever port we had Tomcat listening on. Client<-->IIS<-->Tomcat<-->WhateverDatabaseItUsed

I don't know if that's what you mean by "deploy ASGI server on top of IIS". You might have better luck asking this question in an ASGI forum or searching their documentation for ISAPI filters.

Maybe this? https://github.com/mjkillough/iis-asgi-handler

If you just want to run a program at system startup, you can use the Windows task scheduler or a tool like NSSM that runs command line programs as a service.

https://nssm.cc/



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.