Unable to connect to Azure Redis Cache with SSL - azure

Connecting to Azure Redis Cache like this, on Owin application startup...
var options = ConfigurationOptions.Parse(cacheConnectionString);
var kernel = new StandardKernel();
kernel.Bind<ConnectionMultiplexer>().ToMethod(context =>
{
return ConnectionMultiplexer.Connect(options);
}).InSingletonScope();
Which works absolutely fine for Redis running on my local machine, or for Azure Redis with SSL turned off. However, as soon as I change the connection string from:
xyz.redis.cache.windows.net,ssl=false,password=abcdefghxyz=
to
xyz.redis.cache.windows.net,ssl=true,password=abcdefghxyz=
It throws:
It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. UnableToResolvePhysicalConnection on PING
I'm using StackExchange.Redis version 1.0.316.0 from NuGet. I've tried...
Creating different caches in Azure Portal. Hasn't worked over SSL with any of them :(
Connecting without using Ninject
Creating the ConfigurationOptions object manually rather than parsing a string
I'm all out of ideas for what could possibly be going wrong now though. Hopefully it's something trivial I've missed, but just can't see it!
Edit
I ran the ConnectToAzure() unit test, passing in my cache name and password and it passed. So I'm almost certainly doing something silly here.
Edit 2
It also works from a console application without any issues.

I fixed it, super-weird situation but I'll answer just in case someone else is ever sat equally as confused as I've been.
The project was previously a web role in an Azure Cloud Service, which had In-role caching enabled. We moved it to a standalone Azure Web App, but never got around to removing all the unnecessary references that were left over.
Removing Microsoft.WindowsAzure.ServiceRuntime and Microsoft.WindowsAzure.Diagnostics miraculously got it working.

Related

Mongo connecting to localhost although the conn string is right accross the app

So I have an Node API hosted on AWS' Beanstalk and it's connected to a DocumentDB database hosted within the same VPC, unfortunately I can't share too much info on the project since I've inherited it, but currently we have a terrible logic of creating a new db for each tenant in the system so when they sign in we create a new mongoose connection (with the proper string). Upon that there is also a global connection to a central db which is supposed to be established upon the initial start of the API - this works as expected. What doesn't work for some reason is that whenever I make a request that's supposed to go through for a certain tenant I get the following error on AWS Beanstalk logs:
ERROR IMAGE
Unfortunately, I can't fully disclose the connection strings, but I can tell you that there are no references to "locahost" within the project (noted in the picture):
PROJECT SEARCH RESULT
Has anyone encountered similar issues ?

How to solve the error SequelizeHostNotFoundError?

Problem essence
Writing the API server in NodeJS (Express) using the PostgreSQL database (connecting to it remotely through the service ElephantSQL and work through Sequelize). Today appeared an error "SequelizeHostNotFoundError". It occurs even in the checked endpoints.
Error text
(it remains only a screenshot of the error)
My attempts to solve the problem
Tried to perform a GET request to my API not via Postman and via the browser (did not help).
Tried to create a new DB on the same service ElephantSQL (didn't help, but migrations to create new tables and relationships somehow executed and endpoints still not working).
Tried to connect to the database directly via IDE DataGrip (connection test is successful and the database is loaded with all the tables).
What could be the problem ? On stackoverflow some wrote that the problem may occur due to the lack of a paid subscription to Google Cloude Functions, but I do not seem to use it. There is an option to connect to PostgreSQL locally, but I want to understand.

Azure Webjob is not connecting to the database of the connected website

So I have a Azure website. It uses "code-first" entity framework for its database. It works like a champ.
I have a new console application turned webjob that I am connecting to this website and it is supposed to use the same database.
Now everything I have read points me to the direction that the webjob should share the configuration settings of the website which leads me to believe that it should be able to access the database through this sharing of info.
However...when the schedule runs I get the classic
"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."
error that signifies that my connection string is missing or incorrect.
In my console application for the webjob I have specifically not put in a connection string because, again, I thought they were linked somehow.
My question is simply, what am I misunderstanding here, and/or is there something else I need to do in my console application to get the web job to connect correctly?
UPDATE
So I added a traditional connection string into the app and that seems to work just fine. I suppose this is fine, but I was really hoping that I wouldn't have to change my config each time I change environments...thought we were finally passed that.
Thanks!
David
you can use the ConfigurationManager to grab your connection string...
e.g., ConfigurationManager.ConnectionStrings["YOUR_CONNECTION_STRING_NAME"]

Meteor methods don't work on Modulus server

I had an app deployed on Meteor's servers and it worked as expected.
Now, I've moved the app to a NodeJS platform, called Modulus, using their CLI tool. (App hosted at http://crazygain.com)
For some reason, the method calls - Meteor.call or Meteor.apply - are not executed. Looking at the network indicator in Chrome Dev Tools I saw that the request is never sent.
I tried sending requests directly from the console, and got the same result.
e.g. when I execute the following
Meteor.call("foo",function(){console.log("callback");});
on the new Modulus server I simply get undefined
However, when I run it on the old Meteor server I get the "callback" log as expected.
I'm quite puzzled and unsure what can cause such behaviour.
UPDATE:
meteor.status() returns
Object {status: "connected", connected: true, retryCount: 0}
This might be because the web socket connection isn't established. Meteor calls & subscriptions depend on the DDP protocol which have a separate connection to the server.
Have a look at Meteor.status() to see if you are connected & if not investigate your connection's web socket/long polling connection.
It might just be a connection issue. Your meteor call works for me with the site you have provided.
Have you followed the Meteor deployment guide on Modulus' website? You need to convert the app using demeteorizer.

Why might Windows Azure CloudBlobContainer access occasionally fail with The remote certificate is invalid according to the validation procedure

I am using an evaluation subscription to Windows Azure.
Occasionally when I try to access methods on a CloudBlobContainer such as GetPermissions() the web service hangs. After adding some logging I see "The underlying connection was closed:
Could not establish trust relationship for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure." in my log.
I have also had this happen when using CreateIfNotExists().
What might be causing this?
I have recently upgraded from version 1.7 to version 2 of the storage client library but still see this behavior.
This is not a problem that I've encountered before, but if the error message is accurate then there is something funky going on with the SSL certificate in storage. A possible work around is to just not use SSL. If your talking to a storage account in the same data centre, I don't think this will adversely affect security. You should be able to do this by just changing the https to http in your connection string.
If this does work, it might pay to contact MS support, it might point to a problem on their end.
I'm going to answer my own question in the hope that it is useful to someone else.
The issue was the scope of ServicePointManager.ServerCertificateValidationCallback.
It is static and effects CloudBlobContainer methods encountered after it is set.

Resources