Azure publish issues - Busy - Restarting - Busy - Cycling - asp.net-mvc-3

Azure is giving me a headache.
I started off with a tutorial. Created a new MVC 3 project published it. Took about 9 mins then it was working fine on my production VM.
Then I tried to publish a project I've been working on (MVC 3). It has the following dependencies:
Service.dll
Domain.dll
Autofac.dll
It works fine when I debug using the emulator.
It works fine when I unzip the package and deploy it to another server.
But when I publish to Azure Production I get the following:
1:42:31 PM - Preparing deployment for Website with Subscription ID: ...
1:42:31 PM - Connecting...
1:42:35 PM - Verifying storage account '...'...
1:42:38 PM - Uploading Package...
1:44:46 PM - Creating...
1:45:56 PM - Created Deployment ID: ....
1:45:56 PM - Starting...
1:46:34 PM - Initializing...
1:46:34 PM - Instance 0 of role Website is in an unknown state
1:46:34 PM - Instance 1 of role Website is in an unknown state
1:47:06 PM - Instance 0 of role Website is creating the virtual machine
1:47:06 PM - Instance 1 of role Website is creating the virtual machine
1:47:37 PM - Instance 0 of role Website is starting the virtual machine
1:47:37 PM - Instance 1 of role Website is starting the virtual machine
1:50:13 PM - Instance 0 of role Website is in an unknown state
1:50:13 PM - Instance 1 of role Website is in an unknown state
1:50:44 PM - Instance 0 of role Website is busy
1:50:44 PM - Instance 1 of role Website is busy
1:54:31 PM - Instance 1 of role Website is restarting
1:55:02 PM - Instance 1 of role Website is busy
1:56:40 PM - Instance 1 of role Website is cycling
1:57:43 PM - Instance 0 of role Website is cycling
I've tried number of times. With no success.
Update
I forgot to mention that I have the facebook C# sdk DLLs
I've used trial and error to find that the Facebook.Web.Mvc dll is causing me issues.
It has been included inside the bin folder but still no good.

The Azure environment doesn't have all the MVC 3 assemblies. You need to make sure you reference them all in your project and set CopyLocal = true so that the assemblies get included in your Azure package. Azure will go through this infinite cycle if it can't find all the dependencies for your project.
The assemblies you need to reference are:
Microsoft.Web.Infrastructure
System.Web.Helpers
System.Web.MVC
System.Web.Razor
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
One blog I saw also mentioned needing WebMatrix.Data, but I found I did not need this one in my project.
If you have any other assemblies you are referencing that are not part of the .NET Framework, you will also need set CopyLocal = true on those as well.
Also, make sure your Azure storage setting is NOT set to "Use development storage" when you deploy to Azure -- this will cause the same problem.
If the above doesn't solve the problem, check this site for some other possible causes.

As Brian Rogers notes the requirement for asp.net MVC assemblies and points to a good resource for reasons of role being cycling. One Additional thing can help with MVC specifically. You can right click on your Web Application Proejct and select "Add Deployable Dependcies" then select ASP.NET MVC3. This will make sure all MVC3 required assemblies are with your project when depeployed.

Set the reference attribute "copy local" to "true" for each of the references used in the project. This worked for me.

I ran into a similar issue after updating my project to use Azure .NET SDK version 2.0.
The update procedure changed the configuration files but did not update the versions referenced by the projects. I solved this by manually removing the references to the old 1.8.* versions of the DLLs and then adding references to the 2.0. versions.

Please verify any third party dlls which were build for only 32 bit or 64 bit in your solution..these kind of dlls caused to the role cycling and busy..

Related

The operation could not be completed. Error loading type library/dll .Net

I have a xaml C# project which is a windows .exe application. I want to create a setup file for the same so that I can install it on other machine. I have followed this link to create MSI setup. Creating installer setup
From the above link when I am on Step 4 under (Procedure to create Setup file:) it throws error "The operation could not be completed. Error loading type library/dll". Infact if I try to add or delete any thing from section File System on Target machine, it throws same error. I am using VS 2015
if anybody faced same error Please help.
Deployment Tools: Quick review of MSI tools (free and commercial) - see if there is one to better match your needs and requirements.
Deployment: To solve the application problem, please find some links below. IT might be something as simple as an error in your configuration file or a lacking runtime.
Tools for dependency scan / deployment debugging (find what files should be deployed)
Application launch debugging
Further Links:
Deployment link collection

AADSTS50059 error in Visual Studio

For some time, I get an error when I try to log into my Microsoft account from Visual Studio for my Azure subscription.
My Microsoft account is associated to : Outlook.com (obviously), Office 365, Azure and a Windows Developer.
I ignored this message until now, because I could connect to my database, my websites functioning, etc.
But now I need to publish an application in the Windows Store. When I try to generate my Windows app packages, I found the same error:
We could not refresh the credentials for the account
AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials.
Trace ID: eaf34263-377e-41d3-8f72-177827315914
Correlation ID: 15bbcfe8-8bc9-4a83-aa02-288a54e50dd5
Timestamp: 2016-09-19 11:27:20Z
I have already try to clean up cookies, temporary files, another Windows developer account, ...
UPDATES
I have try to download Azure AD Application Proxy Connector.
I had this same problem again on Visual Studio 2017 (15.1).
Solution found:
You have to go to REGEDIT.
Navigate to "Computer\HKEY_CURRENT_USER\Software\Microsoft\VSCommon\ConnectedUser"
And empty all the values, except EnableAzureRMIdentity (change to true if isn't) :
To :
It seems that you’re trying to sign in through a Microsoft account and not a domain that is part of the organization ID of the directory you are trying to access.
So please make sure that the admin is part of the same domain name as the tenant domain.
For example, if your Azure AD domain is contoso.com, the admin should be admin#contoso.com.
You could refer to Troubleshoot Application Proxy.
Moreover, this thread might be helpful to you. Please also try the answer provided by Rich.
I followed some of the advice for this error, including modifying my registry key, however the error changed. And it seems that the #Andrés Talavera is also using a sovereign cloud like I am.
I deleted my Environment Picker JSON file and that is when I got this error when I restart Visual Studio.
After deleting the JSON file, located here: %localappdata%\.IdentityService\AadConfigurations\AadProvider.Configuration.json, I restarted VS17 and I got this error. The JSON file seemed to reappear after the restart. The next time, after I deleted the Registry Key, and removed the JSON file again, SSO worked great.
Note: It seems to be associated to the Environment Picker and pointing to the Sovereign cloud AAD.

Web Deploy - How to create a package with selected items

I would like to try the 'Web Deploy' method to deploy our website. Before my questions, I would like to provide a few details about the current deployment procedure:
It is an enterprise site & is hosted on multiple servers (with continuous deployment).
The files are not in 'Release' mode, but in 'Debug' mode.
We manually copy paste only the current assignment related files. Say, this week, the Accounts module is to be deployed, then the files to be deployed are
/mysite/App_Code/Models/accounts.cs
/mysite/pages/accounts.aspx, accounts.aspx.cs
The 3 files will be copied to the respective folders in all the servers manually. This has been the procedure for years here.
The project 'mysite' is an 'ASP.NET Website' and not 'ASP.NET Web Application' (in VS2013), which means these options are unavailable - Package/Publish Web & Package/Publish SQL
I have created the packages in the dev system,
(i) using the publish option(web deployment package) in Visual Studio and also
(ii) export application in IIS (gives the option to select the files)
Is it possible to create a package only for the files I need (in this case accounts.cs, accounts.aspx, accounts.aspx.cs), using VS publish feature.
Is it possible to include custom SQL scripts file in the package. (using IIS or VS)
If the answer is a Yes for Q2, then it should be executed only once, not for all servers. Because there is only one DB server. How can it be done.
I did not go for the Installing package part yet.
1 - Not through VS because there is no extension point (that I know of) into MSBuild for Websites. Sayed has a great post which describes how Websites are treated differently than Apps.
Alternative - You could copy the files you wish to deploy to a new folder and then use the MSDeploy.exe commandline tool to create a customer MSDeploy package which you can deploy to your server.
D:\temp>"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:contentPath=%cd%\DefaultWebSite\website1 -dest:package=DefaultWebSite.zip
Info: Updating MSDeploy.contentPath (MSDeploy.contentPath).
Info: Adding virtual path (D:\temp\DefaultWebSite\website1)
Info: Adding directory (D:\temp\DefaultWebSite\website1).
Total changes: 3 (2 added, 0 deleted, 1 updated, 0 parameters changed, 0 bytes c
opied)
D:\temp>"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package=DefaultWebSite.zip -dest:contentPath="Default Web Site\website2"
Info: Adding MSDeploy.contentPath (MSDeploy.contentPath).
Info: Adding virtual path (Default Web Site\website2)
Info: Adding directory (Default Web Site\website2).
Info: Adding file (Default Web Site\website2\Default.aspx).
Info: Adding file (Default Web Site\website2\Default.aspx.cs).
Info: Adding file (Default Web Site\website2\Web.config).
Total changes: 6 (6 added, 0 deleted, 0 updated, 0 parameters changed, 971 bytes
copied)
2/3 - Yes you could include SQL into the web deployment package but it would be deploy each time the package is deployed. We have found its better to seperate our SQL deployments into its own package so we can deploy it only when we want to.
This post describes how we handle our SQL deployments - https://dotnetcatch.com/2016/02/10/deploying-a-database-project-with-msdeploy/

Visual Studio Team Services Azure Deployment task fails to deploy web app

We recently stood up a new Azure account and are in the process of developing a new application to be deployed to it as a web app. While we are able to deploy to our staging slot from Visual Studio 2015, when attempting to deploy an automated build from Visual Studio Team Services (hosted by Microsoft) we are getting the following error:
Get-AzureWebSite -Name $APPLICATION -ErrorAction SilentlyContinue -ErrorVariable azureWebSiteError -Slot staging
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.WindowsAzure.Commands.Websites.GetAzureWebsiteCommand.Do(Action call) in d:\workspace\powershell-publish\src\ServiceManagement\Services\Commands\Websites\GetAzureWebSite.cs:line 138
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzureSMCmdlet.ProcessRecord() in d:\workspace\powershell-publish\src\ServiceManagement\Common\Commands.ServiceManagement.Common\AzureSMCmdlet.cs:line 174
New-AzureWebSite -Name $APPLICATION -Location North Central US -Slot staging
Conflict: Website with given name $APPLICATION already exists.
Publish-AzureWebsiteProject -Name "$APPLICATION" -Package "C:\a\1\a\$APPLICATION.zip" -Slot "staging" -ErrorVariable publishAzureWebsiteError
The website $APPLICATION was not found. Please specify a valid website name.
Cannot get website, deployment status is not updated
This is a fairly significant issue since it is preventing us from using continuous deployment at this time. Are there any work around or configuration settings that we should look at to fix this?
There is a known issue that causes publishing from VSTS to fail if the Web App has VS 2015 Debugging enabled. Can you check whether it is the case for you, and try again after turning off debugging in the Azure portal?
That issue will be fixed soon, so treat this as a temporary workaround.
This was eventually traced back to two problems.
The first problem was that we needed to load up a different management certificate since the one we were using was defaulting to a different account. This goes back to the issue of having one account associated with more than one subscription. At the time of this writing, there doesn't appear to be a way of specifying which subscription to download.
The second problem appears to have been associated with the known bug mentioned by David Ebbo in their answer.
A couple things you can try:
Since you mentioned you have 2 subscriptions, make sure that script you have above is running against the correct subscription, if it's not, it would give the exact error you're seeing. Put a:
Get-AzureSubscription -Current
command at the top of your script and see if that's what you'd expect.
VSTS has a build task for deploying to a web app, can you deploy the package using that task?

Can't install Websphere mq client error 1603

I'm trying to install a IBM WebSphere MQ Client v8.0.0.3 on a Windows 7 SP 1 Enterprise machine, however I fail.
The installation starts, I select the language, splash comes on and after a bit the splash goes away and I'm left with a "Installation Wizard was interrupted", even though I click nothing.
I run it as administrator, and am a member of the local administrators group.
The installation log: https://gist.github.com/anonymous/a1ff7efe58fe7c006297
Edit:
A colleague with the appropriate mqm rights tried to install it, but failed also.
Everyone else here uses Windows server 2008 SP1 enterprise and have no problem with the installation.
Edit2:
It seems that the error is coming because of our directory structure:
Error 1327.Invalid Drive: H:\
We have our local settings, including appsettings on a server, instead of on the local machine, and the installer doesn't like it. JDK gives the same error.
There are many ways for a Windows MQ install to fail. In a Windows environment one of the frequent reasons is that even though the ID performing the install is an administrator, it doesn't have the correct domain rights. These include, for example, to query the SAM on the Domain Controller.
Please see Configure IBM MQ accounts for instructions on how to configure the service account under which MQ will run. Obviously, the account performing the install must have a superset of the same rights. Since the question fails to mention this critical pre-req step, I'm assuming it hasn't been performed.
It is possible that prior installations or a failed install will leave artifacts on the server which interfere with subsequent installations. This is especially true when installing V8.0. Since there is at least one failed install in this case, I would recommend using the IBM provided cleanup tool as described in Spring Cleaning a Windows MQ Installation. This will remove old registry entries and directories that alter the behavior of the installer.
Branching out a bit further, the 1603 error from MSIEXEC is pretty generic. According to the good folks at MSIGEEK, the following are some common causes for that error:
Short file name creation is disabled on the target machine.
An Install Script custom action is prototyped incorrectly.
A file is locked and cannot be overwritten.
The Microsoft Windows Installer Service is not installed correctly.
The Windows Temp folders are full.
The full article on debugging 1603 errors is here.
In this specific case, it appears one or more WMQ product prerequisites is not installed:
MSI (c) (5C:B4) [15:31:48:820]: Doing action: iwiListProductPrereqs
Action 15:31:48: iwiListProductPrereqs. Listing the product prerequisites
Action start 15:31:48: iwiListProductPrereqs.
MSI (c) (5C:84) [15:31:48:826]: Invoking remote custom action. DLL: C:\Users\ga2svit\AppData\Local\Temp\MSI7642.tmp, Entrypoint: iwiListProductPrereqs
1: 15:31:48 MQCA (CaProlog)(CaProlog) info: amqiwicn.dll Built on Jun 15 2015 at 23:18:37; version 8.0.0.3, build p800-003-150615.2
1: 15:31:48 MQCA (CaProlog)(CaProlog) info: Property 'ProductName' value 'IBM WebSphere MQ' from property table
1: 15:31:48 MQCA (CaProlog)(CaProlog) info: Property 'AMQEXTCA60000' not defined in property table
1: 15:31:48 MQCA (CaProlog)(WhatMode) info: User name is 'ga2svit'
1: 15:31:48 MQCA (CaProlog)(WhatMode) info: MSIRUNMODE_ROLLBACKENABLED
1: 15:31:48 MQCA iwiListProductPrereqs(iwiListProductPrereqs) info: Property 'VersionNT' value '601' from property table
CustomAction iwiListProductPrereqs returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 15:31:48: iwiListProductPrereqs. Return value 3.
Everything T-Rob has said is valid and correct, however for this specific case, this feels like one you need to take up with IBM as a defect.
I've been looking through the source of the place you are failing and there is no valid codepath I can see from the last line you have traced before a subsequent line which would say something like "MMC prereq satisfied" (or not satisfied, or querying a property, but it would say something). This implies to me we have hit an unhandled exception in the code and hence aborted straight out. You could try a silent install to see if that helps, but I wouldnt hold out much hope.
So for me the thing it seems to be trying to do is to look in the system directory for mmc.exe - Does that exist on your system and if so look at its properties and what is the version of that file (right mouse in explorer, properties and find the one listing the file properties)
We saw this problem with the V8 MQ installer. I had Offline Files disabled on my Windows 7 box, and a coworker did not. He disabled Offline Files, rebooted, and the installer succeeded.
I have also encountered this error and upon further investigation I realized that (using the MQParms_silent.ini file) I had forgotten to un-comment the AGREETOLICENSE="yes" from the provided default.
Hope that helps.

Resources