Migrate WCF to be hosted in Azure

On twitter I read this post:


Since I have a wordpress blog and like a challenge, here is the daily post in my Zero to Hero sequence.

What’s on your mind

cloud power
One of the reasons I started this blog was to share my (work) experience and give back to the internet. On my last project I migrated WCF services to be hosted in Windows Azure. With the right structure in place this was shockingly easy.

Layers

The services are designed with three layers:

  1. Service layer, implementation of the service contract,
  2. Business layer, checks the business rules,
  3. Data access layer, code to access the data (obvious)

Every layer is defined in an interface and contains a factory method to create the next layer. By making this factory method virtual the Azure implementation only needs to overwrite that and you’re done.

Table storage

The data in Azure will be stored in Table storage. To access it I need to write the TableServiceEntity. The data access layer will use that with an CloudTableClient and TableServiceContext. Now my service is Azure ready.

Design

Migrate WCF to Azure
In the design above you see the inheritance (horizontal) and the call hierarchy (vertical). Most of the work goes in the AzureDataAccess, because it does not inherit and all DataAccessContract implementation code must be written.

Also read my post about code generation for the design of the service.

About erictummers

Working in a DevOps team is the best thing that happened to me. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.