After some time of researching, I've found a working solution.
The old website solution should be prepared a bit:
- Set up Storage and Cloud Service at your Azure account;
- Install Azure SDK and if needed Powershell Azure Cmdlets (before Azure SDK 2.0 they were not integrated into the SDK);
- Add new project to the solution with the type
Cloud -> Azure Project
, but don't select roles on this step; - Right-click on roles and add from existing web project.
At this step you may deploy solution from Visual Studio's drop-down menus like "Publish..." or "Package...". But configure your role first.
To make the package be automatically deployed, just do the script, which is described here. This is the most clean script, I've found, which is making Deployment procedure of any Azure SDK.
To make automatic project package, just run the following powershell script:
$project = resolve-path ".\..\relative\path\to\azure\deploy\project.ccproj"
Import-Module -Name ".\Invoke-MsBuild.psm1"
$buildSucceeded = Invoke-MsBuild -Path $project -P '/p:configuration=release /p:overwritereadonlyfiles=true /p:targetprofile="Cloud" /target:Clean;Publish'
if ($buildSucceeded)
{ Write-Host "Build completed successfully." }
else
{ Write-Host "Build failed. Check the build log file for errors." }
For this script, you will need Invoke-MsBuild.