• MEA Services upcoming events schedule

    I am very happy to announce that we have started an initiative to present and share MEA services experience more with the public community. As a starting point we have prepared a list of upcoming webcasts that you can attend to gain more in-depth information about Microsoft products and technologies. Learn how Microsoft services team use Microsoft products and get the most out of it.

    Please find below the list of events and registration URLs, enjoy.

    Event Title

    Event Date

    Event Start Time

    Presenter

    Registration Links

    HA & DR with SQL Server AlwaysOn Availability Groups

    1/08/2014

    11:00:00 AM (GMT+2)

    Turgay Sahtiyan
    (SENIOR PREMIER FIELD ENGINEER)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145784

    Top Ten Performance Tips for SQL Server Developers

    2/19/2014

    11:00:00 AM (GMT+2)

    Turgay Sahtiyan
    (SENIOR PREMIER FIELD ENGINEER)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145785

    SQL Server AlwaysOn Availability Groups Deep Dive

    3/19/2014

    11:00:00 AM (GMT+2)

    Turgay Sahtiyan
    (SENIOR PREMIER FIELD ENGINEER)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145786

    What is new in Hadoop 2.0 and Yarn

    1/06/2014

    2:00:00 PM (GMT+2)

    Ahmed Abd Allah
    (SENIOR  CONSULTANT)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145787

    Big Data Reference Architecture

    2/06/2014

    2:00:00 PM (GMT+2)

    Ahmed Abd Allah
    (SENIOR CONSULTANT)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145788

    Journey in the life of the Data Scientist

    3/12/2014

    2:00:00 PM (GMT+2)

    Ahmed Abd Allah
    (SENIOR CONSULTANT)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145789

    BizTalk Server Roadmap & What’s new in BizTalk Server 2013

    1/12/2014

    2:00:00 PM (GMT+2)

    Mohamed Malek
    (Principal Consultant)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145790

    BizTalk Rules Engine Concepts

    2/16/2014

    2:00:00 PM (GMT+2)

    Mohamed Malek
    (Principal Consultant)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145791

    Writing Custom BizTalk WCF LOB Adapter Deep Dive

    3/09/2014

    2:00:00 PM (GMT+2)

    Mohamed Malek
    (Principal Consultant)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145792

    SQL Server Consolidation Strategies & Practices

    2/18/2014

    2:00:00 PM (GMT+2)

    Ahmad Shahin
    (CONSULTANT)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145793

    SharePoint & DR Scenarios

    3/25/2014

    2:00:00 PM (GMT+2)

    Ahmad Shahin
    (CONSULTANT)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145794

    SQL Server Database Migration

    1/14/2014

    2:00:00 PM (GMT+2)

    Ahmad Shahin
    (CONSULTANT)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145795

    SQL Server AlwaysOn with Log Shipping Implementation, Experience from the Field

    1/14/2014

    11:00:00 AM (GMT+2)

    Situmalli Chandra Mohan
    (SENIOR PREMIER FIELD ENGINEER)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145796

    SQL Server Performance Troubleshooting – Which tools can be used for troubleshooting?

    1/26/2014

    11:00:00 AM (GMT+2)

    Batuhan Yildiz
    (SENIOR PREMIER FIELD ENGINEER)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145797

    SQL Server Internals – Wait Types

    3/23/2014

    11:00:00 AM (GMT+2)

    Batuhan Yildiz
    (SENIOR PREMIER FIELD ENGINEER)

    http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200355666&CR_EAC=300145798

  • Using an IIS hosted MEX endpoint with an in-process WCF receive location in BizTalk Server

    Introduction

    Receiving messages and requests using WCF endpoints and receive locations is a very well-known practice that is used in many BizTalk integration projects. These WCF services can be either a published orchestration or using specific input and output schemas. In any of these there are two known messaging patterns that can be used either in-process or isolated. In-process means that the BizTalk server host instance will be responsible for hosting the WCF host and any requests will be directly received by the BizTalk host. Isolated model means that the WCF service host will be hosted inside IIS and a request received by this service will then be processed inside IIS W3WP worker process and once it requires persistence it will be submitted to the BizTalk Message Box database for normal publish and subscribe processing to occur. In this case this request can be picked up by any of the BizTalk processing host instances and hence will traverse the processes boundaries. In this post I will not go any further in describing these two models but I want to concentrate on a specific problem I faced.

    So imagine the following scenario, you want to implement an in-process WCF receive service but you want the MEX endpoint to be published on IIS so you want the consumer of this service to be able to submit specific requests and expect specific responses rather than submitting and receiving Message objects. This can be done easily if you want to host the processing or receiving endpoint inside IIS, so working in isolated mode. But unfortunately this is not supported for in-process. Usually we do this by using the WCF publishing wizard and publish a metadata exchange endpoint only to IIS and point to the receive location required to process the request which is usually hosted inside IIS (isolated). Now if you select an in-process receive location it will publish the endpoint as usual and you will be able to create the MEX WCF service on IIS but when you try to use it you will receive the following error.

    clip_image002

    This is normal and expected as the in-process receive location have to be specified using an absolute URL rather than a relative one as you usually would configure an isolated one. Since the URL is absolute the MEX host will try to add it as a new base address. Now the problem is that this address is not supported by IIS. Now if you try to configure the service using the suggested configuration in this error this will not work in any way.

    Solution

    Usually this is not a supported configuration and hence there is no out of the box method to get this to work. Now I wanted this configuration to work so I started reflecting the BizTalk assemblies to figure out the problem.

    Now if you open the MEX endpoint service SVC file you will find the following in it.

    <%@ ServiceHost Language="c#" Factory="Microsoft.BizTalk.Adapter.Wcf.Metadata.MexServiceHostFactory, Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

    So as you can see here it is using a custom host factory to create the WCF service host. This custom host factory is inside an assembly called “Microsoft.BizTalk.Adapter.Wcf.Runtime” that is hosted in the GAC. So I reflected this assembly to see what is happening there and here is what I found inside the CreateServiceHost.

    clip_image003

    So as expected, it adds the URL to the list of base addresses if the address of the receive location is in absolute URL format. Now this is correct and needed if the processing endpoint is hosted inside the IIS but since this is hosted inside BizTalk worker process this is not needed and hence we would not need such a line.

    So what I ended up doing is to create new service host factory. I started by thinking of inheriting from the already existing host factory, well you guessed it, this class is sealedL. That leaved me with the only other option which is to create a new class with exactly the same code (reflected) but with these lines removed. So the CreateServiceHost function is now as follows:

    public override ServiceHostBase CreateServiceHost(string constructorString, Uri[] baseAddresses)

    {

       BizTalkConfigurationSection bizTalkConfigurationSection = MexServiceHostFactory.GetBizTalkConfigurationSection();

       if (bizTalkConfigurationSection.MexServiceHostFactoryConfiguration.Debug)

       {

            System.Diagnostics.Debugger.Launch();

       }

       if (baseAddresses == null)

       {

            throw new ArgumentNullException("baseAddresses");

       }

       TraceParameters(constructorString, baseAddresses);

       TraceHostingEnvironment();

       Uri uri = baseAddresses[0];

       string receiveLocationName = null;

       Uri publicBaseAddress = null;

       ReceiveLocationMappingCollection receiveLocationMappings = bizTalkConfigurationSection.MexServiceHostFactoryConfiguration.ReceiveLocationMappings;

       if (receiveLocationMappings != null)

       {

            string strService = uri.Segments[uri.Segments.Length - 1];

            string strChannel = uri.Segments[uri.Segments.Length - 2];

            ReceiveLocationMapping mapping = receiveLocationMappings[strChannel.ToLower() + strService.ToLower()];

            if (mapping == null)

            {

                throw new ApplicationException(string.Format("ReceiveLocationMappingNotFound for Service {0} and Channel {1}.", strService, strChannel));

            }

            receiveLocationName = mapping.ReceiveLocationName;

            publicBaseAddress = mapping.PublicBaseAddress;

       }

       ReceiveLocationProxy proxy = !string.IsNullOrEmpty(receiveLocationName) ? ConfigurationInfo.GetReceiveLocation(receiveLocationName) : null;

       if (proxy == null)

       {

            throw new ApplicationException(string.Format("ReceiveLocationForMetadataNotFound {0}", new object[] { receiveLocationName }));

       }

       RLConfig rlConfig = proxy.CreateRLConfig();

       OperationFlow operationFlow = !string.IsNullOrEmpty(proxy.ReceivePortName) ? ConfigurationInfo.GetReceivePortOperationFlow(proxy.ReceivePortName) : OperationFlow.None;

       List<Uri> list = new List<Uri>(baseAddresses);

       /*if (Uri.IsWellFormedUriString(proxy.Address, UriKind.Absolute))

       {

            Uri item = new Uri(proxy.Address);

            list.Add(item);

       }*/

       Type BizTalkServiceInstanceType = typeof(ReceiveLocationMappingCollection).Assembly.GetType("Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance");

       object BizTalkServiceInstance = Activator.CreateInstance(BizTalkServiceInstanceType);

       Type MexServiceHostType = typeof(ReceiveLocationMappingCollection).Assembly.GetType("Microsoft.BizTalk.Adapter.Wcf.Metadata.MexServiceHost");

       return (ServiceHost)Activator.CreateInstance(MexServiceHostType, new object[] { operationFlow, rlConfig, publicBaseAddress, BizTalkServiceInstance, list.ToArray() });

    }

    And as you can see I have commented out the lines to add the receive location URL as a base address. Of course I needed to reflect more classes as they were also sealed and private (or internal) so I could not get my new host factory to compile. I could have used reflection to create objects of these classes but I thought it would be simpler to simply reflect them and add them to the project. These classes were:

    ·        ConfigurationInfo

    ·        ReceiveLocationProxy

    Now the last thing I need to do is to change the SVC file of the MEX endpoint service to use the new host factory instead of the out of the box one as follows:

    <%@ ServiceHost Language="c#" Factory="<Your namespace here>.MexServiceHostFactory,< your assembly name here>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<your assembly token here>" %>

    Now GAC the DLL and reset IIS (or recycle the app pool) and vola now it is working and you can submit messages to the in-process receive location using a MEX endpoint hosted inside IIS.

    clip_image005

     

    Happy BizTalking.

  • What to Consider When Creating SQL Server Database Migration Plan?

    Introduction

    SQL Server Migration is the process of stirring a previous implementation of SQL Server to a newer version, different location (or both) due to  a strategic decision (such as SQL Server Consolidation). In this post I’m trying to highlight some of the important aspects that we need to consider Before, During & After having an SQL Server Migration. This post is intended to be a general guidance to help you create a migration plan. Additional useful references are provided at the end of this post to give you more details.

    Migration Paths

    The first thing that we need to consider when having a migration is to define the Migration Path. To define a proper Migration Path we need to specify the following:

    • Data Source: To understand the SQL Server Version and Capabilities of the current SQL Implementation (such SQL Server 2000, 2005 or Enterprise, Standard or 32bit, 64bit or SP1,SP2 … etc.)
    • Data Destination: Is the intended SQL Server Version that you would like to reach (ex: SQL Server 2012 Enterprise)
    • Supported Path: Are the steps and actions needed to your destination. The below example show the possible supported path to reach SQL Server 2012:

    SQL Server 2005, 2008 & 2008 R2 can directly migrate to SQL 2012 after achieving the below Service Packs:

    • SQL Server 2005: SP4.
    • SQL Server 2008: SP2.
    • SQL Server 2008 R2: SP1

    However SQL Server 2000 needs to be upgraded to SQL 2005 (or later) before reaching SQL Server 2012, below Service Packs must be installed:

    • SQL Server 2000: SP4 is required.

    Migration Strategy

    After defining the Migration Path you need to define the Migration Strategy. Below are some details of the Migration Strategies supported by Microsoft SQL Server:

    • In-place: Using the SQL Server Setup program to directly upgrade an instance of SQL Server 2000, 2005, 2008 to SQL Server 2012. The older instance of SQL Server is replaced.
    • Side-by-side: Using steps to move all or some data from an instance of SQL Server (2000,2005, 2008) to a separate instance of SQL Server 2012. There are two main variations of the side-by-side upgrade strategy:
    • One Server: The new instance exists on the same server as the target instance.
    • Two Servers: The new instance exists on a different server than the target instance.

    Migration Methods

    So after defining the Path & Strategy the next logical question that comes in mind is how to do the migration, and its exactly what we mean by Migration Methods. Below are some methods that we can used to Migration the SQL Server Database (for clarification purpose):

    • Backup/Restore
    • Detach/Attach
    • Manual schema rebuild and data export/import
    • Log shipping
    • Copy Database Wizard

    Note:

    You also need to consider other SQL Server Components (such as SQL Server Reporting Services, SQL Server Analysis Service & SQL Server Integration Services) which falls outside the scope of this post.

    Application Supportability & Reconfiguration

    Most of the time SQL Server Database uses and Application that handles the database in the backend (such as SharePoint, Exchange, Custom Developed Application … etc.), so we need to answer the following questions before proceeding with the migration:

    • Does the Application Supports the new SQL Server Version (such as SQL Server 2012)?
    • What are the reconfiguration needed from the application vendor to reactivate the application (such as connection strings, custom code … etc.)?

    Migration Backups

    Before preceding with the migration we need to plan properly for database backups. We need to perform a full backup of each database in an instance (including system databases) at the following points in the upgrade process:

    • Make a backup of the user databases and data after all users are out of the system and before the upgrade process has begun. Back up all system databases at this point. Make sure that the media is intact so that you can restore the backups if necessary.
    • When the upgrade is complete, but before you do any configurations or changes, perform backups under SQL Server 2012. This lets you easily roll back to a point where the SQL Server 2005/2008/2008 R2 upgrade completed successfully but where an error was introduced after that point.

      VLDBs

      Many SQL Server databases are in the hundreds of gigabytes or terabytes range. This presents special challenges in any upgrade process because you have to account for constraints in time and hard disk space when you deal with large amounts of data in a short window of maintenance time. Databases in the terabyte range can potentially take days to copy over a network—even the fastest networks. These VLDBs might be mission-critical databases powering the largest systems in your business and might tolerate very little downtime. When an upgrade has to occur over a weekend, you might have to use several techniques and put in many preparation hours to meet the required time frames for success. You might have to revise the upgrade window if the upgrade will not fit within it.

      Pre-Migration Tasks

      Below are some operational tasks that needs to be considered in your plan before starting the migration:

      • Rollup All Needed Service Packs, Updates & Hotfixes.
      • Run DBCC CHECKDB on all databases to make sure that they are in a consistent state.
      • Verify Backup of  All System & User Databases
      • Run the Upgrade Advisory Tool

      Post-Migration Tasks

      After the completion of the migration, the below steps are required:

      • Integrate the new SQL Server Instances & DBs into the application and database server environment.
      • Determine whether the upgrade was successful (Agree on a success criteria with the application original vendor).
      • Decommission and Uninstall the unused servers

      Additional References:

      Below are some useful references that provides more information about the items mentioned in the above post:

    • Integrating Apache ActiveMQ with BizTalk Server 2013 using WCF-WebHTTP adapter and REST API

      Introduction

      In this blog post I will present a very simple solution to integrate with Apache ActiveMQ platform. Actually I got this question from a friend I could not believe how easy it is to integrate with this platform using the new BizTalk 2013 WCF-WebHTTP adapter. The adapter provides many features out of the box that really makes the integration engineer life much easier and better.

      In this scenario I have installed Apache ActiveMQ on a private VM, created a test queue and made sure that I am able actually to send messages to that test queue. The target then was to create a way to receive messages from this queue to BizTalk server.

      Discussion

      The following procedure is what I did to perform this POC.

      1-     First I started by installing ActiveMQ and to my surprise that was super easy. So I downloaded the binaries from here and I also downloaded the JDK from here. I installed the JDK then extracted the ActiveMQ to any folder of my choice.

      2-     I then had to set the JAVA_HOME environment variable (I do not know why the JDK setup did not do this) but I did that manually to point to the JDK folder as C:\Program Files\Java\jdk1.7.0_45

      3-     I then started the ActiveMQ platform by browsing to the folder where I extracted it and then typing the command:

      bin\activemq

      4-     Then I opened the new administration portal using the URL (http://localhost:8161/hawtio) then I logged in using the username admin and password admin.

      5-     Clicked on “ActiveMQ”
      clip_image001

      6-     Then I created a new Queue called “Testing” by clicking “Create” then “Create Queue”
      clip_image002

      7-     Click on the queue on the left then click “Send” then make sure you change the format to XML type in a valid XML message and finally send the message.
      image

      8-     If you now go to the browse of the queue you will find that the message is ready for pickup as per below:
      clip_image005

      9-     Now the ActiveMQ supports the REST API to be able to pick up messages (or post them) the address is as follows (http://localhost:8161/api/message/Testing?type=queue&clientId=BTSconsumer). So note this address as we will use it later in BizTalk.

      10-  Now let’s go to the BizTalk administration console. I created a new send port to be able to pick up messages from the Queue using the WCF-WebHTTP adapter. So I created a new send port and configured it as follows:
      clip_image006

      11-  Then click configure and change the address and operation as follows:
      clip_image007

      12-  One key point here (and a new feature that I really like about this new adapter) is that if you are using the HTTP GET operation then you cannot sent anything in the BODY of the HTTP request. But BizTalk out of the box have to send a message so the adapter solved this by adding a key feature called suppress outbound messages body for verbs GET, so you need to configure this as below:
      clip_image008

      13-  Now I need a way to issue a GET verb using this send port. So usually what you would configure is a scheduled task adapter to schedule checking of messages from the queue. In my case I wanted something simple and without installing anything else on the VM. So I configure a messaging approach to issue a GET verb after I send an empty file through a file receive location and then created another file send port to pick up the final message received form the Queue and write it to a folder.

      14-  Started everything and BINGO worked like a charm J I have sent the message to the queue and then I drop the empty file to the input folder to issue a GET verb and finally the sent message is written to the output folder as follows:

      <Sample>Input again!!</Sample>

      Conclusion

      The conclusion here is that REST is very powerful and makes you do amazing things. I really think everything should support REST and the other very important conclusion is that I need to thank the BizTalk product group to support this out of the box in BizTalk Server 2013 J

    • Recommended Practices - Service bus for Windows server

      introduction

      In my prior post, I have listed some of the APIs that you can use for developing applications where PubSub pattern fits well. In this one, I will give talk little bit more in detail about one of which is Service bus for Windows server and then share some practical guidance.

      Body

      We are living an era of connected applications. And service bus for Windows server is one of the API/platform you can use to connect applications that may be dispersed and hosted on different platforms (Windows, Linux) in a one/way or bi-directional fashion. It is very like Windows Azure service bus, but differs as being hosted on your own data center.

      image

      Figure #1: The service bus for Windows server platform stack

      Service bus services that runs on each ring node:

      o Windows Fabric: Core clustering technology that manages a “ring” of nodes in the farm.

      o Service Bus Message Broker: Manages the send and receive operations from Service Bus queues, topics and subscriptions.

      o Service Bus Gateway: Serves as protocol head for supported Service Bus protocols. The gateway also performs security validation on incoming requests.

      o Service Bus Resource Provider: Handles management requests from the Windows Azure Pack portal.

      o Service Bus VSS Writer: Discovers and automates backup and restore operations using Microsoft Volume Shadow Copy Service (VSS) technology.

      Recommendations:

      • Make sure it is highly available (HA): HA can be fully satisfied only when both service and database layers are HA. Service layer HA can be accomplished by having at least 3 servers in the ring. In regards to database HA, there are different ways of doing that depending on your case (db version, disaster-recovery plan, etc.) You can check my blog posts about single site failover clustering here  for SQL 2012 Server.  Please note that Service bus v1.1 supports up-to 5 servers in the ring
      • Make sure it is scalable: You need minimum 2n message containers where n is the number of servers of the service bus farm ring. So, HA and scalable service bus implementation requires 3 servers and 6 message containers (database instances) at least.    
      • Security considerations:
        • Client applications can access service bus for Windows server resources only after a successful authentication which is through either a Shared Access Server (SAS) or Active Directory (AD) windows credentials. Certificate used for message security and if auto-generated certificate option selected during the installation, it must be imported to all the clients. Otherwise, it will raise STS related exceptions.
      • Design considerations:
        • Service bus for Windows server is used for message brokerage. If relaying functionality required, then you may consider Windows Azure service bus instead. Here are a brief overview of both messaging methods (for more details, please visit here):
          • Relay: Both parties must be online, supports different approaches (one-way, bi-directional, etc.)
          • Message Brokerage: No parties need to be online, asynchronous communication, best suites for http type communications. Service bus queues, topics, and subscriptions are central pieces of message brokerage.
        • Evaluate topic with many subscribers vs. topic with less subscribers case and use of subscription filter rules.
        • Attention to service bus quotas defined here 
      • Performance considerations:
        • Please visit here listing best practices for performance improvements: Async calling and enabling client batching bring noticeable performance benefits.
        • Consider adding rules for subscriptions that filters messages accordingly. Visit here for details
        • Disable (or let it be default) the features of topic, subscription, queuing that are not required per your needs, such as Sort Ordering, Lock Duration, Require Session, Is Read Only, etc.
      • Debugging considerations:
        • Make sure all required service bus and database services are up running.
        • Make sure the client has the imported certificate (for STS)
        • Check firewall rules for ports used by the services
        • Attention to object null reference exception and API exceptions (sending message to a topic which has not have any subscription cause exception, or creating a topic that its path already in use (another topic), etc. 

      Conclusion

      Here, in this post, I have shared some of my learning from past experience. Hope it helps. As side note, as an alternative, you can play with Windows Azure service bus then plan & deploy the same functionality on your own environment if you will.

      References: