So I have two separate projects for a cloud project I am deploying to Azure, I used to use the old grouping to ensure my roles had access to local services.. now that the old portal has been retired that grouping style is gone... which is fine - except, I cannot for the life of me get my worker role to connect to the new virtual network.
I have deployed a web-role, and it connects just fine to the virtual network (which utilizes the same set of services), and I have configured the web and worker-role the same in the service configuration file. The only thing I can think is there is a different way I need to configure the worker, vs, the web role?
The config I have in my serviceconfiguration file:
<NetworkConfiguration>
<Dns>
<DnsServers>
<DnsServer name="MyDNSServer" IPAddress="11.11.11.11" />
</DnsServers>
</Dns>
<VirtualNetworkSite name="West-US" />
<AddressAssignments>
<InstanceAddress roleName="CPTWorkerRole">
<Subnets>
<Subnet name="MySubnet" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
Please let me know any ideas on the worker role... please do not suggest based upon web-role experience, as I am not having issues connecting the web role...
Thanks!
I don't believe that there is any difference and so, just to make sure, I made a quick attempt just now - I've create a cloud project with 2 instances of a web role and an instance of a worker role and successfully deployed both roles onto an existing VNET I had using the same configuration -
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-10.2.2">
<Role name="WebApplication9">
<Instances count="2" />
</Role>
<Role name="WorkerRole1">
<Instances count="1" />
</Role>
<NetworkConfiguration>
<VirtualNetworkSite name="yossinet" />
<AddressAssignments>
<InstanceAddress roleName="WebApplication9">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
<InstanceAddress roleName="WorkerRole1">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>
Related
I have an azure worker role deployed which runs a a few scheduled tasks as part of an integration system. I am trying to expose an http endpoint which will provide some administrative functions so I can control aspects of the worker role remotely.
I have the work role and up running the only problem is that I am not able to access http endpoint from the internet.
I have confirmed that the nancy server is running since when I remote onto the VM I am able to connect using the local ip address.
The role config is as follows:
<ServiceDefinition name="Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
<WorkerRole name="Host.Azure" vmsize="Small">
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
</ConfigurationSettings>
<Startup>
<Task commandLine="mount.cmd" executionContext="limited" taskType="background">
</Task>
</Startup>
<Endpoints>
<InputEndpoint name="http" protocol="http" port="80" localPort="80" />
</Endpoints>
<LocalResources>
</LocalResources>
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WorkerRole>
</ServiceDefinition>
I am creating the nancy url as follows:
var endpointName = "http";
var instance = RoleEnvironment.CurrentRoleInstance;
var internalEndpoint = instance.InstanceEndpoints[endpointName];
var uri = new Uri($"{internalEndpoint.Protocol}://{internalEndpoint.IPEndpoint}");
return new NancyUri {Value = uri};
Is there something else which I need t o do to get this working?
It had to do with the windows url acl config. I thought because I was supplying the local ip to the nancy host it would work, but I had to add an entry to the http acl in the end.
The nancy url is being built up like this
var uri = new Uri("http://localhost:80");
return new NancyUri {Value = uri};
I setup a task to run the following command
netsh http add urlacl url="http://+:80/" user="Everyone"
Which reference in the csdef file as follows:
<Task commandLine="network.cmd" executionContext="elevated" taskType="background"></Task>
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/).
I am trying to add a new worker role to an existing azure cloud service. The existing cloud service already have a web role deployed which runs in 2 instances.
The new worker role need to run on single (1) instance.
The old ServiceConfiguration file looked like this >>
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure3" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-01.2.3">
<Role name="WebMVCApplication1">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
the new ServiceConfiguration file looks like this >>
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure3" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-01.2.3">
<Role name="WebMVCApplication1">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
<Role name="NewWorkerRole">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
However when I upload the new ServiceConfiguration file along with the new worker role package. I get this error >> Role "WebMVCApplication1" was not found in the currently deployed service. The long running operation tracking ID was: 21xxxxxxxc42xxxxxxxxxxbda5e.
I am following this guide http://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-manage/#updaterole .
I have checked both text boxes as per the document.
What I am missing here ?
Any advice will greatly help.
Many Thanks
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.
While deploying a new Web Role on Windows Azure i am getting this error:
Unable to allocate the required address spaces for the deployment in a new or predefined subnet that is contained within the specified virtual network.
I have searched for a solution, but didn't find one. Does any one have an idea?
My cscfg file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="Application.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-03.2.0">
<Role name="WebApplication" vmName="vm001">
<Instances count="1" />
<ConfigurationSettings>
...
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="..." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<Role name="Application.ServiceOpdrachten" vmName="vm002">
<Instances count="1" />
<ConfigurationSettings>
...
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint=".." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<NetworkConfiguration>
<VirtualNetworkSite name="VirtualNetwork" />
<!-- The virtual network name must match the name of the vvirtual network configured in your subscription. -->
<AddressAssignments>
<!-- You must map each role in your cloud service to a subnet or a collection of subnets which were defined in your network.-->
<InstanceAddress roleName="WebApplication">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>
In the same cloudproject i have another instance that deploys fine.
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="Ecare.Acasa.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-03.2.0">
<Role name="WebApplication">
<Instances count="1" />
<ConfigurationSettings>
...
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="..." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<Role name="Ecare.Acasa.ServiceOpdrachten">
<Instances count="1" />
<ConfigurationSettings>
...
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="..." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<NetworkConfiguration>
<VirtualNetworkSite name="Ecare" />
<!-- The virtual network name must match the name of the vvirtual network configured in your subscription. -->
<AddressAssignments>
<!-- You must map each role in your cloud service to a subnet or a collection of subnets which were defined in your network.-->
<InstanceAddress roleName="WebApplication">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>
We had the same problem around three months ago. Back then may be after some update, the new IP Addresses were not being assigned, or when role or vm were deleted their IP address were not reusable.
We were not able to take help from Microsoft Support, as it was in Preview.
What worked for us was:
We deleted the whole virtual network, and created it again.
If it is possible for you, see if it works.
I was facing this issue and found the issue can be fixed. It has been documented here.