In this tutorial, I am going to show the simple GUI based steps that how we can deploy our code to Microsoft Azure, but we can deploy using git, azure-cli.
Let’s create simple ASP.NET Core project
Make a new folder
Navigate to the newly created folder.
Set up and restore new ASP.NET Core MVC project.
Run the project on your local machine to check it is working or not
Now, we have working sample project, and it’s time to push our code to GitHub account
Create new repository with any name you like, and description is optional then hit create button
Initialize git repository from the current one to add a .git folder and makes it possible to start your revision history.
The add all the existing files and folder to the index
Record the state as your first commit in the history to the master branch of your project
Now create a new remote called origin and then locate URL
Push the local commit to the remote master branch
Now refresh your repository in browser to see the code
Now it’s time to play with Azure
Follow the steps to create new Web app instance
After successful creation and deployment, notification will appear shown in blow image
Wait a moment so that Azure can make a connection with our GitHub repository. After that Azure will start the process of build and deployment. You can see the progress by going deployment options.
After successful deployment, you can see the green active icon
Now browse the URL, Overview > URL
Your website is live on the internet.
But wait, the important point is to make sure that our deployment is automatic, for this we will make some changes in our project then commit and push these changes to our GitHub repository if the changes occurred in the live website then have achieved our goal otherwise, there is some problem.
So, open the project in Visual Studio Code
Open the Views > Home > index.cshtml file
change some code and add these changes to the git index
Commit and push to the remote master branch
Open Azure portal
Go to APP DEPLOYMENT > Deployment options wait for the green active icon.
Now refresh your live website and see the change
Congratulation, That’s it.