Search code examples
visual-studioazure-web-app-servicewebapi

Unable to publish Web API from Visual Studio


I have created a simple web API in ASP.NET Core and wanted to publish to Azure Web App. I'm using free trial subscription and have only one web app resource created in Azure. The app service plan is using free tier 'D1' SKU and is the only one present in my subscription. However, while trying to publish the web API by choosing this web app in Visual Studio publish profile, it says 'there are no existing instances available'.

The web app resource does appear here:

enter image description here

Clicking next while the resource is selected, results in the issue:

enter image description here


Solution

    • I have created a .Net Core Web App in the Azure free trial Subscription with free tier plan

    enter image description here

    • Initially it contains only hoststart.html

    KUDU Console of Initial App Service

    enter image description here

    • Created a sample .Net Core Web API Application in Visual Studio and tried to Publish to the App Service which I have created in Azure portal
    • Make sure you have login to the same subscription in Visual Studio where you have created the web app in Portal
    • Initially it was prompted to re-enter the credentials after changing the Azure Subscription,I have refreshed the Visual Studio , after few seconds Iam able to see the correct Subscription details.
    • Iam able to see the App Service which I have created in Portal

    enter image description here

    • Able to successfully deploy the WebAPI to the App service in Portal

    KUDU Console of App Service after Publishing the WebAPI from Visual Studio enter image description here

    Deployed WebAPI Output

    enter image description here

    Update

    You are in the correct path, after selecting the web app it asks to create the api.Click on the + symbol and add the API Management

    enter image description here