To access my api I have to use the following url https://{mywebsite}

Henry Petersen 41 Reputation points

I have spa and have created a virtual application
Virtual Path: /api
Physical Path site\api

To access the api the url is https://{mywebsite} I don't understand the double api reference in the url why is not just /api/ping?


Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,844 questions
0 comments No comments
{count} votes

Accepted answer
  1. Takahito Iwasa 4,841 Reputation points MVP

    Hi, @Henry Petersen

    Are you putting the files in site\api instead of site\wwwroot\api ?

    When I put the files under site\wwwroot and pointed to the virtual application site\wwwroot\api it worked fine.
    What is your App Service configuration information and the structure of the uploaded file?

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Henry Petersen 41 Reputation points

    corrected my path to 'site/wwwroot/api', updated my publishing profile to include /api in the Site Name. That published the api to correct folder finally, but was still having the same issue with having to reference '{my web site}/api/api/ping'. Finally determined it had to be something in the code itself and sure enough the Route in the api controller was referencing 'api/[controller]'. Changed that to '[controller]' and all works perfectly now.

    0 comments No comments