Posts Tagged ‘Azure’

Azure Cache Manager and Redis Cache Manager

January 27, 2015 Leave a comment

CodeFluent Entities allows to cache request results by using the Cache sub-producer:

CodeFluent entities provides out of the box three types of Cache implementations:

  • Simple Cache Manager, based on the ASP .NET cache (that can be used outside of ASP.NET) (CodeFluent.Runtime.Caching.SimpleCacheManager, CodeFluent.Runtime)
  • Simple Localized Cache Manager, a sub-class of the Simple Cache Manager that can manage localized keys (CodeFluent.Runtime.Caching.LocaleCacheManager, CodeFluent.Runtime)
  • Enterprise Library Cache Management, you must install the Enterprise Library in order to use it (CodeFluent.Runtime.Caching.EnterpriseLibraryCacheManager, CodeFluent.Runtime)

You can specify the type of cache you want to use on the “Runtime Cache Type Name” attribute (the full type name). You can use a different cache systems by scope (entity, method).

Microsoft Azure introduces two cache services: Azure Managed Cache Service and Azure Redis cache (currently in preview).

Azure Cache is a family of distributed, in-memory, scalable solutions that enables you to build highly scalable and responsive applications by providing you super-fast access to your data. We offer the following types of Azure Cache:

  • Azure Redis Cache: Built on the open source Redis cache. This is a dedicated service, currently in Preview.
  • Managed Cache Service: Built on App Fabric Cache. This is a dedicated service, currently in General Availability.
  • In-Role Cache: Built on App Fabric Cache. This is a self-hosted cache, available via the Azure SDK.


CodeFluent Entities already provide support some Azure features such as Azure Table and Azure Blob Storage, and we decided to continue our efforts to help our customers to use Microsoft Azure. This is why we release two new cache managers:

  • Redis Cache Manager
  • Azure Cache Manager

How to use Azure Redis Cache?

Download the Redis CacheManager from GitHub and add it to your project. You also need to add the following NuGet package: StackExchange.Redis.

Now you can change the cache producer configuration:

Then build the model.

Finally you have to configure the cache manager with the configuration file (app.config or web.config) to use your Redis server:

    <add key="SoftFluent.Samples.RedisCache.Caching.RedisCacheManager.Configuration"
 value=",allowAdmin=true,ssl=true,password=password" />

    <add key="SoftFluent.Samples.RedisCache.Caching.LocaleRedisCacheManager.Configuration"
 value=",allowAdmin=true,ssl=true,password=password" />

Note: if you use the Localization Aspect, you have to use SoftFluent.Samples.AzureCache.Caching.LocaleRedisCacheManager.

How to use Azure Cache Service and In-RoleCache?

Managed Cache Service and In-Role Cache use the same API, so you can use the same cache manager.

Download the CacheManager from GitHub and add it to your project. You also need to add the following NuGet package: Microsoft.WindowsAzure.Caching. Now you can change the cache producer configuration:

Then build the model.

Finally you have to configure the azure cache client:

If you are not using the “default” cache, you can set the client name and cache name in the configuration file (app.config or web.config):

    <add key="SoftFluent.Samples.AzureCache.Caching.AzureCacheManager.ClientName"

    <add key="SoftFluent.Samples.AzureCache.Caching.LocaleAzureCacheManager.CacheName"

Note: if you use the Localization Aspect, you have to use SoftFluent.Samples.AzureCache.Caching.LocaleAzureCacheManager.

If you think we can add some useful functionalities to CodeFluent Entities, please share your idea on the forum.

Happy caching,

The R&D Team

Categories: Cache Tags: , ,

Quickly Generate SQL Azure Databases with CodeFluent Entities

August 14, 2012 1 comment

CodeFluent Entities ships out-of-the-box with an SQL Azure producer which allows you to generate databases to SQL Azure directly from Visual Studio, based on a CodeFluent Entities model. We’ll see in this post how we can actually do it.

First of all, we have to setup our Azure environment, so we’ll start by login on with the LiveID associated with an Azure subscription. Once we’re logged on, we’ll go directly to the Database section of the portal and we’ll begin by creating a new database server as shown here:

Then you’ll have to choose a region to define where your server will be located. In my case it will be “North Europe”. Once you have chosen a region, you’ll have to provide credentials for the server as shown below:

The next step is very important here, as you’ll have to configure the firewall of your server to allow some IP ranges. The thing is, if you don’t allow your own IP address, you won’t be able to manage the database or generate it with the CodeFluent Entities SQL Azure producer, from the Visual Studio environment:

Once you’ve setup your firewall rule(s), click on finish to validate the creation of you server.

The server is now created, so click on it and you should see that a database has been created by default, the master database. But we’re not able to produce anything on this one, so we’ll have to create a new one. To do that, click on “Create” on the top on the database part of the ribbon, then give a name to your database and select its edition and size. In my case, I chose a 1GB Web edition which I named “MyDatabase”.

Azure Database configuration is now done so let’s open Visual Studio to see how to generate the persistence layer of our application directly on the database we’ve just created. For the purpose of this article I’ll use a sample project provided out-of-the-box with CodeFluent Entities, namely the “Advertising Sales Management Sample Model”. If you open this model, you’ll see it contains 7 entities, 4 enumerations, and different relations (e.g. one-to-one, one-to-many, many-to-many):

Once this project is created, I’ll add a new “SQL Server Database”-type project to my solution, which will be the target project for the CodeFluent Entities SQL Azure producer. I’ll name this project “SoftFluentArticle.Database” as shown here:

Once that’s done, let’s add a new producer to the CodeFluent Entities project, the ‘SQL Azure producer’. It can be found in the “Persistence Layer Producers” category as shown here:

As you can see, if you never used it, it’s pretty similar to the regular CodeFluent Entities SQL Server producer, but you will notice there are are a “Local SQL Server” and an “Online SQL Azure” sections. Moreover, in the “Targets” section, the property “Produce Online SQL Azure” is set to false and the property “Produce Local SQL Server” is set to true.

The reasons are multiple. The most important is simply… the cost for you 🙂 Because each time your application requests data from your SQL Azure, there is a cost applied to the transaction and you certainly don’t want to pay fees for these transactions while you’re developing/testing your application. That’s why you will use the Local SQL Server most of the time, and switch to the Online SQL Azure when you’re ready. It’s important to note the generated code will always target SQL Azure, even if the local SQL Server is in use, thus avoiding pure SQL Server statements unsupported on SQL Azure.

We now have to specify our SQL Azure connection string, just like a regular SQL Server connection string. To do that just click on the “Connection String” property line, a button will be shown at the extreme right of the line, click on it and you should get the same popup as the one shown below. Fill it with your Database Name, Server Name, Password, and User name. You can now click on test connection to check it works.

Back to our producer configuration, choose the database project we’ve created earlier as the “Default Target Directory” (you can use a sub folder if you want, or the root as it’s shown here):

Click on “Ok” to confirm all that.

Everything is now setup, so let’s build our project and see what happens! As for the SQL Server producer, the SQL Azure produced our scripts in the database project folder we’ve set as the target (see all the .SQL files automatically generated):

Now, let’s open the well-known SQL Server Management Studio tool and connect to our local SQL Server. You should see there the database which has been generated by the SQL Azure producer “diff engine”. Open now you web browser, go to your SQL Azure database address, in my case$database=MyDatabase, and fill-in the form with the server credentials you’ve setup earlier.

When you are logged on, click on the Design button on the bottom left of the screen. You should land on the following screen and, as you can see, there are no tables or stored procedures here, yet:

Why hasn’t my database been generated on SQL Azure? The answer is simple: the property “Produce Online SQL Azure” is still set to false. So let’s go back to Visual Studio. Double-click on the “SQL Azure Producer”, change that property to true, press OK, and build your solution again. Once your solution is built, go back to the SQL Azure portal, click on the Refresh button. All your tables and stored procedures should now appear like this:

Since you’re using CodeFluent Entities, as usual, continuous build is a feature. So, you can change the model and build anytime, this will update all the layers of your application, including your SQL Azure database.

Pretty cool isn’t it?

Aymeric ROLAND.

July 24th 2012 Links: Software development, Windows Azure, Office

July 24, 2012 Leave a comment

Here’s our new entry in our link-listing series:


Software Development

Is the laptop doomed?

Ahaha, we’re not quite there yet, but we sure are getting there Winking smile


Entity Framework now Open Source

Big news: The Entity Framework source code is today being released under an open source license (Apache 2.0), and the code repository is now hosted on CodePlex (using Git).



MonoGame is an Open Source implementation of the Microsoft XNA 4 Framework. Its goal is to allow XNA developers on Xbox 360, Windows & Windows Phone to port their games to the iOS, Android, Mac OS X, Linux and Windows 8 Metro.  (PlayStation Mobile development is currently in progress.)


Windows Azure

SOSP Paper – Windows Azure Storage: A Highly Available Cloud Storage Service with Strong Consistency

Wow, that’s interesting: the paper describes how Microsoft provisions and scales out capacity within and across data centers via storage stamps, and how the storage location service is used to manage their stamps and storage accounts. Then it focuses on the details for the three different layers of the architecture within a stamp, why these layers, what their functionality is, how they work, and the two replication engines.

A must read!



Microsoft’s new Office: The cloud finally takes center stage

A sneak peek of Office 2013 (a.k.a. Office 15)


Microsoft released new Office (Customer Preview)

The new Office is available online (preview).


Introducing “Napa” – Office 365 Development Tools

The Visual Studio team released a preview of a new toolset called “Napa”, which is, as they say, “the easiest way to start building apps for the new Cloud App Model”.


Hope this helps,

Carl Anderson

Windows Azure Blob Storage Support

March 23, 2011 1 comment

Along with the SQL Azure Producer, the latest CodeFluent Entities build introduced out-of-the-box support for Windows Azure Blob Storage.

Basically, instead of storing your blobs in your database, you can configure your CodeFluent Entities generated application to store them in Windows Azure Blob Storage. You don’t need to generate over, nor to modify your UI code, it is completely independent from the design or modeling phase of your CodeFluent Entities project; and completely independent from the persistence producers used at generation time.

In fact, all you need is:

  • a working Windows Azure Blob Storage account,
  • references to the CodeFluent Azure Runtime (CodeFluent.Runtime.Azure.dll), and Microsoft.Windows.Azure.StorageClient.dll
  • an application configuration file indicating your application should use the Azure binary services instead of the default one.

Check-out this video to see how it goes:

CodeFluent Entities–Windows Azure Blob Storage Support

More information is available in our product documentation here.

Categories: SQLAzure Tags: ,

CodeFluent Entities SQL Azure producer is Windows Azure Certified

March 14, 2011 Leave a comment

We announced last week the official support of the Microsoft SQL Azure producer, a new CodeFluent Entities producer that generates ready-to-use SQL Azure code from your CodeFluent Entities model. Furthermore, you can also choose to store your Binary Large Objects (BLOBS) in your database or in your Windows Azure Blob Storage account: it’s all up to you!

We successfully passed today the test on the Microsoft Platform Ready website in order to certify the generated SQL Azure code. I am happy to share this nice Powered by Windows Azure logo Smile:




This latest test gives to CodeFluent Entities its 3rd Microsoft Platform Ready certification after Windows 7 and Microsoft SQL Server.

Don’t hesitate to download CodeFluent Entities right now and enjoy Microsoft SQL Azure!