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.
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.
<publishProfile profileName=" - Web Deploy"
<publishProfile profileName=" - FTP"
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.
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.
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.
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
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.