I am trying to implement Azure Redis Cache in my app. When I see the documents they say I have to define a cache storage in the Azure online tool. I am wondering is there a way to skip that step and use Redis for development without using the actual server thing?
You can install Redis locally and use localhost. That might be one of your options even though I don't think it's faster.
You can download it and install it from here.
You can run Redis server locally, and start the experiment. But if you have decided to use Azure Redis, you should develop toward the real one as early as possible. Several reasons:
Azure Redis supports SSL and this is the default port. You should use this.
Azure Redis has high availability support through master slave.
Azure Redis provide Cluster support.
It might experience unexpected patching process causing temporarily data loss
These things are not easily setup and test locally.
Related
Is there a way to write C# code in an Azure Function running in the Azure cloud to move files to and from an instance of SharePoint on-premises ? I have heard that to do this I require some sort of data gateway or connector of some sort to be in place.
Any guidance much appreciated, thanks.
Yes it would be possible but there's lots of factors to take into account with regards to your environment and how it is configured from a network perspective.
You are able to run Azure Functions within your on-premises environment. You can see some of the hybrid scenarios here:
https://learn.microsoft.com/en-us/azure/architecture/hybrid/azure-functions-hybrid#running-azure-functions-on-premises
There's also App Service Hybrid Connections which allow you to reach on-premises infrastructure:
https://learn.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections
There's a devblogs post with a scenario you can read also:
https://devblogs.microsoft.com/premier-developer/using-azure-app-services-with-hybrid-connections/
We have completed a hybrid mobile application that makes use of SignalR (.Net Core) on the backend.
The issue we have now discovered is that, SignalR does not play nicely with load balancers and although there is Azure and Redis, to get this approved will be a nightmare.
Does anyone know of any alternative solution we can deploy without having to go to the architecture forum for approval of Redis.
Ideally, within C# WebApi and deploy to IIS.
NOTE! We cannot make use of Redis or Azure in our case.
Quick update: going to test this solution tomorrow. If we are successful, I will post an official answer.
https://dotnet.myget.org/feed/aspnetcore-master/package/nuget/Microsoft.AspNetCore.SignalR.SqlServer
I was trying to setup Elastic cache (memcached engine) & use in my .NET application through a memcache c# client API "Enyim".
I'm new to AWS and facing some problems. I have few questions :-
Question 1 : Can I access my cache cluster nodes from my local machine ?
Question 2 : What is the process of setting up complete AWS Elastic cache instance. Correct
me if i'm wrong :-
Setup VPC (by default)
Setup a security group in EC2 (by default)
Setup cache cluster as with same VPC.
Now how can i use this same cache cluster ?
I have setup the memcache engine on local & the same code through Enyim was running but i was not able to run same (get/set) code for the Elasticache node instances.
It is not possible to directly access Elasticache from outside AWS, however it can be done using an SSH tunnel through an EC2 instance on the same VPC.
Here is how to setup SSH tunnel:
http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/
Here is a full C# example about how to use Elasticache:
http://www.omidmufeed.com/how-to-use-elasticache-memcached-or-runtime-caching-in-c/
As far as Question #1, I am certain when using the redis flavor of elastic cache you cannot (according to aws never will be able) to access the cache from anywhere except within AWS.
For debugging purposes it would be nice to be able to, but in production mode, accessing the cache from outside aws would introduce sufficient latency to defeat any benefit you might get from using the cache in the first place.
I am using the MongoDB worker role project to use MongoDB on Azure. I have two separate cloud services, in one of them everything works fine, however in the other, the MongoDB worker role is stuck in a Busy (Waiting for role to start... Calling OnRoleStart state.
I connected to one of the MongoDB worker roles and accessed the MongoDB log file and found the following error:
[rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
There are threads on how to fix this normally, but not with Windows Azure. I did not configure anything for the MongoDB worker role (apart from Azure storage connection strings), and it works in another service, so I don't know why it isn't working for this service. Any idea?
Some time ago I was trying to host RavenDB in Azure as Worker Role and had lot's of issues with it as well.
Today, I believe it's better to run database the "suggested" way on target platform which is as Windows Service according to this "Install MongoDB on Windows" guide. This way you won't have to deal with Azure-specific issues. To achieve this you can:
Use Azure CmdLets along with CsPack.exe to create the package for MondoDB.
A solution similiar to RavenDB Master-Slave reads on Azure which I posted on GitHub.
Sign up for Virtual Machine (beta) on Azure, kick off a machine and install MongoDB manually there.
But I guess the most important question when hosting DB is: where do you plan to store the actual DB?
Azure's CloudDrive, which is a VHD stored in Cloud Storage, has the worst IO performance possible. Not sufficient for normal DB usage I'd say.
Ephemeral storage, a Cloud Service local disk space, has perfect IO, but you lose all data once VM is deleted. This means you usually want to make continious or at least regular backups to Cloud Storage, maybe through CloudDrive.
Azure VM attached disk - has better IO than CloudDrive, but still not as good as Ephemeral storage.
As for the actual troubleshooting to your problem. I'd suggest wrapping OnRoleStart with try-catch, writting it to the log, enabling RDP to the box and then connecting and looking into the actual issue right in place. Another alternative is using IntelliTrace, but you need VS Ultimate for that. Also, don't forget that Azure requires usage of Local Resources if your app needs to make writes to the disk.
I'm developing an application to run in azure.
I'm making use of the azure cache, however when I run this locally I don't want to connect up to Azure to use the cache because it's a bit slow and tedious.
Can you run the cache locally?
[EDIT]
This is .Net C#
Unfortunately, you do need to connect to azure to test the windows azure cache service. Read this for more info: http://msdn.microsoft.com/en-us/library/windowsazure/gg278342.aspx
You can use Windows Server AppFabric Cache when local debug. It utilizes very similar configuration and program mode, which means almost all you need to change is the cache server IP and access token.
But I'd better to create a separated Cache layer to isolate the cache operations. For example introduces ICache interface with Add, Get, Remove, etc. methods. Then you can implement the Azure Cache, Memcached, In-Proc Cache, etc. in vary cases.
There's a good cache layer you might be interested in, check the ServiceStack project at GitHUB https://github.com/ServiceStack/ServiceStack/tree/master/src/ServiceStack.Interfaces/CacheAccess
It's not possible. To use the windows azure caching service locally, you'll always have to route your request to azure, which adds a serious delay on top of the request.
To property test your cache, you need to deploy your service in azure.
As others said, you can use Windows Server AppFabric caching locally, but be warned, there are some differences between the Windows Server AppFabric caching and the Windows Azure caching service, like for example the notifcation based invalidation on local cache items is not supported in azure. Make sure not to use any of these features while developing locally, or you might get surprised when deploying your service to the cloud.
Only the timeout based invalidation on local cache is supported for the windows azure caching service. Windows azure caching service is designed to be used for your cloud services, so it makes sense it's kinda crappy when using with on on-premise application.
Azure AppFabric caching uses a subset of the functionality of Windows Server AppFabric caching. If you're willing to setup a server in house with the cache installed you could probably get something comparable to using the Azure cache. I haven't tried this myself, so while I know that the code you'd need to write is more or less the same between the two, I'm not sure how different the configs need to be.
Chances are though that it's going to be a lot less time and effort to just use the Azure cache.
This article specifically talks about what you are trying to do. Create a caching "infrastructure" that switches between local and distributed cache based on configuration(s):
http://msdn.microsoft.com/en-us/magazine/hh708748.aspx
Now you can use azure in-role cache and try locally using emulator