Create a C# ASP.NET web application in Visual Studio. In this video, learn how to be able to create a new C# web application.
- [Instructor] There are numerous ways to create a new app service. If you like the command line, there is the Azure Command Line Interface and PowerShell. If you prefer visual interfaces, then your choice is the Azure Portal or Visual Studio, and that's what I'll show in this demo, the Azure Portal and Visual Studio. I'll start by going to App Services. Now I've already got two that I created earlier, I used the Portal to create these and the way I did that is I clicked on Add. This brings up a list of pre-defined templates, there are some standard templates like the Web App. There's the Azure Function App, there's a number of third-party templates in here for blogs. If you don't see the templates on this screen, it's likely that you are using a newer version of the Azure Portal UI. The new location for the templates is in the Azure Marketplace on the Azure Portal. And then over here you give your app a unique name, choose your subscription, pick your resource group. I've been using the same resource group for all of my examples, this one here. And then you click on Create. Let's do those same steps, but this time inside Visual Studio. To create a new project in Visual Studio, go to File, New Project, and pick a template from this page. I'm in Visual Studio 2019, so this is what the dialogue looks like, it's different in 2017 and 2015, but the concepts are the same. Choose your project type, pick from one of these templates, it doesn't have all the same templates you have in the Portal, a lot of the third-party templates aren't here, that HTML5 Empty Project's not here. But I do have two ASP.NET type projects. I've got classic .Net Framework and the new .Net Core, so I'll choose the newer framework. Give my project a name, I'm using the VS part of the name to differentiate this from the one I created on the Portal. Put it in my Repost folder and I'll keep everything else at the defaults. Over here, I pick what files to add to the project and what dependencies and what NuGet packages. So I can choose Empty, API, and many others. I'll choose the Web Application, and then leave everything else at the defaults and then click on Create. Next step is I will compile the project to make sure my NuGet packages are downloaded correctly. And when that's done, we now have our basic ASP.NET site. If I want to look at it, run it in a browser, it's not on Azure yet, so I would need to run it with my local IIS, that's already set up here, IIS Express. So I can go ahead and just go up here and run it. Go ahead and accept this warning for the SSL certificate. And then I get to this site. So at the moment it's running locally, I got my files locally, of course, I should check those into Source Control. In the next video we'll take a look at how to take it from here, from my local machine, and publish it onto Azure.
- Connecting Visual Studio to Azure
- Creating web projects in Azure App Service
- Publishing local projects
- Connecting to Azure SQL Server and Cosmos DB
- Working with blob data on Azure Storage
- Creating resource group projects
- Creating an Azure Function app
- Monitoring and debugging with the Snapshot debugger