Hands on Lab for Zero Downtime
- Prerequisites
- Deploying to Azure Web Apps
- Simple CI/CD Pipeline
- Advanced CI/CD with Deployment slots and Zero Downtime
In this section, we'll create a web app using Visual Studio and deploy that application from your local machine to Azure directly from Visual Studio
- Open Visual Studio
- Click File -> New -> Project
- Select .NET CORE from the left side and ASP.NET Core Web Application from the middle. At the bottom name your application whatever you like (HelloWorld, ZeroDownTime, etc). Check the checkbox next to Create Directory for solution and for Create new Git Repository and click OK
- On the New ASP.NET Core Web Application Screen, select Web Application (Model-View-Controller) and click OK
- In the toolbar change the startup type (next to the "play" button) from IIS Express to the name of your project. For example, if your project was named ZeroDowntimeApp that is what you would see. This will run the website as a self service website and not in IIS.
- Click the Start / Debug button to launch the App
- After the app comes up, make a change to the Views/Home/Index view and refresh the page to see the update you just made
- Close the browser and go back to Visual Studio
- In the Solution Explorer, right click on the application and click Publish...
- On the publish screen, select "Microsoft Azure App Service". Make sure the Create New radio button is selected and click Publish
- Now you should see the Create App Service window. On that screen, make sure you are signed into Visual Studio with the same account that you signed up for your Azure Account with. You can either enter custom names for Application Name, Resource Group and App Service Plan, or leave the default values.
- Click Create. Your Resource Group, Web Application and App Service Plan are now all being created in Azure. This will take a few minutes.
- Once the publish is finished, your default browser will open up with the website you just published.
Next up: Simple CI/CD Pipeline