Question about Azure Web Services for .NET MAUI

Jassim Al Rahma 1,571 Reputation points
2023-04-27T16:30:20.9166667+00:00

Hi,

How can I create a REST Web Service for my .NET MAUI app in Visual Studio for Mac and Azure? is it API App or Web API?

Thanks,

Jassim

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,843 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,760 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 17,886 Reputation points
    2023-05-03T06:11:31.3+00:00

    Hi @Jassim Al Rahma ,

    Your scenario can be achieved using either an API App or a Web API. Both options are valid and can be used to create a RESTful web service.

    Here are the steps to create a RESTful web app using an API App:

    1. Open Visual Studio for Mac and create a new project.
    2. Select "Cloud" from the left-hand menu and then select "Azure API App" from the list of project templates.
    3. Follow the prompts to configure your API App project. You will need to provide a name for your project, select a subscription and resource group, and choose a hosting plan.
    4. Once your project is created, you can add your RESTful endpoints to the project. You can do this by adding a new controller class to your project and defining your endpoints using the [HttpGet], [HttpPost], [HttpPut], and [HttpDelete] attributes.
    5. Deploy your API App to Azure by right-clicking on your project in Visual Studio for Mac and selecting "Publish". Follow the prompts to configure your deployment settings and publish your app to Azure.

    Here are the steps to create a RESTful web service using a Web API:

    1. Open Visual Studio for Mac and create a new project.
    2. Select "Web" from the left-hand menu and then select "ASP.NET Core Web Application" from the list of project templates.
    3. Follow the prompts to configure your Web API project. You will need to provide a name for your project, select a template (such as "API"), and choose a hosting option.
    4. Once your project is created, you can add your RESTful endpoints to the project. You can do this by adding a new controller class to your project and defining your endpoints using the [HttpGet], [HttpPost], [HttpPut], and [HttpDelete] attributes.
    5. Deploy your Web API to Azure by right-clicking on your project in Visual Studio for Mac and selecting "Publish". Follow the prompts to configure your deployment settings and publish your app to Azure.

    Hope this helps. Let us know if you have any questions.

    -Grace

    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.