Asp.net Core 2.1 web api deployed successfully but not getting response from my web api url

A b d u l Wahab 1 Reputation point
2020-06-17T10:47:10.39+00:00

Can you please guide me why i am not getting response from following link
https://otgapi.azurewebsites.net/api/values

This url shows https://otgapi.azurewebsites.net/ api deployed successfully.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,596 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ken Tucker 5,851 Reputation points
    2020-06-17T11:19:39.95+00:00

    Could you post the code for the valuescontroller?

    1 person found this answer helpful.
    0 comments No comments

  2. A b d u l Wahab 1 Reputation point
    2020-06-17T11:48:19.33+00:00

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Mvc;
    using OTG.BusinessService;

    namespace OTGWebAPI.Controllers
    {
    [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : Controller
    {
    private IAuthService _authService;

        public ValuesController(IAuthService authService)
        {
            _authService = authService;
        }
        // GET api/values
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }
    
        // GET api/values/5
        [HttpGet("{id}")]
        public string Get(int id)
        {
            return "value";
        }
    
        // POST api/values
        [HttpPost]
        public void Post([FromBody] string value)
        {
        }
    
        // PUT api/values/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody] string value)
        {
        }
    
        // DELETE api/values/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }
    

    }


  3. Monalla-MSFT 13,031 Reputation points
    2020-06-25T03:27:41.12+00:00

    Hello @A b d u l Wahab ,

    Thanks for reaching out to us.

    If I understand your problem correctly, you are having issues deploying your web app to Azure App Service. Correct?

    If that is the case, Can you elaborate how you are trying to deploy the code ?

    Follow the below documents which will guide you through the deployment process if you haven't followed earlier .

    1. How-to-deploy-web-app-to-azure-using-visual-studio
    2. Using Visual Studio Code
    3. Using Visual Studio

    I hope this information helps. Please feel free to reach back out for any further questions or clarifications.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.