Is it possible to run Quartz.Net in an Azure WebJob and communicate with it using a RemoteClient proxy? If so, how could I figure out what the address would be?
<quartz>
<add key="quartz.scheduler.instanceName" value="RemoteClient"/>
<add key="quartz.scheduler.proxy" value="true"/>
<add key="quartz.scheduler.proxy.address" value="tcp://127.0.0.1:555/QuartzScheduler"/>
</quartz>
I know that Azure has its own scheduling mechanisms, but my application has to run in both Azure and Self-Hosted environments.
The Azure WebJob has the same sandbox limitation as the Azure Website in which it cannot open an arbitrary port and listen on it.
One possible way to communicate with a WebJob is via persistent queues (like Azure storage queue, servicebus queue or any other).
Related
My ASP.NET MVC application is deployed on Azure app service and was working until today. It won't let me login anymore through the application which uses ASPNET membership. If I run the application in Visual Studio locally pointing to the production azure sql db it works. The deployed app can read data fine but it seems when it tries to login it doesn't while deployed on azure. I haven't changed any code so I don't know why it stopped working on azure when it was. It still allows for reading of data, it displays items in a browse page. I saw this error when I disabled custom errors:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found
or was not accessible. Verify that the instance name is correct and
that SQL Server is configured to allow remote connections. (provider:
SQL Network Interfaces, error: 26 - Error Locating Server/Instance
Specified)
I've checked these questions but they didn't seem to make it work:
Azure SQL firewall
Network interface azure
Azure passwords
Hashed passwords
login works locally not on azure
azure debugging
login register locally not on azure
UPDATE
I used remote debugging and it's failing in a razor view when I check the roles using this line:
if (User.IsInRole("Administrator")) {
I don't know why it was working for a while then stopped but this is what I did to fix it. It was trying to connect to an old membership database connection LocalSqlConnection from a machine.config file. I saw it creating the aspnetdb.mdf in the AppData folder when I would run in visual studio but I am using ASP.NET Identity. I had to modify my web.config like this keep it from using the local db:
Comment out these:
<!--
<membership>
<providers>
...
</providers>
</membership>
<profile>
<providers>
...
</providers>
</profile>
<roleManager>
<providers>
..
</providers>
</roleManager>
-->
Add this:
<modules>
<remove name="RoleManager"/>
</modules>
Add this in <connectionStrings>
<add name="LocalSqlServer" connectionString="same as application database connectionstring"...
The answer from #clayRay in this question gave me most of the answer:
How do I stop using ASPNETDB.MDF in LocalDB?
I have two projects in my solution:
1. WCF Service Library
2. MVC project Azure free website which uses the WCF service.
Everything works as it should when not deployed, (localhost), but I have no idea how to use my WCF service from my MVC project when I have deployed my MVC project to Azure.
Solution:
WCF Service Library project app config:
<client>
<endpoint address="http://localhost:8080/UserWCF" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IUserService" contract="Fildela_WCF.IFildelaService"
name="WSHttpBinding_IUserService">
<identity>
<userPrincipalName value="REFT\filip" />
</identity>
</endpoint>
</client>
<services>
<service name="Fildela_WCF.FildelaService">
<endpoint address="UserWCF" binding="wsHttpBinding" contract="Fildela_WCF.IFildelaService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080" />
</baseAddresses>
</host>
</service>
</services>
MVC project web config:
<client>
<endpoint address="http://localhost:8080/UserWCF" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IFildelaService" contract="FildelaServiceReference.IFildelaService"
name="WSHttpBinding_IFildelaService">
<identity>
<userPrincipalName value="DEFAULT\Filip" />
</identity>
</endpoint>
</client>
How I use my service on localhost:
Right click Service References folder in my MVC project and click "Add Service Reference".
Click discover and select the localhost service that pops up under Services.
I can now access my functions that resides in my WCF project: ServiceClient1 test = new ServiceClient1();
Test.HelloWorld();
I have tried to replace the localhost address with my azure website but it doesn't work, (mywebsite.azurewebsites.net).
I am all new with this so bear with me. I have two projects in my solution now and when I publish my MVC project, the WCF project wont come with the publish, right?
So how am I supposed to use the WCF project from my MVC project when the web project is published to Azure?
Am I supposed to use an Azure Service Bus?
Should I go with cloudapp instead?
How? What? Why?
Thank you very much
I have decided to convert my Azure website project to an cloudapp project. Publishing two seperat Azure websites just because of the WCF service is not very efficient.
I am using the New Relic monitoring service with the .NET agent. It runs on the production server.
However, I also get statistics from my local machine when I am testing/developing the application. I used the New Relic Server Monitor Configuration tool to stop the service, and also disabled it with services.msc. But I still see my local machine in the "servers" section when I check my application on newrelic.com.
What should I do (either in my application or with my machine) to stop this?
The Windows Server Monitor is a different application from the .Net Agent. You will need to disable the .Net Agent in order for your development system to stop sending data to your application. If you don't want to have the .Net Agent run at all on your development system you can alter the newrelic.config file in %ALLUSERSPROFILE%\New Relic\.NET Agent to disable it by changing the following:
<configuration xmlns="urn:newrelic-config" agentEnabled="true">
to
<configuration xmlns="urn:newrelic-config" agentEnabled="false">
This has the advantage of being set globally, but if you want to turn it on and off per application you can add the following in the web application's web.config:
<appSettings>
<add key="NewRelic.AgentEnabled" value="false"/>
</appSettings>
I have multiple Azure service configurations (ServiceConfiguration.(Release/Local).cscfg. I simply removed the licensekey from the Local configuration. And uninstalled the two agents on my Windows machine (via Change or Remove a Program).
When I ran the project again locally, it didn't report, so all is good ;)
I am creating a web app which uses Co-Located Cache for Session management. In development, I am getting this error
Cache referred to does not exist. Contact administrator or use the Cache administration tool to create a Cache
But I don't know from where I can create cache. I have Azure SDK installed and m using VS2012. I don't have any server with AppFabric installed.
Do I need to install AppFabric? If yes then can someone please provide a link to install and consume AppFabric in dev mode. If no then what the solution is ?
thanx
Please check the cachename in your cache client configuration.
<system.web>
<sessionState mode="Custom" customProvider="AFCacheSessionStateProvider">
<providers>
<add name="AFCacheSessionStateProvider"
type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider,
Microsoft.Web.DistributedCache"
cacheName="default"
dataCacheClientName="default"/>
</providers>
</sessionState>
</system.web>
It should be default or another cache created on the server.
Please refer to this link for configuring Azure Co-Located Caching.
I'm trying to perform a VIP swap via the azure portal and I'm getting the error:
Windows Azure cannot perform a VIP swap between deployments that have a different number of endpoints.
I looked closer and I DO see difference in # of endpoints (2 in production vs 3 in staging).
Production:
Input Endpoints
OUR.API:168.62.21.50:80
OUR.API:168.62.21.50:3389
Staging:
Input Endpoints
OUR.API:168.62.22.55:80
OUR.API:168.62.22.55:3389
OUR.API:168.62.22.55:8172
Port 80 is web and 3389 is remote desktop. So far so good. Where is that additional port, 8172, coming from? Nothing in the application listens to anything other than port 80. Plus the applications in the staging and production areas are almost identical - so it's gotta be the framework. Any steps in narrowing this down?
[edit]
Also, my role's ServiceDefinition.csdef has just one endpoint defined:
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
"Where is that additional port, 8172, coming from?"
It is from WebDeploy being enabled in the publishing settings
Long answer:
I parsed the entire configuration one by one between the staging and production, here is what I found:
Your publishing settings are saved to
<azurerole>\Profiles\<yourprofilename>.azurePubxml
My production deployment had
<AzureEnableWebDeploy>True</AzureEnableWebDeploy> while my staging deployment had <AzureEnableWebDeploy>False</AzureEnableWebDeploy>
The Azure infrastructure then looks that up and opens port 8172 to enable WebDeploy on the staging roles. So that's why the endpoints are different despite no new endpoint defined in the ServiceDefinition.csdef file.
I'm not sure why having different number of endpoints should prevent an Azure Publication itself.
For me the issue was that my PROD instances had RDP enabled and the STAGING did not. So "RDP" was the endpoint that was different.