Azure Cloud Services - Publish incremental changes only - azure

I have a C# ASP.Net MVC4 Web Role deployed on Windows Azure Cloud Services using Package and Publish. First time it uploaded entire package and site has been running fine. When I wanted to publish the next set of changes, the Publish option is trying to upload the entire package again.
I have already configured Remote Desktop and Web Deploy and also enabled incremental updates as per guidelines stated in the article Publishing a Cloud Service using the Windows Azure Tools.
But this seems to be not working and Publish is trying to upload entire package again and again. Has anybody faced this issue and come up with any fix?

Nope.
currently there is no out-of-the-box solution to support incremental changes deploy.
When working with Cloud Services I highly suggest that you do not use Web Deploy for anything else than development/testing. The reason is that all changes made via web-deploy and any other non-full-package-upload process will be wiped out as soon as an instance in being recycled/healed.
I've been working on a project to allow rolling out partial changes. Unfortunately it only supports update to the "bin" folder currently. You can take a look at this project here. It is a good starting point at least.

For quick publish incremental changes to development environment (Not recommended for Production), check - Speed Up Azure Deployments with the New Web Deployment Feature.

In VS2013, choose 'Deploy' from the context menu of the Web App project which is referenced by the role (and not the 'Cloud Service' project referencing the role(s) ... doing that will publish the whole service and all of its roles non-incrementally).
There should be a 'publish profile' which refers to the website on the *.cloudapp.net platform. If there is, it was put there by Visual Studio ... probably when you first ticked the 'Enable Web Deploy for all web roles' check-box when first deploying the service.
However, it might not be there, or be wrong. Because, for example, Visual Studio is dumb, and noticing that you had already published the Web App as a 'Web Site' (before you decided to incorporate it as a 'Web Role' in a service), it decided to leave the existing entry for *.azurewebsites.net alone. Or is it because that project was only included in the role as an <VirtualApplication /> element in the service definition's XML, and Visual Studio just neglected to create it?
So you'll have to find some way to force Visual Studio to re-create the right profile for you, or you'll have to manually copy and edit the publishing profile XML files from a known good source (Properties/PublishProfiles directory under the project root), or just guess the settings from absent documentation.
Those settings will be something like:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<MSDeployServiceURL>https://MYAPP.cloudapp.net:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>INSTANCE</DeployIisAppPath>
<RemoteSitePhysicalPath />
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<DeployAsIisApp>False</DeployAsIisApp>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<UserName>MYUSER</UserName>
</PropertyGroup>
</Project>
Where:
MYAPP - is the domain name of the deployed Azure service
INSTANCE - is the name of the instance you want to update (get it from Server Explorer ... it's the 'Name' property of the 'Instance' under your service ... or get it from the list of instances comprising your service from the Windows Azure management dashboard).
MYUSER - is the name of the user you set up when publishing initially, for the Remote Desktop Services

Related

Mobile App backend does not show in existing Web Apps

I'm following the procedure to create a Xamarin app with a mobile app backend in Azure.
https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-dotnet-backend-xamarin-android-get-started-preview/
I've create the mobile app in the portal and downloaded the backend runtime and xamarin solutions. When I try to publish the backend runtime, the instructions indicate that the one I just created should show up 'Existing Web Apps'. Mine shows nothing.
My questions are:
1) How can I troubleshoot what shows up in the 'Existing Web Apps'?
2) Is it reasonable to just create a new web app from the VS Publish dialog?
3) If not, where should I place the publish profile that I can download from the azure portal?
Regards,
Rajesh
1.a. Ensure you're using the right azure suscription from VS
1.b. Logout and add your subscription login again
Yes it's reasonable
You can put it wherever you want. From VS website project goto publish settings
4. Then select import
5.And Finally browse the publish settings file
I have had issues with Visual Studio finding the existing apps. I tend to download the publish settings and use that instead. This works fine.
Alternatively, create a git repository and check the code into the git repository. Check out this article for instructions: https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
Personally, I post my code to a branch of my git repository on GitHub and link the continuous deployment option of the Azure App Service to that. You can find my blog about this topic here: http://shellmonger.com/2015/08/29/continuous-deployment-nodejs-and-microsoft-azure/ - it's for NodeJS but the concept and methodology is the same.

Website not updated when deployed with a WebJob

I have a solution that has an ASP.NET MVC Web Application with source control in Visual Studio TFS online. The site is hosted in Azure, which deploys the site every time it is built in TFS online. Everything is working good.
I then added a Web Job project to the solution using Add > New Azure WebJob project and I set it up with some help from this post on the azure blog. Since then, I noticed that any changes made to the web application does not reflect on the deployed site anymore. I don't see any errors in the build log in TFS online.
To work around the issue, I have to 1) remove the web job project from the solution and 2) comment out everything in the webjobs-list.json file in the web application's Project Properties before deployment. This essentially puts the solution back in the state before the web job was added.
I was wondering what I could do to prevent my problem from occurring. I think I maybe missing some configuration step, but I don't know where to look.
Azure's automatic source integration will only deploy the first project (alphabetically) in the solution. So if your new web job is named ahead of your old MVC application (alphabetically) it will try to deploy the web job instead of the MVC application.
There are two solutions to this:
1) Name your MVC project so it is first project in the solution alphabetically
2) Put your web job in a separate solution

How to import website created through Azure Portal into TFS project?

I created a website in the Azure portal, but now I can't find out how to import this into a TFS project. I have visual studio 2013. They seem completely disconnected in terms of importing a project from what the Azure portal creates. Thanks!
Jerelo - the way you solve your issue depends what type of website you deployed and how it was deployed originally. Many of the pre-baked Website images for items like Drupal or Wordpess are not designed to be imported into TFS and auto-deployed.
You would need to download your files via FTP (http://blogs.msdn.com/b/kaushal/archive/2014/08/02/microsoft-azure-web-site-connect-to-your-site-via-ftp-and-upload-download-files.aspx) and then setup source-control deployments by selecting the "Set up deployment from source control" option in the Portal.
Visual Studio Online is the only TFS source you'll be able to use right now, otherwise you have Dropbox, Git or Mercurial deployments Detailed options are listed here: https://github.com/Azure/azure-content/blob/master/articles/web-sites-deploy.md

How to get .publishsettings for Web Deployable Web Role?

I enabled the Web Deploy feature for my Web Role and deployed it.
But how can I get hold of the .publishsettings file so I can create a Publishing Profile for it?
This 2 year old article states that it should have been created automatically, but I haven't got that in my profile manager.
Any ideas?
If you are using Visual Studio 2012 or greater, the server explorer to the left will have several Azure items.
Specifically the Windows Azure Compute is what we are looking for, right click on that and say 'add deployment environment'. You will then be prompted with a dialog that allows you to sign in and download publish settings file:
You can get publishsettings file from the following link: https://windows.azure.com/download/publishprofile.aspx
Well, the problem was really behind the keyboard.
So the publishing profile is actually provisioned correctly and automatically to the Web project as the documentation states.
The problem and confusion was that I have a secondary web application in my Solution that I also publish to the same Web Role (referenced as an additional Site in the ServiceDefinition.csdef file).
That Web Project does not get the Publishing Profile, and when I try to create a profile manually, it doesn't work since that (secondary) IIs instance is not configured for Web Deployment.
Oh well, back to the tedious Cloud Service deployment it is...

How to perform web.config transformations/publish for a "passive" web project in Azure?

In my Azure Web Role, I have added an additional web site, much the same as described here.
The problem is that second web site is referenced by the Site attribute physicalDirectory in the ServiceDefinition.csdef:
<Site name="SecondWeb" physicalDirectory="..\..\..\mySecondWebSite">
If I point this attribute to the project location, it will simply package up the whole project folder and publish to the Web Role.
What I want is that the compiled/published profile with my web.config transformations is packaged up, much the same as the "default" web project for the Web Role is done.
Is there a way to compile/publish (to a local folder) in the (pre)-Publish event of the Azure Cloud project?

Resources