I have the following configuration in my Azure web role deployment :
<WebRole name="FrontOffice" vmsize="Small">
<Sites>
<Site name="Web">
<VirtualApplication name="mag_admin" physicalDirectory="../../Sites/BackOffice" />
<Bindings>
<Binding name="EndpointFrontOffice" endpointName="EndpointFrontOffice" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="EndpointFrontOffice" protocol="http" port="80" />
</Endpoints>
Which is, a FrontOffice MVC 3 web application and a BackOffice MVC 3 web application in a virtual directory (VirtualApplication).
I have upgraded to SDK 2.0 a couple of weeks ago, but stayed on StorageClient 1.7, since there are some breaking changes. Everything was OK for a while.
Last monday, all of sudden (and I checked and double-checked source control to be sure nobody changed the configuration), the BackOffice stopped working, because the "msshrtmi.dll" 1.7 file was missing. I think it used to be in the GAC (on my own machine it is) but was effectively missing on the Azure host (only 2.0 was present). I added the DLL in my web application references and it worked.
But now... that same web application complains it cannot connect to SQL Server because the connectionString is wrong. No wonder, it looks into web.config when it should look into the Azure ServiceConfiguration. We have a connectionString provider that checks if RoleEnvironment.IsAvailable returns true, in which case it will take the connectionString from ServiceConfiguration. And for the BackOffice, it now returns false. Everything works fine for the FrontOffice.
Does anyone knows if some changes have been made to Azure last week-end that could explain this sudden behavior?
I finally understand what happened.
When I upgraded to Azure SDK 2.0, it updated only the Azure web role project, not the web applications projects, which were still referencing the SDK 1.7 DLLs.
But no one noticed and it worked for a while. Lukos is probably right : Microsoft made some changes to their VMs, and the GAC now only contains the DLLs for 2.0 (since my deployment is targeting 2.0).
I made the necessary changes to my web applications (switching the DLLs) and now everything is fine.
Related
This question already has an answer here:
asp.net core web api published in IIS after moved to different IIS server pc gives error 500.19 (0x8007000d)
(1 answer)
Closed 2 years ago.
I have developed a Blazor WebAssembly App that will be used on a Server running Windows 2012 on our Intranet. This is targeting .Net 5.0 Core Hosted and Self-Contained. I need to deploy to IIS 8.5 and have some questions.
When I add the website in IIS, do I point to the root deploy directory with the executable and web.config?
Is there anything else I need to do so that IIS will find the index file in the wwwroot sub-directory?
Is is appropriate to put the deploy directory for this app directly under inetpub?
The publish task created a rather large BlaorDebugProxy directory. This is for release so I don't understand why this was created. Is there a way to prevent this from happening?
I want to access the app using ServerName\AppName. If I create the site with 'AppName' for the host name, will that work or is there something else I need to do?
When I try to browse to the site from IIS, I get a 500.19 'The requested page cannot be accessed because the related configuration data for the page is invalid.' I have not made changes to the file as it was created by the publish process. It is:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\AppName.Server.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 60862cf1-bea8-48f4-8ae9-270f2f537927-->
Any ideas why this is not working?
PLEASE NOTE that this is using the SELF-CONTAINED model.
Also, I have made sure that the directory has granted full permissions to the App Pool Identity for this App.
The answer below and the supposed duplicate all refer to installing the framework. However, I thought that the whole point of the self-contained model is that it does not rely on an installed framework.
I have searched extensively and see many references that touch on these issues but nothing that says specifically how to get IIS (especially an older version) to host the self-contained model. The Microsoft pages talk about advantages and disadvantages and how to create the files but no details about how to host them or the other questions I listed above.
Has anyone done this successfully who can provide some guidance?
Thanks !
Firstly, please ensure that the Asp.net Core IIS Hosting Bundle installer has been installed on the server.
https://dotnet.microsoft.com/download/dotnet/5.0
Besides, the identity under where your web application runs in IIS should have full access to the root folder of your website. Try to grant the IUSR account full control to that physical path.
Last, please refer to the below link to hosting Core-based web application in IIS.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1
Feel free to let me know if the problem still exists.
I have searched through dozens of posts (most of them are a few years old). I would like to speed up the first load of our app and have not found the correct configuration combination to do so on Server 2008 R2. I have it working well on Server 2012 R2 - IIS 8.5. But we still have some sites on Server 2008 R2. What I have done for Server 2008 R2 is:
Installed 'Application Initialization 1.0 for IIS 7.5' and rebooted
Edited applicationHost.config under applicationPools to add:
'startMode="AlwaysRunning"'
Edited applicationHost.config under sites to add 'preloadEnabled="true"' to application path
Edited my application's web.config file to add 'applicationInitialization doAppInitAfterRestart="true"' under system.WebServer
This seemingly has no effect. What am I missing? FWIW, I am using ApplicationPoolIdentity and have Anonymous & Forms Authentication Enabled and ASP.NET Impersonation, Basic, & Windows Authentication Disabled. Any hints are greatly appreciated. Thanks.
After point 2 I would do the following:
Go to your Server in IIS, then double-click on ConfigurationEditor, then Choose:
1-system.applicationHost/applicationPools->Click on (Collection)-> Choose your Pool->Check if "autoStart" is "true" and validate that startMode is "AlwaysRunning"(already done on your point 2)->Then Close the window->Click on apply
2-system.applicationHost/sites->Click on (Collection)->Now Click on the site you want and turn serviceAutoStart to "true",if your site is inside "Default Web Site" press (Collection) below->Now choose your site->Turn preloadEnabled to "true" and serviceAutoStartEnabled to "true" as well.-> close all and apply.
To test go to your pool restarted it in IIS and check in your task manager that w3wp.exe is using your CPU.After some seconds w3wp.exe will stop using your CPU.
For those like me looking for an answer years after all documentation seems to have been wiped from the internet, this worked for me.
Download and install Application Initialization Module for IIS 7.5 from one of the following links (requires reboot): Link 1 Link 2 Link 3
Edit C:\Windows\System32\inetsrv\config\applicationHost.config
Find the configuration\system.applicationHost\applicationPools configuration section
Add autoStart="true" to the application pool used by your web app, so this
<add name="MyCoolAppPool" startMode="AlwaysRunning" enable32BitAppOnWin64="true" managedRuntimeVersion="v4.0" />
becomes this:
<add name="MyCoolAppPool" autoStart="true" startMode="AlwaysRunning" enable32BitAppOnWin64="true" managedRuntimeVersion="v4.0" />
Find the configuration\system.applicationHost\sites\site configuration section
Find the application node for your web app
Add preloadEnabled="true" so the node changes from this
<application path="/UrlPathToMyApp" applicationPool="MyCoolAppPool">
<virtualDirectory path="/" physicalPath="C:\Virtual Directories\MyCoolApp" />
</application>
to this
<application path="/UrlPathToMyApp" preloadEnabled="true" applicationPool="MyCoolAppPool">
<virtualDirectory path="/" physicalPath="C:\Virtual Directories\MyCoolApp" />
</application>
Finally, restart IIS.
Rick Strahl explained a hiccup he had to deal with when installing/configuring it: Add AppWarmupModule to <globalModules> like this:
<globalModules>
<add name="AppWarmupModule" image="%SystemRoot%\system32\inetsrv\warmup.dll" />
</globalModules>
When I tried to start my IIS server on my local machine (which is running on Windows 7), it is giving me an error saying:
value does not fall within the expected range
I have tried number of thing to correct this issue, but no success. then finally I re-installed the IIS server on my machine but issue is still persist.
Does anyone have any idea about this error? And how can I resolve it?
I have found that, this issue was coming due to incorrect virtual directory was created by visual studio in IIS due to which default web site was unable to start.
What I'd done to resolve this, I'd deleted my Default Web Site and created again in IIS. After that I'd created my application's specific virtual directories. This resolve my problem. Still not know why default web site stop working after incorrect virtual directory created by Visual Studio.
Hope this helps for those who are facing this issue.
I had this issue in IIS 8.5, the problem ended up being an incomplete entry for the host name in the bindings. I didn't include .com on the FQDN.
I have this issue with setting specific accounts for the site to run as..
It goes away if you set the password in the applicationHost.config directly. Cannot do it though IIS anymore though..
In: C:\Windows\System32\inetsrv\config
May help.
I was experiencing the same problem. And the problem was with the file pointed out by #aaron-gibson.
applicationHost.config at: C:\Windows\System32\inetsrv\config
(see here: IIS Configuration Reference)
One of the site had incorrect data:
<application path="/e:\MyFolder\MySiteWithProblem\VDir" applicationPool="AppPool152">
<virtualDirectory path="/" physicalPath="e:\MyFolder\MySiteWithProblem\VDir\Vdir" />
The application path in this case had invalid characters. And also, the physicalPath didn't exist.
Fixing this entry fixed the problem.
The answer marked as the solution fixed the problem because it recreated this file from scratch. But in my case I did not lose all my sites.
I changed the file
applicationHost.config
at: C:\Windows\System32\inetsrv\config
And the entries for each site are in the tags:
<configuration>
<system.applicationHost>
<sites>
...
<site name="Default Web Site" id="1" serverAutoStart="true">
<application path="/MyPath" applicationPool="AppPool152">
<virtualDirectory path="/" physicalPath="e:\MyFolder\MySite\Vdir" />
</application>
...
<site>
...
</sites>
</system.applicationHost>
</configuration>
I had this issue with a new IIS 10 deployment. Our network team copied over the applicationhost.config file from the older servers and this caused it. In IIS 10 there are two new settings that encrypt the password for the app pool identity. Since the IIS 7 config file didn't have those encryption settings then IIS threw this error when assigning a new user. I simply copied over the settings from a brand new server build and it started working fine. Add these two settings to the existing ones already there:
<configProtectedData>
<providers>
<add name="IISCngProvider" type="Microsoft.ApplicationHost.CngProtectedConfigurationProvider" description="Uses Win32 Crypto CNG to encrypt and decrypt" keyContainerName="iisCngConfigurationKey" useMachineContainer="true" />
<add name="IISWASOnlyCngProvider" type="Microsoft.ApplicationHost.CngProtectedConfigurationProvider" description="(WAS Only) Uses Win32 Crypto CNG to encrypt and decrypt" keyContainerName="iisCngWasKey" useMachineContainer="true" />
</providers>
</configProtectedData>
Mine turned out to be an issue with the binding. I deleted than used another name in the binding and it worked great.
Good luck!
I've had this issue and the problem was that the binding was wrong, there was a "space" after the url.
Check your bindings for any wrong characters and if there's anything else wrong with it.
I've had this issue with Octopus Deploy.
It turned out the issue was with the binding where it had an extra space at the end of the hostname when setting up the project in Octopus.
You can also see this from the applicationhost.config in C:\Windows\System32\inetsrv\Config
This message can be caused by a malformed application name in the applicationHost.config file in C:\Windows\System32\inetsrv\config.
For example, I had a "\" in an application name which, once removed, eliminated the error.
This problem can be caused by setting the "Host name" to a number. The "Host name" needs to contain at least 1 letter.
I've had this error message before when I was using an automated build and deployment system (TeamCity with Octopus deploy). It turned out that the port number I'd specified for IIS in the Octopus Deploy variables was too high.
From what I could find on this web site the highest port number IIS will accept is 65535.
I have an MVC app hosted on an Azure Website.
I have custom errors enabled and working (when not publishing):
<customErrors mode="On" defaultRedirect="~/Error/NotFound" xdt:Transform="Replace">
<error redirect="~/Error/NotFound" statusCode="404" />
<error redirect="~/Error/NotFound" statusCode="403" />
</customErrors>
When I publish the website from Visual Studio, if I try to visit the site while the dlls are being updated, I get a nasty IIS error.
I'm surprised that Azure doesn't wait to "tie down" the new version until the publication is complete, to avoid this scenario. Is there a way to achieve this "instantaneous switch" behavior?
And/Or - How can I prevent this error from being displayed?
I can't say this would be unusual. Depending on size of the deployment it may take a while for IIS to restart and reload leading to 503 Service Unavailable or similar errors in the meantime. CustomErrors won't help you here as the ASP.Net pipeline isn't even being reached at this point. What Azure Website level are you running on (Free, Shared or Standard?) If you can up the size of the instance to try and get things moving again more quickly.
I think you deployment is too slow. IIS detects changes in dll files and restart the app-pool automatically without waiting for the other dll files.
Try to set custom values in waitChangeNotification and maxWaitChangeNotification in web.config. Doing so you can ask IIS to wait for some seconds before restarting app-pool. I'm not sure if it works on Azure. On my on-premises IIS I use custom values that allow me to do a long deploy (about 5 seconds).
Documentation: http://msdn.microsoft.com/en-us/library/e1f13641(v=vs.85).aspx
Been interested in Unity3d for certain projects for some time now, and decided to bite the bullet! I started toying around, and fancied the idea of running Unity3d in windows azure.
However, despite my efforts, I was unable to get this running!
Here is what I have tried so far:
Including the Deployment Output from unity directly with my deployment to azure. While it is probably to keep the unity3d file in blob storage in azure, this was just for testing purposes.
I have included the mime type to allow iis to use the unity file (via the web.config):
Code:
<staticContent>
<mimeMap fileExtension=".unity3d" mimeType="application/vnd.unity"/>
</staticContent>
Lastly, I have included the UnityWebPlayer.exe file, and added a Startup task to install the UnityWebPlayer on the server. Also here another best practice would be to download the file instead, as it would be the latest version, but again, only for testing at the moment . My service definition of the start up is below:
Code:
<Startup>
<Task commandLine="UnityWebPlayer.exe /S" executionContext="elevated" taskType="simple" />
</Startup>
I am curious to reach out to the community to see if anyone else has had any success getting their games to the cloud with windows azure?
EDIT:
I should add then when trying to deploy such a web role, the role is stuck cycling and never deploys. Thanks!
I figured it out!
A shout out to smarx for pointing out that you DO NOT need to install the UnityWebPlayer on the server.
As to get the unity file to load correctly, you do have to add the mime type to IIS, it is as above, except without the "."!
Silly me.
Enjoy!