Building and Deploying a Basic REST API with Azure App Service, Azure Portal, and Visual Studio

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome back to our Channel my name is balram Prasad and I am working with Microsoft engineer software engineer today I will be walking through you the process of building and deploying rest API in azure in this demo we are going to create API app using Azure portal and then we are going to create a rest API project inside visual studio and we are going to deploy from Visual Studio to Azure and see how we can use that with swagger let's start so for this demo we are into Azure portal and inside our Resource Group where we are going to create API app resource let's go ahead and create in Marketplace we can search with API apps the API app option will come along with the web app plus database static web app so we have seen that how to create a static web app webs in also web app how to create web app now we are going to see how to create API app an API app is generally we are creating where we are going to create and deploy a test full API in seconds so this is built on app services framework and this is great service provided by Azure so let's go ahead and click on create let's put a fully qualified name so that this name whatever name we will provide dot Azure website.net we can access and there are multiple flavor we published static web generally for a static web we have seen where we can deploy any static HTML or react or angular type of application Docker container where we can bring our containers code where we can select the different runtime mistake.net or asp.net go Java node or PHP python review whatever we want to do so if we go into Ruby select that will be in Linux and if we select PHP also only it is on web level on Linux if we select node then we have an option where windows and other things are there if I go for dotnet we have the default Edge windows and Linux so I am going with dotnet because I want to deploy this service from Visual Studio so in next as we selected windows we have Windows plan here now we can see that what Hardware we want to use and what kind of plan so there are free plans and there are premiums launch a standard plan different plans we can go and explore pricing tier and depending upon we want to see where the hardware where different type of Hardwares will come or different feature wise we want to see we can explode and see right now I am going to select default test enter S1 where B CPU is 100 and the CPU code is one memory is 1.75 and different things so let me select these details and I am going for deployment deployment we can enable continuous deployment from GitHub I am going to disable because I am going to deploy from our Visual Studio directly for demo purpose let's go to networking section where we can inject a network injection for more security like private endpoint and other things that we are not going to do right now monitoring where we can enable app inside where all the logs will go to application inside and then we can see what is happening inside our application it's another thing so I am going to keep default and we can go ahead and create this resource so Now API app is created let's go to resource now if we browse this API app your web app is running and waiting for your content so let's go ahead and download this publish profile now let's go to visual studio and let's create the APA application let's create a new project I am going to say that apisp.net and I am going to select acsp.net core web API so let's go next and let me put a name to be and here person is there I am using dotnet which we have given and I am going to enable AP open API support to see Swagger and other details to browse and see what apis are there let me create so now if we see uh that weather forecast is model has been created and if we see controller whether forecast is created and different settings is there right now Swagger is enabled Swagger and Swagger UI provides the UI to explore our API let me run locally so see how it looks like now if we go into our code and this is Swagger UI where we have we have one API which is get API if we try that one out and execute that one we are going to get that output and if we see inside our API controller uh we have this weather forecast controller where we have a get call and in git call it is generating some random data to return to that one this is what we are saying now let's go ahead and deploy this one for deployment we can go into publisher and there will be multiple options is going to come for deployment we can directly deploy from Azure without publisher profile but as we deployed the published profile I am going to import profile let me browse that publish profile and let me finish it will create a profile for publish purpose and let me close that now ready to publish so I am going to publish this API app generally for coding purpose we add this to Source control and create our own branches in repository and then we do code review and other things and then in cicd will be enabled into our report so that deployment will happen but demo purpose I am going to do this way so that we know that this is gonna wait for testing another purpose if you want to also do the demo without all the setups then you can do all this so now it is published and it is installed the extension and it is deployed all these things it says that it is not found but let me put that name as Swagger here and let's see that what it says let me try to see let me debug from here let me see if Swagger is enabled into only development that is why it is not coming let me remove this code so that at least for demo purpose we can see the Swagger let me build and deploy one more time let me publish now let's put the Swagger URL and now we can see that Swagger is coming and now if we go and try it out our web API is ready and we can use this web API from anywhere right now using this list endpoints and other things so this is what I wanted to show you in this demo thank you thank you foreign [Music]
Info
Channel: SoftWiz Circle
Views: 15,361
Rating: undefined out of 5
Keywords: microsoft azure, azure app service, app service, azure web app, azure functions, azure app services, deploy asp.net core web api to azure, deploy asp.net core api to azure, deploy rest api to azure app service, visual studio publish api to azure, deploy .net core web api to azure app service, web apps, visual studio, azure app service tutorial, web apps tutorial, web apps in azure, azure web app tutorial, web apps explained, api app azure, azure api app tutorial
Id: UxTp9vRtvx4
Channel Id: undefined
Length: 7min 33sec (453 seconds)
Published: Mon Feb 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.