Posts

Showing posts with the label Azure

Implement Open API specification in .NET Core Web API using Swagger.

Image
Documentation is always crucial part of development, developers can always check that API is available or not before creating a new one. Swagger is a great framework to use when it comes to API documentation. It's  not only provide the UI but also provide an OpenAPI specification which is used to create client for using the API. Using this specification and Swagger Codegen, you can create client for c#, angular and many more. The purpose of this post is not just to implement swagger but also to describe how you can specify other OpenAPI specification properties like schemes and hosts which is important when you are working with Azure API management. Prerequisites  To follow along you need  Visual studio 2017 Let's Get Started Step 1 : Create a .NET Core API using Visual studio 2017. Step 2 : Remove existing controller and create a new empty controller and name it UserController. Step 3 : Add the followin...

Azure Search-Create Index

Image
This is the second post in the series of implementing Azure search. In previous post I described what Azure search is and how can implement it. As discussed in previous post, implementation of Azure search is four step job. Provision Service Create Index Load Data Finally Search. Let's get started. Create Index You can create index from portal as well as code. In this post I will be using the code to create the index and also give the overview to create index from the portal. Overview from portal Let's  go ahead and click on Add Index button on overview screen. Here you will see  Name of the Index Fields: You can insert as many fields as you want. You can also select whether it should be searchable, sortable, filterable, etc.. From Code For this demo I will be using VS 2017 Go ahead and create a .NET core MVC product using visual studio. Install Microsoft.Azure.Search nuget package.  From portal  Copy the Name of the Azu...