Usama Arshad

 © 2023 itsusamaarshad

ATTACHMENT DETAILS Managing-Your-ASP.NET-Core-API-with-Azure-API-Management

Managing Your ASP.NET Core API with Azure API Management

Recent Post​

What is Azure API Management?

  • Azure API Management is a cloud-based service provided by Microsoft that enables developers to create, manage, and secure APIs. It acts as a gateway that allows developers to expose their APIs to the outside world in a secure and scalable way.
  • API Management provides a variety of features such as authentication, rate limiting, caching, and logging, among others, which help developers to manage the entire lifecycle of their APIs. It also provides analytics and monitoring capabilities to help developers to gain insights into their API usage and performance.
  • Azure API Management is designed to work seamlessly with Azure services, including Azure Functions, Azure Logic Apps, and Azure App Service. It also provides integration with popular third-party tools such as Swagger, Postman, and Visual Studio Code.
  • In combination with ASP.NET Core, Azure API Management allows developers to build scalable and reliable APIs quickly and easily. By leveraging the capabilities of Azure API Management, developers can focus on building the core logic of their APIs, while leaving the management of the APIs to the service.

Here we do a complete demo of how AZURE API MANAGEMENT works with ASP.NET CORE.

  1. Create Asp.net core API Project using visual studio 2022.
  2. Go to Azure Portal https://portal.azure.com/.
  3. Search API Management services.
  4. Click on Create button to create API Management services.

    1. Managing-Your-ASP.NET-Core-API-with-Azure-API-Management.jpg
    Managing-Your-ASP.NET-Core-API-with-Azure-API-Management.jpg.
  5. Click on the  Review + Create button to create the resource.
  6. It takes time to create the resource.
  7. Go to resource and Click on API from the side menu.
  8. Click on Open API.
  9. Run your API Project in Visual Studio 2022.
  10. Publish your API to Azure window service.
  11. Go to the browser and paste this /swagger/v1/swagger.json.
  12. Press enter its shows a JSON form of API.
  13. Copy the complete URL and paste it OPEN API Specification.2Managing Your ASP.NET Core API with Azure API Management
  14. Click on Create Button  to create the API.
  15. Go to the test tab and click on send button you see the JSON response of API.
  16. Now you test the API through Postman.3 Managing Your ASP.NET Core API with Azure API Management
  17. You see the message that “Access denied due to missing subscription key“.
  18. So if we want to share this API with someone we also need to share the subscription key.
  19. To get the subscription key go left menu and select the subscription menu.
  20. Click on Add button to create a subscription key for a specific API.
  21. After the subscription key add you see the name of your subscription.
  22. Click on three dots and click to show/hide and copy the primary key.
  23. Go to Postman  add this key in header “Ocp-Apim-Subscription-Key” and paste your primary key in the value.5Api Management
  24. Now you see the response with status code 200.

Thanks for reading the blog. If you have any questions please drop your message on the contact us page.