I am putting together a series for people who are excited to bring Azure into their software development life cycle and use Azure cloud’s extensive services to their full potential.
In this series, I will cover as below:
- Getting Started with Azure Development, Create App Service Plan and Publish MVC project using Visual Studio
- Deployment Slots and Slot Swap on Azure App Service using Visual Studio and Azure SDK
- Remote debugging App Service using visual Studio, monitoring and configuring alerts
- Diagnostic logs, live stream, process explorer and KUDU
- How to use Azure SQL Database in Dot.net Applications
- How to use Azure DocumentDB or Azure Cosmos DB in our Dot.net Applications
- How to use Visual Studio Team Service to do continuous Integration and continuous delivery
- Azure storage data services types and how to store files in azure storage account 1/2
- Azure storage data services types and how to store files in azure storage account 2/2
- How to use Azure Functions and trigger on new image/blob creation in Azure Storage using BlobTrigger 1/2
- How to use Azure Functions and trigger on new image/blob creation in Azure Storage using BlobTrigger 2/2
If you do not know where to start, please check my blog post, which covers detail about getting subscription and setting up. In this series, we assume that you already have active Azure subscription and Visual Studio 2013 or later installed on your system.
- Getting Started with Azure Development, Create App Service Plan and Publish MVC project using Visual Studio
To get started with Azure development we need to have Visual Studio 2013 or later, Azure SDK and of course active Azure subscription. In all of our demo we will use Visual Studio 2017 with already have installed Azure SDK if you do not have Azure SDK please visit link to download appropriate SDK for your visual Studio https://azure.microsoft.com/en-us/downloads/ for example if you have Visual Studio 2013 then you need to download the SDK for that particular version of VS.
Figure 1 Download Azure SDK
Let us fire up our VS2017, although we are using VS2017, the same steps will apply to all previous versions of the VS.
Figure 2 Create new Web Application in Visual Studio
We want to create MVC application with authentication set to Individual User Account, this authentication type will allow us to register users and maintain the profile in SQL Server database.
Figure 3 MVC project with Authentication set to Individual User
After VS2017 setup, the project for you it would look like as below:
Figure 4 Visual Studio Create MVC Web Application
Now all we need to do is to build the project and publish it to Azure. After building your project Right Click | Publish the project.
Figure 5 Publishing MVC project from Visual Studio 2017
Now choose Microsoft Azure App Service | Publish and then add your Microsoft Account on which you have your Active Azure Subscription.
Figure 6 Create Microsoft Azure App Service Plan using VS2017
Now name your Web Application choose subscription and Create new Resource Group, you can notice that “AzureDeveloper” have “” at the end it means it will be created as new, and for me I already have an app plan. In your case, you will create new one, choose the Location that is near to you, check http://azurespeedtest.azurewebsites.net/ for response time of different data center to find out best location to use according to your location.
Figure 7 Create Application Service Plan along with App Service
After some time it will automatically take you to the website, you have created.
Figure 8 Web App is created using Visual Studio 2017
Now it is time to publish our Application to the server, Just change the Home page view which is under Views | Home | Index.cshtml and make some changes to this page.
Figure 9 Change the Index.html in MVC Project
Figure 10 Publishing Profile connected to Azure
Hit the publish button, it may take some time to upload the files for first time and depending upon your Internet Connection Upload speed. Once uploaded we can see our change is reflected.
Figure 11 Publishing Change using Visual Studio 2017 to Azure App Service
Congratulations, you have successfully created new App Service Plan using Visual Studio and Azure SDK and published your very first change to Azure App Service.
Coming up next Deployment Slots and Slot Swap on Azure App Service using Visual Studio and Azure SDK
Good Job Zaheer
Thanks man, your feedback really means a lot to me.
Thanks for sharing and influencing you made your mark
Thank you so much for your kind words.
Excellent explanation, and a robust track of learning.. Keep it up buddy.