Is it possible to Create Rest API in Azure portal and DB will Azure Sql Server

Shilpi Ghosh 0 Reputation points
2023-08-28T04:15:50.5933333+00:00

Hi Expert,

I need help in Create API in Azure Portal.

I have to create a Rest API (Get only). Data Base Azure Sql Sever. I can create in Visual studio and import in API Management. But for this case I may have to host this API.

Is there any facility in Azure Portal to create & Host API and Back end DB will be Azure SQL server.

Thanks

Shilpi

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,733 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RevelinoB 2,775 Reputation points
    2023-08-28T04:35:30.98+00:00

    Hello Shilpi,

    Certainly, you can create and host a REST API in Azure using Azure API Management and connect it to an Azure SQL Server database. Here's a general outline of the steps you can follow:

    • Create Azure SQL Database: First, you need to create an Azure SQL Database where your data will be stored. You can do this through the Azure portal. Make sure to note down the connection string and credentials for your database.
    • Create Azure API Management Instance: Set up an instance of Azure API Management service in the Azure portal. This service will act as a gateway for your API. It provides features like authentication, caching, rate limiting, etc.
    • Design and Import API: In Azure API Management, you can design and define your API using the Azure API Management Developer Portal. You can import an OpenAPI (Swagger) specification if you have one, or you can manually define the API endpoints, methods, and request-response structures.
    • Configure Backend API: In API Management, you will need to configure the backend for your API. This is where you specify where the actual logic of your API resides. In your case, it will be the Azure SQL Database. You will set up the URL to your database and configure authentication if necessary (using the connection string you obtained earlier).
    • Testing: Once your API is configured, you can test it using the Azure API Management Developer Portal's built-in tools.
    • Deploy API: After testing, you can publish your API to make it available to users. Azure API Management handles the hosting and scaling of the API for you.
    • Security and Monitoring: You can configure security features such as authentication and authorization for your API. Additionally, you can set up monitoring and analytics to track API usage, performance, and other relevant metrics. Here are a few more points to consider:

    Azure Functions or App Service: Depending on your requirements, you can also create a backend for your API using Azure Functions or Azure App Service. These platforms provide managed compute resources for hosting your API logic.

    Azure Logic Apps: If your API involves complex workflows or integrations, you might also consider using Azure Logic Apps to orchestrate these processes.

    Remember that the exact steps may vary based on your specific use case and requirements. It's recommended to refer to the latest Azure documentation for detailed and up-to-date instructions on creating APIs and connecting them to Azure SQL Server databases within Azure Portal.

    I hope this helps you get started with creating and hosting your API on Azure! If you have any more questions or need further assistance, please feel free to ask.

    0 comments No comments