Website not updated when deployed with a WebJob - azure

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

Related

Web app on azure doesn't show my asp.net core web app after I have published it without any problems

Landing Page of my web app
I have published my asp.net core mvc project in the Azure as web app, however it doesn't show anything. Instead of this it just shows the landing page as there was no code (which is not the case). I have checked few points on stackoverflow, but couldn't find anything, could anyone please help me with that?
There are few reasons causing it, you could refer to the following and troubleshoot it.
Go to your kudu site to check whether all your project file have uploaded to azure.
After publishing webapp to azure, wait for a moment.
Make sure you default page is listed in here and is above hostingstart.html
Deploy Continuous to Azure App Service.
Update:
Delete app and republish it.

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...

Azure Cloud Services - Publish incremental changes only

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

Feature with WebApplication scope - deploy only to one webapplication

After deploying my new Sharepoint solution, containing a feature with WebApplication scope, I noticed that feature was added to ALL webapplications in the farm.
The solution was deployed to a one particluar webapplication, so I wonder if such behavior is correct. Any way to make feature appear only in WebApplication, solution was deployed to?
How did you deploy from powershell or from central admin? If you deployed from central admin you should have been given a list of web apps to deploy too, but if you did powershell and left off the WebApplication flag (http://technet.microsoft.com/en-us/library/ff607534.aspx), it would have deployed to all of the web apps.
This is unfortunately by design.
The solution is deployed to a single web application, e.g.
but the features are visible on all web applications, i.e.:
Feature /= solution. That means that some elements from the solution (not features) will appear only in the designated web application.
One workaround is to hide the feature so that users cannot activate it.
Check out also these posts:
Is it possible to deploy a solution to a web application so that its features are only visible within this web application?
Creating a solution that deploys to selected WebApplications but copies the assembly to GAC
if the solution deployed to ABC webApp so it won't deployed to another WebApp, if it happened better remove from all WebApp and deploy to ABC webApp by PowerShell command.
-
Praveen

Deploy separate web sites azure

I have a single web project that I want deploy in Azure.
I want to create one IIS web site per country and I want to be able to deploy each web site independently (not all of them at a time). How to do this?
Well,
you have two options:
Use Windows Azure WebSites to host your websites
Use Windows Azure Accelerator for WebRoles or your own project similar to that approach.
However you have to note that the second option is a project that is no longer being supported due to avialability of Azure Websites. With Azure Websites, you can have almost everything you get with the Accelerator. You can host your websites on a dedicated instances, and manage them individually. You can update/deploy your website data via FTP/GIT/TFS/WebDeploy, whichever method you are most happy with. The only downside of websites which I see, is the lack of Startup Tasks and the ability to customize your environment (Windows, IIS settings, etc).
When you have set up your Azure account you can go the the web sites section and start the construction of your Azure web spaces, the interface in the preview is very straight forward to use and intuitive.
For deployment using the publish command in from Visual Studio 2012 (which I found the easiest) here are the steps you will need to undertake:
For each of your countries you will need to set up the web site
in azure.
Then for each of those web sites you have created go
to their dashboard page and download the publish profile settings.
It is these settings that you can import into you Visual Studio
solution by selecting the publish command and browsing for the
settings profile file you downloaded and importing it.
Then in future when
you right click on the web site in your solution and select publish
it will publish to your web site in Azure.
I have created a fictional website for Spain below is the link you will need in order to initiate a publish from Visual Studio.
------------ EDIT -------------
For Visual Studio 2010 I met some difficulties trying to publish, in fact the publish profile you can download was not importable to Visual Studio 2010, well at least I could not figure it out.
Instead I created a deployment user by clicking on the 'Reset Deployment Credentials' link on the Azure dashboard (see the link in the image), created the user and then published via FTP from Visual Studio 2010.
What I would like to flag up is the maintenance issue of having one site for each country rather than one site with Localization, (if it is a language issue). A small change multiplied just 20 times for 20 different countries becomes a larger task and if you have lots of little changes it soon becomes a large task to maintain them all.

Resources