0

I have deployed exact same solution on two servers, one is my own server in my basement and the other one is Microsoft Azure. The project is developed using Asp.Net Web Api 2. On my own windows server running IIS 8.5 it totally works. For test, you can simply browse this link in your browser and see the error message {"Message":"The requested resource does not support http method 'GET'."} which shows the API has been hit.1

But exact same project on my Azure domain here, you just get a message saying

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Everything about these two deployments is the same (to the best of my knowledge) and I was wondering if there is any further steps necessary on Web Api app deployment in MS Azure which I am missing.

2 Answers 2

1

I finally found the answer to this issue. If there are multiple apps deployed as one single website so each app is located in its own subfolder, you have to go to the configuration section of your web app on Azure and create virtual directories for each of those sub folders.

Sign up to request clarification or add additional context in comments.

Comments

0

Ah, my problem was probably a common one. I was using

rootconfig = System.Web.Configuration.WebconfigurationManager.OpenWebConfiguration(null);

and that was returning the root web because the parameter was null. When I ran it local that worked fine, but after I deployed the root Config was NOT what I wanted and my code was failing.

Switched to direct access via

stringVal = WebconfigurationManager.AppSettings["Foobar"].ToString();

Nice. Plus less overhead.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.