question

AbdulWahab-9817 avatar image
0 Votes"
AbdulWahab-9817 asked ·

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

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.

qna-help-articleazure-app-configuration
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

vb2ae avatar image
1 Vote"
vb2ae answered ·

Could you post the code for the valuescontroller?

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AbdulWahab-9817 avatar image
0 Votes"
AbdulWahab-9817 answered ·

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)
     {
     }
 }

}

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please see this screenshot10177-error.png


0 Votes 0 ·
error.png (49.0 KiB)
Monalla-MSFT avatar image
0 Votes"
Monalla-MSFT answered ·

Hello @AbdulWahab-9817,

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.




·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.