From today post i’ll give a step by step guide to create an azure web app & deploy the web site code using source control repository.
Prerequisite
- An Azure account (Free trial )
- Source control repository (GitHub, Bitbucket etc)
- Visual Studio or any other developing tool.
Before creating a web app in azure I create a sample web application using visual studio and push the solution to bitbucket repository, for this you can use SourceTree or git commands.
Create a web app in Azure
Login to Azure portal using the credentials.Navigate to App Services.
In App Service blade click add then it will open another tile to enter the web app details as below.
- Enter web app name (Must be Unique)
- Select the subscription
- Chose an existing resource group or create new resource group
- add web app to existing app service plan or create a new app service plan
When you click create azure start to deploy web app.
After deployment finished you will see an empty web app. So now we are going to configure source control repository to push the web app code to empty web app.
Click the settings on web app blade.
Click the deployment source in settings blade
Select the deployment source method from the deployment source tile
The configuration for the source control repository may vary from method to method for this demo I chose bitbucket. For bit bitbucket we can configure as follows.
- First we have to choose the deployment source.
- Authorization will add the source control account used to deploy code.
- Next select the web app project you wish to deploy
- Configure the branch for the repository
- Click OK to deploy the code
When you hit the OK azure setup the deployment process to web application
When click the deployment source in settings tile you will see that web app is syncing with the source repository and pulling the source code.
After few minutes finished pulling the code and alert the deployment is success.
Now when you click the URL you will see the sample web application.
Now you will see a funcioning Web app.
Additional Resources
Continuous deployment using GIT in Azure App Service