Normally, on Azure, changes made in application takes more time to test, to check if it is working properly. The purpose of my investigation was to come over on this. Changes made in application should be visible on site without uploading package on Azure. It will be only for development purpose.
Integration
1. Writing startup script
2. Troubleshooting
Limitations
1. This technique should only be used for development purposes.
2. You can only update a single role instance with this technique.
3. Since you are not updating the Windows Azure package you may lose your changes at any time.
Technologies used to develop various layers of application are as below.
| Category | Technology |
| Web Application | ASP .Net |
| Tool used for deployment | WebPICmdLine |
| Cloud Deployment | Windows Azure Platform |
The inner workings
Steps for setup:
1. Create a folder called Startup in your WebRole project.
2. Create three files in this folder:
- CreateUser.cmd,
- EnableWebAdmin.cmd, and
- InstallWebDeploy.cmd.
For each of these files, change the Copy to Output Directory value to Copy always and the Build Action value to Content.
3. Update CreateUser.cmd to include the following code.
Don’t forget to change <webdeployuser> and <password>.
net user <webdeployuser> <password> /add
net localgroup administrators Sameer /add
exit /b 0
4. Update EnableWebAdmin.cmd to include the following code.
start /w ocsetup IIS-ManagementService
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server /v EnableRemoteManagement /t REG_DWORD /d 1 /f
net start wmsvc
sc config WMSVC start= auto
exit /b 0
5. Update InstallWebDeploy.cmd to include the following code.
"%~dp0\WebPICmdLine.exe" /accepteula /Products: WDeploy /xml:https://www.microsoft.com/web/webpi/2.0/RTM/WebProductList.xml /log:webdeploy.txt
net stop wmsvc
net start wmsvc
6. Within the Startup folder, create a folder called webpicmd.
7. Unzip the file webpicmdline_ctp.zip (downloaded from section Technalogy used ) into the webpicmd folder.
8. In Visual Studio, add the following four files into the solution. For each of these files, change the Copy to Output Directory value to Copy always.
i. Microsoft.Web.Deployment.dll
ii. Microsoft.Web.PlatformInstaller.dll
iii. Microsoft.Web.PlatformInstaller.UI.dll
![]() |
| Solution will look like this |
9. Open the ServiceDefinition.csdef file in the WindowsAzureWebDeploy project.
10. Add a new InputEndpoint named mgmtsvc with the following values:
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
<InputEndpoint name="mgmtsvc" protocol="tcp" port="8172" localPort="8172" />
</Endpoints>
11. Create three Startup Tasks to call the command files in the MvcWebRole.
<Startup>
<Task commandLine="Startup\EnableWebAdmin.cmd" executionContext="elevated" taskType="simple" />
<Task commandLine="Startup\CreateUser.cmd" executionContext="elevated" taskType="simple" />
<Task commandLine="Startup\InstallWebDeploy.cmd" executionContext="elevated" taskType="background" />
</Startup>
![]() |
| Servicedefination file screenshot |
12. Now, application is ready to publish. Publish application. Now, enable remote Desktop Services to access Windows Azure roles.
13. Now, RDP to VM image on which our application is running as in figure 1.
![]() |
| Connecting to Windows Azure roles |
14. Now, add user <webdeployuser> (mentioned in script CreateUser.cmd) as an application administrator on VM image on which application is running.
(Refer section IIS Manager – Creating Site and Application Administrators for adding user as an administrator)
15. Now, Right-click WebRole and click Publish.
16. Create a profile name (e.g. MvcWebRole).
17. Add your full DNS name as the Service URL (e.g. mywebdeploy.cloudapp.net).
18. Add the Site/application value. This is essentially yourrolename_IN_0_Web (e.g. MvcWebRole_IN_0_Web). Don’t forget the “_Web” at the end.
19. Check the Mark the IIS application on destination checkbox.
20. Remove the check from the Leave extra files on the destination (do not delete) checkbox.
![]() |
| Publish web Screenshot |
21. Check the Allow untrusted certificate checkbox.
22. Add your User name (e.g. <webdeployuser>)
23. Add your Password.
24. Check the Save password checkbox.
25. Click Publish. Now, you will be able to see changes made in application without deploying an application on Azure.
Troubleshooting
· Description: Deployed application was going in loop of aborted (Figure 5) and Busy (Figure 6) mode. Please refer screenshot below:
![]() |
| WebRole in Aborted State |
![]() |
| Web Role in "Busy" State |
Resolution:
1. Change first line of InstallWebDeploy.cmd file as below:
"%~dp0\WebPICmdLine.exe" /accepteula /Products: WDeploy
/xml:https://www.microsoft.com/web/webpi/2.0/RTM/WebProductList.xml /log:webdeploy.txt
Add parameter /accepteula in command
2. Change serviceDefination File as in figure 7. Change startup task type to “background”.
![]() |
| Set “InstallwebDeploy.cmd” as background task |
Links:
http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/49c6c7a3-313b-47bc-bda2-2c94e617bd80
· Description: When application is published on Azure through VS2010, it is throwing an error as described below:
Error 1 Web deployment task failed.(Remote agent (URL http://mywebsvr/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.)
The requested resource does not exist, or the requested URL is incorrect.
Error details:
Remote agent (URL http://mywebsvr/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.
An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected.
The remote server returned an error: (404) Not Found.
The requested resource does not exist, or the requested URL is incorrect.
Error details:
Remote agent (URL http://mywebsvr/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.
An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected.
The remote server returned an error: (404) Not Found.
· Resolution:
i. Enable remote Desktop Services to access Windows Azure roles. Follow steps mentioned in link below:
ii. Set permissions for applications rules for IIS user created by script. Also make sure that under the account, in which the service is running has full control rights on the physical folder you are trying to update. Follow steps mentioned in link below:
![]() |
| On VM image, need to install “IIS Manager Permissions” On VM image, In “IIS Manager Permissions” add user <webdeploy> so that he will have rights to update it directly through web deploy. |








