How to Setup and Use API Management (APIM) in Microsoft Azure Portal

In Azure, the API Management service helps organizations manage APIs. In this post, we will look at how this works. Let’s follow the example at https://docs.microsoft.com/en-us/azure/api-management/import-and-publish. We will manage a sample API located at https://conferenceapi.azurewebsites.net/?format=json which looks like below: Log into Azure Portal at https://portal.azure.com and search for API Management and select API Management Services: You will see below. Click Add: You will see: Enter a Name, Resource Group etc and click Create: … Continue reading How to Setup and Use API Management (APIM) in Microsoft Azure Portal

How to Use Azure Notebooks Hello World

Azure Notebooks are Jupyter notebooks running on Azure, which is great as users don’t need to install any software locally, and it comes with other cool features as well. To access Notebooks, go to https://notebooks.azure.com/ and sign in: You will be prompted to create a user id. Enter one and click Save: You will see below: Let’s click on Create a New Project, called Hello World. Note the option to make this … Continue reading How to Use Azure Notebooks Hello World

Updating Swagger in an Azure API Management Service

In this post, we will look at how to update Swagger in an Azure API Management service. Let’s continue from this previous example, where we created an Azure App Service. Our Swagger for this app service looks like this: If we go to our APIM in Azure, let’s add in this code. Click on swagger.json: We see the JSON. Get the URL: Paste it into the APIM Open Specification: We see … Continue reading Updating Swagger in an Azure API Management Service

How to Secure an Azure App Service with Azure AD Authentication

In this post, we will look at how to secure an Azure App Service with authentication by using Azure Active Directory. Go to https://portal.azure.com and select an App Service. We will use one we created earlier. Select Authentication / Authorization: Set App Service Authentication to On: Select Azure Active Directory. Note the other options – Facebook, Google, Twitter etc: We see: Let’s use Express setup. We will call our app CarlCRMAPIADApp: … Continue reading How to Secure an Azure App Service with Azure AD Authentication

Adding App Insights to an Azure App Service

In this post, we will look at how to add Azure App Insights into an App Service. Log into the Azure portal at https://portal.azure.com/ and select your App Service, then go to the Application Insights menu option. Click Turn on Application Insights: We see “Your app will be connected to an auto-created Application Insights resource: CarlCRMAPI Instrumentation key will be added to App Settings. This will overwrite any instrumentation key value in … Continue reading Adding App Insights to an Azure App Service

Using the Developer Portal (Legacy) in Azure API Management

In this post, we will look at the Developer Portal (Legacy) for Azure API Management. Browse to your APIM in Azure and click on the link: On selecting this, we get to a developer portal: We see our APIs. Select one: We see our operations. Select one and click Try It: We can select a Subscription Key and click Send to send a request: We get a 200 Response back. … Continue reading Using the Developer Portal (Legacy) in Azure API Management

Using Products in Azure API Management

In this post, we will look at using Products in API Management. Products let you “group APIs, define terms of use, and runtime policies”. To use products, go to APIM and select Products: We see 2 products – Starter and Unlimited: If we open Starter, we see this product has a rate limit of 5 calls per 60 seconds: The Unlimited policy does not contain this: Let’s create a new … Continue reading Using Products in Azure API Management

Using Postman to Hit an API Management Endpoint with Subscription

In our previous posts, we created an App Service and an API Management in Azure. Let’s now use Postman to send a request to the Azure API Management endpoint. Go to the APIM and select the API. Under Settings, copy the Base URL: Now, in our case, we have /api/Customers to get all customers: So our URL is https://crmdevapim.azure-api.net/api/customers. Let’s open Postman and create this request. Click Send: We get a … Continue reading Using Postman to Hit an API Management Endpoint with Subscription

Backend service URL is not defined in Azure App Service

In this post, we will look at the error “Backend service URL is not defined” when making a request to an ASP.NET Web API through API Management. I have a .NET Core Web Api with Swashbuckle / Swagger. The Web Api is published to an Azure App Service, and an Azure API Management has this API loaded. We can run a test message using the APIM: We get a 500 … Continue reading Backend service URL is not defined in Azure App Service

Adding Swagger OpenAPI to an ASP.NET Web API

In this post, we will add Swagger OpenAPI to an ASP.NET Web API project. Swagger OpenAPI is a way to document the capabilities of your API. We can do this in .NET by adding the Swashbuckle NuGet package. Let’s continue with our Web Api project we created earlier. We will open the project in Visual Studio and add the Swashbuckle.AspNetCore package: Click OK: Now open Startup.cs and go to ConfigureServices: We … Continue reading Adding Swagger OpenAPI to an ASP.NET Web API