Click here to Skip to main content
15,881,715 members
Articles / Hosted Services / Azure

Deploy Your Site to Azure App Service from Visual Studio

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
27 May 2018CPOL3 min read 8.5K   1  
How to deploy your site to Azure app service from Visual Studio

Building your website and publishing it in Azure app service is simpler than publishing the site into a remote machine. There are several methods through which you can publish your site into Azure.

Import Publisher File

This is one of the easiest ways to publish your site in Azure app service. First of all, create a new app service or if you have an existing one, open the Overview section of that.

You will find several options on top of the Overview sections like Browse, Stop, Swap, etc. There will be another one named Get Publish Profile. By clicking on that link, a new file will be downloaded with .PublishSettings extension.

Get publish Profile

If you open the file in any text editor, you will find that it is nothing but an XML file having 2 tags. One for web deployment and another for FTP deployment with your app name. Within that, you will also find all the credentials for your deployment. Both for FTP and web deploy. But as usual, all passwords will be decrypted so it is harmless.

XML
<publishProfile profileName=" - Web Deploy"
                publishMethod="MSDeploy"
                publishUrl=".scm.azurewebsites.net:443"
                msdeploySite=""
                userName=""
                userPWD=""
                destinationAppUrl=""
                SQLServerDBConnectionString=""
                mySQLDBConnectionString=""
                hostingProviderForumLink=""
                controlPanelLink="http://windows.azure.com"
                webSystem="WebSites">

<publishProfile profileName=" - FTP"
                publishMethod="FTP"
                publishUrl="/site/wwwroot"
                ftpPassiveMode="True"
                userName=""
                userPWD=""
                destinationAppUrl=""
                SQLServerDBConnectionString=""
                mySQLDBConnectionString=""
                hostingProviderForumLink=""
                controlPanelLink="http://windows.azure.com"
                webSystem="WebSites">

Now open your Visual Studio IDE and create a new application. In case you have already created it, go to the solution. Right click on the solution -> Click the publish option to open the publish dialog.

Now in the publish dialog, you will find an option named “Import”. Click on that option and a File dialog will be opened. Choose your file and click OK. After clicking OK, it will automatically redirect to Connection tab in Publish web window.

Import

File dialog

Now you can choose either Web deploy or FTP from the drop down over there. For both, all the fields will be pre populated with all the information and credentials.

Publish Web

Click on the Validate connection and check our connections from Visual Studio.

Click Next to choose configuration parts. Choose either Debug or Release, whatever is suitable for your applications. You can also manage File publish options from here.

Again, click on the Next to go to the Preview section. Click on the Start Preview button if you want to see the files are going to push into the server. Or click Publish (Keyboard: P) to publish the site into your app server.

After successful deployment, the site will be open automatically in your default browser.

FTP Deployment

There is another quick method to deploy your site into Azure app service through FTP. Go to the Overview section of your app service. In the first section right side, you will find the details of FTP connections. Usernames, FTP hostname, FTPS hostname. Password for this deployment with your own account password.

Go to Visual Studio and right click on the solution. Click the publish option and create a new publisher profile. Choose FTP in the Connection tab from Publish method drop down list.

Server: FTP hostname/ FTPS hostname
Site Path: site/wwwroot (Check the passive mode)
User name: FTP/deployment username
Password: Your account password
Destination URL: Your site URL

FTP Deploy

Click on the Validate button to validate your enter details and connection. Click on the publish button to publish your site. After successful publish, site will be opened in your default browser automatically.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer PwC
India India
I am a Software developer having an experience of 5 years in application development. To get me you can mail me at arkadeepde@gmail.com or you can visit my blog at ASP With Arka

Comments and Discussions

 
-- There are no messages in this forum --