0

This is for a school project.

I have 3 parts to this project. A frontend in React, an http server in C# and a database in mysql. Up until now, they were all running locally. But because of this Covid thing, the teachers want us to host on azure so they can test it from home.

I already have the database on azure working.

Now I wanted to move the HTTP server to Azure, so I tried and deploy it from within visual studio, that created a webjob. However, checking the logs show it is throwing the "Acess Denied" exception on httplistener.start().

Keep in mind basically all http requests require the program to consult the database. I am using the standard sqlconnector from oracle.

So basically what I need to do is send http requests from react (I'm using the fetch API) to this http server.

Is a webjob even the right thing to do?

This is the code that starts the HTTP listener (port is 8080).

listener = new HttpListener();
listener.Prefixes.Add("https://trabalholi4.azurewebsites.net:" + port.ToString() + "/");

listener.Start(); 
Pedro Fernandes
  • 216
  • 1
  • 12
  • A client connecting to a server only has GUEST privileges with no access to the server resources like FILE System. So any read/writes should either occur on client machine or on a network drive that has read/write access to the users. To get access to the server resources the code on server would have to run As Admin. The teacher only expects the Server to be running on Azure and database can be on another remote machine provided the teacher has access to the database through the server. – jdweng Jun 29 '20 at 21:09
  • Azure webapp only supports ports 80 and 443. You can change the value of port to 443 to try it. – Jason Pan Jun 30 '20 at 06:36
  • [A simple Google search would have given you the fix...](https://stackoverflow.com/questions/4019466/httplistener-access-denied) – Marco Ceccon Jul 02 '20 at 15:38
  • I ended up using a VM, and no, that wouldn't fix my problem as I couldnt run commands on the machine running the webjob. – Pedro Fernandes Jul 02 '20 at 15:43

0 Answers0