I have a cloud service which was running fine for a while after upgrading to Azure 2.0 SDK. It has now mysteriously stopped working. I am getting this in the Azure machines event log.
The application '/' belonging to site '19369254' has an invalid
AppPoolId 'ddcc23fe-8eee-4412-a4dd-56b50e18d9f2' set.
Therefore, the application will be ignored.
Followed by :
Site 19369254 was disabled because the root application defined for the site is
invalid. See the previous event log message for information about why the
root application is invalid.
and :
A process serving application pool 'ddcc23fe-8eee-4412-a4dd-56b50e18d9f2'
terminated unexpectedly. The process id was '3696'.
The process exit code was '0x103'.
My service definition:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="SMEEDI.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
<WebRole name="SMEEDI.Portal" enableNativeCodeExecution="true">
<Startup>
<Task commandLine="startup.cmd" executionContext="elevated" taskType="simple"></Task>
</Startup>
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" />
<Setting name="DataConnectionString" />
<Setting name="BaseUrl" />
<Setting name="DatabaseConnectionString" />
<Setting name="Environment" />
</ConfigurationSettings>
<Sites>
<Site name="Smeedi_WebRole" physicalDirectory="..\..\..\SMEEDI.Portal">
<Bindings>
<Binding name="HttpIn" endpointName="HttpIn" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WebRole>
</ServiceDefinition>
How could this suddenly stop working?
What is wrong with the service definition?
The error you are receiving should have nothing to do with the CSDEF file. It appears to be an issue with the configuration of IIS on the Azure instance.
You can try to reimage the instance from the Azure portal or log into the instance to do further troubleshooting. If you choose to remote in, I would examine the IIS configuration, specifically the Application Pools and virtual directories, especially the path since you are changing it in the CSDEF.
Azure should take care of that configuration on its own, which is why reimage or delete and redeploy may be a better first step.
Related
First of all, I need to use an asmx web service in an EventReceiver project in Visual Studio.
Then, as common, I add a web reference by right click on the project and then Add menu then Service Reference... menu and finally web service url something like
and this my app.config project:
`
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="IntegrationService_UserSoap">
<security mode="Transport" />
</binding>
<binding name="IntegrationService_UserSoap1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://???.???.??/services/???????/???.asmx"
binding="basicHttpBinding" bindingConfiguration="IntegrationService_UserSoap"
contract="ServiceReference1.IntegrationService_UserSoap" name="IntegrationService_UserSoap" />
</client>
</system.serviceModel>
</configuration>`
Then I'm going to modify web.config of the web application as I used to do like this:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="IntegrationService_UserSoap">
<security mode="Transport" />
</binding>
<binding name="IntegrationService_UserSoap1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://???.???.??/services/???????/???.asmx"
binding="basicHttpBinding" bindingConfiguration="IntegrationService_UserSoap"
contract="ServiceReference1.IntegrationService_UserSoap" name="IntegrationService_UserSoap" />
</client>
</system.serviceModel>
now, when I'm going to deploy the project by visual studio I've got this error:
"Error occurred in deployment step 'Activate Features': Operation is not valid due to the current state of the object."
What is wrong?
I have an asp.net application hosted on a VM with IIS. Now I would like host the same application in Azure App Services. We had IIS settings modified like Connection Time-out.
How do set Connection Time-out value for Azure App Services
If you want to edit the connectionTimeout setting under system.applicationHost, you could modify the applicationhost.config file. You could create it manually or use IISManager to create the file and modify it.
Here is the sample:
<system.applicationHost>
<sites>
<siteDefaults>
<logFile logFormat="W3C"
directory="%SystemDrive%\inetpub\logs\LogFiles"
enabled="true" />
<traceFailedRequestsLogging enabled="true"
directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles"
maxLogFiles="20" />
<limits connectionTimeout="00:01:00" />
<ftpServer serverAutoStart="true" />
<bindings>
<binding protocol="http" bindingInformation="127.0.0.1:8080:" />
</bindings>
</siteDefaults>
</sites>
</system.applicationHost>
I have a web app running in a Virtual Machine hosted in an Azure Cloud Service. I use Windows. I'm trying to secure the application by installing a SSL certificate.
Here it says that to do so:
"In your development environment, open the service definition file
(CSDEF)"
Development environment? what's that? Eclipse? (I don't use Visual Studio)
This is how this file typically looks like:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="CloudService1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="WCFServiceWebRole2">
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
<InputEndpoint name="Https" protocol="https" port="443" certificate="SSL" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<Certificates>
<Certificate name="SSL" storeLocation="LocalMachine" storeName="My" />
<Certificate name="MSSecAuth" storeLocation="LocalMachine" storeName="CA" />
<Certificate name="MSInternetAuth" storeLocation="LocalMachine" storeName="CA" />
</Certificates>
<LocalResources>
<LocalStorage name="Logs" cleanOnRoleRecycle="false" sizeInMB="100"/>
</LocalResources>
</WebRole>
</ServiceDefinition>
The question is: Where is the service definition file (CSDEF) located?
If you're running in a Virtual Machine the cloud service definition doesn't apply to you. This is used for deployments to Web or Worker Roles and is normally created when you add an 'Azure Cloud Service' project to a Visual Studio solution.
If you want to protect your VM-based service using SSL you would do this as you would on-premise and ensure that you open port 443 as an endpoint to the VM (http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-set-up-endpoints/).
So, I have Azure project with 3 WebRoles and 1 WorkerRole. In each project I have subscription on RoleEnvironment.Changing and RoleEnvironment.Changed events. In WebRole everything is fine, but in WorkerRole these events don't want to trigger.
Мoreover when I change setting of some WebRole, WorkerRole is also recycling everytime
WorkerRole run another x86 proccess inside and script on startup
Azure SDK 1.7 is used
<WorkerRole name="MyService" vmsize="Medium" enableNativeCodeExecution="true">
<Startup>
<Task commandLine="startup.cmd" taskType="simple" executionContext="elevated" />
</Startup>
<Runtime executionContext="elevated" />
<Imports>
<Import moduleName="Diagnostics" />
<Import moduleName="RemoteAccess" />
</Imports>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="8081" />
<InputEndpoint name="TCPEndpoint" protocol="tcp" port="10101" localPort="10100" />
<InternalEndpoint name="InternalEndpoint" protocol="http" />
</Endpoints>
<ConfigurationSettings>
<Setting name="StorageConnectionString" />
<Setting name="TransactionLogsBlobContainer" />
</ConfigurationSettings>
<LocalResources>
<LocalStorage name="DiagnosticStore" cleanOnRoleRecycle="false" sizeInMB="8192" />
</LocalResources>
</WorkerRole>
Does anybody have any idea what could be going on?
Thanks
I've had a similar issue and found that changing the taskType of the Startup Task from elevated to background solved my problem. I'd recommend starting there.
<Startup>
<Task commandLine="startup.cmd" executionContext="elevated" taskType="background"></Task>
</Startup>
For worker roles, you must define an internal endpoint (even if you don't actually use it), in order to get certain events.
IE, add this to your CSDef:
More details here: http://blogs.msdn.com/b/windowsazure/archive/2011/01/04/responding-to-role-topology-changes.aspx
I have upgraded to azure 1.7 and now my build process is broken. I have a script that runs after the build which simply fires cspack as follows.
cspack "C:\Users\MyAppBuild\.hudson\jobs\MyApp Portal Build\workspace\trunk\Portal\SMEEDI.Cloud\ServiceDefinition.csdef"
/role:MyApp.Portal;"C:\Users\MyAppBuild\.hudson\jobs\MyApp Portal Build\workspace\trunk\Portal\Portal\MyApp.Portal\bin"
/sites:"C:\Users\MyAppBuild\.hudson\jobs\MyApp Portal Build\workspace\trunk\Portal\Portal\MyApp.Portal\bin";"MyApp.Portal"
/out:"C:\Users\MyAppBuild\.hudson\jobs\MyApp Portal Build\MyApp.Cloud.cspkg
This is my service definition:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="MyApp.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-05.1.7">
<WebRole name="MyApp.Portal" enableNativeCodeExecution="true">
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" />
<Setting name="DataConnectionString" />
<Setting name="BaseUrl" />
<Setting name="DatabaseConnectionString" />
<Setting name="Environment" />
</ConfigurationSettings>
<Sites>
<Site name="MyApp_WebRole" physicalDirectory="..\Portal\MyApp.Portal">
<Bindings>
<Binding name="HttpIn" endpointName="HttpIn" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
I get the error :
Error: CloudServices7 : The physical directories are not valid for role /sites:C
:\Users\MyAppBuild\.hudson\jobs\MyApp Portal Build\workspace\trunk\Portal\Port
al\MyApp.Portal\bin;MyApp.Portal sites, virtual directories, and virtual appli
cations..
What should the physical directory be?
You may need to use relative path rather than absolute path. Please refer here
When upgrading a project that has relative paths in the csdef (as is the case here) to the 1.8 SDK you should see the warning below in the upgrade log about the change in relative path. This specific change was made to better support parallel builds.
The physicalDirectory attribute of the Site element contains a relative path. This path is relative to the directory in which the target Service Definition file resides when packaged. In previous versions this file was located within the root project directory. In this version, by default, this file is located in the project output directory. You may need to update the relative path to reflect the new location of the target Service Definition file.