ASP.NET Core 6 Web API CRUD operations in Azure SQL Server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys today I will show you Ash blue nickel web API crude operation in Azure SQL Server we need to start first to create web app Azure web app uh to in order to deploy our web.is.net web API you need to follow the previous video for this then we need to create Azure SQL Server and we will populate data with using a SQL management Studio then the third step we need to create a student code API using Entity framework and scuff scuff folding next the last final we will deploy our web API into the Azure web app and we will test fetching the data from SQL Server let's to start to create Azure SQL SQL Server you need to go to resources and find SQL database and create a button here now we need to assign the resource Group I will use existing Resource Group here then we need to give the database name we use DW database name and now here we need to give the server name This Server we will use for SQL Server for SQL database we will use it so we you call it SQL Server it must be unique name here we use the SQL Authentication this is called authentication admin and password we will use when we connect to the SQL Server so please remember your admin login and password Here we call it DW user admin name and we type the password Here and also here in URL database Windows net we use this one as a connection string when we connect to database click ok and we already choose this just now created server then we use we need to use the development for for now for learning for learning clicking it oh and here we need to give access to public in order to connect to the SQL Server and also we need to give access and firewall for the Azure services and resources because we need uh web Azure web app for the to connect to the SQL Server and also we need to give access to the my laptop we need to check the yes here and click knit next uh hole is here just keep as it is click next also keep click as click next click and here now it's it's it is being create created our secret server now it may take for a while our deployment is successfully completed so we create only the SQL Server DW so now we need to go to to populate database we need to go exclusive management studio if you don't have please go to Google Search SQL management studio and from there download and install in your laptop go to engine to connect and here we need to get the server name just copy this this is the server name for our SQL Server database just copy paste here and just pass here and use a previously created admin login name here DW user and your password click on it yeah we successfully connect to the Azure SQL Server to the DW database and now right click and click the query I have some tsql query to create a table and generate the data I just copy paste this and click execute button so now successfully we create populate our data next step is we need to create a s.net with API to fetch data to the from the Azure circuit server open the visual studio code yeah sorry Visual Studio and go to create project and here I choose the explore web API click next just we call it employee API click next click create here before starting a work with API we need to install some nuget packages entity new get packages go to nuget package and we will get management and type here entity you can see here entity Microsoft Entity Framework install first this uh package then after that install Microsoft entity from our code tools click accept last package is Microsoft SQL Server when we successfully installed all three packages now we need to use a command line sex couple DB context command line to generate our models it will help us to generate model based on existing database tables just copy paste is for the connection string Azure 6 0 connection same server name now we need to give the database DW database then we need to give user ID user ID is DW user and give the password Here and we need to give the trusted connection first and encrypt it to and we need to give where to generate and press enter now it should generate our models cool sorry I give type wrongly if W it should be DW database name so let me fix it DW DW and Enterprise again it's successfully create our modules now we need to move these to app settings this connection string go to app settings Json and click here connection string we give the DB connection yeah and now we can remove from here and run it here and now we need to go to program startup and we need to uh apply here DB connection services and it DB context our DB context currently we use DW context let me create this Builder Dot configuration sorry configuration get Connections three and create here we need to get DB connection here let's solve let me build a application it will run successfully or not application creates successfully so there is no any error let me go to new skillful to add controllers choose here API controller with action and choose here employee it should generate For Us controllers now let me run it let me check [Music] fetching data from from the secret server Azure SQL Server will work or not let me check now here with using swagger I successfully retrieve the data yes we can retrieve data successfully but it runs in localhost so we need to deploy our API to the web app Azure web app go to uh Azure zip up here choose existing web app Azure wrap up here click next you can skip here just keep it and click finish and click publish you can see in previous way previously videos if you don't know how to publish asp.net into the web Azure web app now successfully publish it let me check uh it will work a lot so that I need to add some some wrong in url something wrong ah we forgot something we successfully retrieved data from from Azure SQL Server by ID also we can retrieve
Info
Channel: KeepLearn
Views: 3,271
Rating: undefined out of 5
Keywords: Clipchamp, Online video editor
Id: YiZ1cyPTGIc
Channel Id: undefined
Length: 15min 54sec (954 seconds)
Published: Mon May 01 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.