Deploying Your Website to Azure
You want to deploy your website to Azure you have many ways to do it. This post is going to provide you an overview on how you can publish your website to Azure. This includes both ASP.NET and PHP.
We have some common deployment methods few of them are as follow.
- Web Deploy
- FTP
- IDE
- Source Control
There are three ways we can deploy website to Azure App Services.
- Deploying form IDE
- Deploy using FTP
- Publishing from Source Control
Deploying form IDE
You can use Microsoft Visual Studio or Web Matrix to deploy your website to Azure. Both of IDE’s provide easy support to publish your website to Azure. Both of these IDE can use Web Deploy technique and takeover all of the deployment related task such as database deployment.
Before you can deploy your website you need to create a Web App in your Azure Portal. Here is how can create your web app back in the portal.
- Click New
- Click Compute
- Select Web App
- Select Custom Create
Once you clicked Custom Create you the following window in front of you.
- Give the name to your website. In my case i name it as “examplewebsitetest“
- Select the APP SERVICE PLAN. I have selected the already configured Plan. You can also create a new one as well.
- Click the OK Button marked Green.
Now your web app is created and ready to use.
You can click the URL to visit your website.
Lets publish a simple ASP.NET website to Azure. I have a sample project ready in Visual Studio i will be uploading it for tutorial.
Select the Website project that you want to publish to Azure. Right Click on it and click on publish.
Here Click on Microsoft Azure Web Apps
It will ask you to Sign in to Azure using your ID which is already register and working with Azure Services.
Click on Sign In. Microsoft Login Window Will appear. Give your login details to login. Once you have logged in you will have list of already web apps you made using Azure portal.
From here you can select the URL to which you want to upload your website. You can also create a new Web App from Visual Studio as well by clicking the New Button.
For now Select the URL and click OK
Once you click OK. You will have all he details which Visual Studio will fetch automatically.
You can see the Publish Method Option. It is by default to Web Deploy. You can change to FTP as well. But you will need to provide the FTP Login details Which you can get from the Azure Portal. Now click Next Button to continue.
Now you website is ready to be published. Just Hit the publish Button and Visual Studio will take the rest of control and perform the required Task For you. Once your website has been published Visual Studio will automatically open it in your Default Web Browser.
We looked how we can deploy our ASP.NET application to Azure using IDE/Web Deploy Method. Now lets publish a PHP Website to using the FTP method
Deploy Using FTP
If you want to deploy your Website through FTP method you need to following things with you
- filezilla client (or anyother FTP client you like to use)
- Setup FTP access in Azure Portal
You need to setup FTP access. Here is how can configure the FTP access to upload your website.
Go to your website Dashboard by click on your website.
You will see this Screen. Note that if you already set the Deployment Credentials the option marked red will be shown. If not it will ask you to Setup your Deployment Credentials. The process is same for both. Click on Reset Your Deployment Credentials/Setup your Deployment Credentials. It will ask you for a username and password. Provide the username and password of your choice and hit OK.
Once you have configured the login credentials, you need to get the hostname for your site, which can be easily founded in your website Dashboard.
You can see the FTP Hostane and FTP User. Use these details and the password your provided in FTP Client to gain FTP Access.
Here you have the files your website. The default directory will be Site when you get connected. Navigate to wwwroot where you will be uploading your website. Lets try uploading a simple PHP file to the server.
We have uploaded a PHP file to our Azure Server. Lets try it out in browser.
Hence we have checked successfully our website up and running on Azure.
Publishing From Source Control
You can also Publish your website using a Source Control Feature. This is great feature indeed. It is the best feature to publish your website to Azure if your work in a from of team. Every team member can work on his/her own module and then at the end they can upload it to some default storage online and publish it Azure Directly. Online Storage like Dropbox is a great source. You can also use GIT, GITHUb, Visual Studio Online to Publish your website through source control.
Let give it a try using Dropbox. Go and Create a new website. But remember to mention one thing now while creating your website.
And that you must check Publish from Source Control Option and Hit next.
There are different options for you through which you can publish your website. Let try using Dropbox. Click on Dropbox and hit next button. You will have Dropbox login page in front of you. Login to your dropbox.
When you login It will ask you for the permissions. Click on Allow.
Now at the back in Dropbox A directory named APPS is auto Created. Here you will also need to specify a folder name where you are going to upload your website. In my case i left it to default “sourcecontrolpublish”
Back to your dropbox you can see a Folder Apps Has been created. Click on it you are navigated and you will see a folder name Azure. Click on that folder you are navigated and now you will have list of all the website you are publishing from source control using dropbox
In my case i have only One folder listed. Which mean i am working with one website only currently. Click on this folder and you are navigated where you keep the source code of your website.
Here you can upload the source code. If some changes are made in the code you can update here. If you work in a team all the team members can provide the code here. Azure will automatically Sync periodically. Back in Azure you can also sync your website when ever you want to sync by clicking the Sync Button marked Red below. And also you can maintain a complete history of Updates when you updated your website.
- Design