Deploying your app to App Service is a matter of deploying your code, binaries, content files, and their respective directory structure, to the /site/wwwroot directory in Azure (or the /site/wwwroot/App_Data/Jobs/ directory for WebJobs).
- Create a Web App in Azure Portal
- Login to Azure Portal, https://portal.azure.com/
- Azure Portal => More Services => Web App => + Add
- Select Web Apps => Create
- Name = “DssDemoWebApp”, Subscription = “Free Trail” Resource Group=”DemoRG”, App Service plan/Location=Create New Plan (Name=Standard_Plan, Location=Central US, Pricing tier=S1 Standard.
- Application Insights=Off
- Visual Studio => Create a new ASP.NET MVC Web Application in Azure Web Service
- File => New => Project
- Visual C# =>NET Web Application, Project Name=”DemoWebApp” => OK
- Select Template = MVC, Change Authentication = No Authentication => OK
- Deploy / Publish the project from VS.NET.
- In Solution Explorer, right-click the project, and choose Publish.
- The wizard opens to a publish profile that has settings for deploying the web project to the new web app. If you wanted to deploy to a different web app, you could click the Profile tab to create a different profile.
- Choose default options and finally click on Publish.
The Output and Azure App Service Activity windows show what deployment actions were taken and report successful completion of the deployment.
- Getting Publish Profile from Azure Portal and publishing from Visual Studio
- Click App Services, and then click the name of your web app.
- In the tool bar click on Get Publish Profile
- Save the Profile locally on your disk.
- Go to VS.NET, Right Click on Project => Publish
- Select Profile Tab => Click Import => Provide the downloaded profile name => OK
- Click Publish.Note: Profile will be saved for further use in <Project>/Properties/PublishProfiles/*.pubxml
To Gets an Azure Web App publishing profile using PowerShell:
Get-AzureRmWebAppPublishingProfile -ResourceGroupName "DemoRG" -Name "DemoWebApp" -Format "WebDeploy" -OutputFile "D:\outputfile.publishsettings"
Publishing using FTP tools like FileZilla
- Azure Portal => Click App Services, and then click the name of your web app.
- Go to Settings => select Deployment Credentials
- Provide FTP/deployment username and password
- Look at Essentials Section of Selected App Service and copy FTPS hostname and username
- Open Windows Explorer and use the above hostname and credentials to connect and upload files.
Note: Although it’s easy to copy your web app’s files to Azure using FTP utilities, they don’t automatically take care of or coordinate related deployment tasks such as deploying a database or changing connection strings. Also, many FTP tools don’t compare source and destination files in order to skip copying files that haven’t changed. For large Apps, always copying all files can result in long deployment times even for minor updates since all files are always copied.