in

Community Blogs

Blogs of different SQL/Developers Community Members

This Blog

Syndication

DamirDobric

  • How to add the user to Windows Azure Sql Server?

     


    When working with SQL Server in Windows Azure you can create very quickly the database. But if you have a big distributed team usually you will not want to give everybody the access to DB.
    Unfortunately right now, there is no way to manage users in Management Portal or event to do that within SQL Management studio. At least not by using common UI. This post describes stepp by step how to create the user
    by using T-SQL within SQL Management Studio.

    Start SQM Management studio and connect with the admin user, which you will usually use in SQL Management Portal.
    Once you are connected to your Windows Azure Database, select the master database, right mouse click and select new query.

    image

    This will open the new query wit connection to master database. Note that you have to open the SQL editor with master database!
    Then type following in the query in the editor:

    CREATE LOGIN yourusername WITH password=’YourPwd123‘;

    This will create the new LOGIN in the master database.

    Now execute following statement in the same editor:

    CREATE USER yourusername FROM LOGIN yourusername ;

    This statement will create the user from specified login in the master database.


    After that we need the to select wanted database (as in previous step, but this time you will not select master database) and open the query window.
    In that window enter same script as in previous step:

    CREATE USER yourusername FROM LOGIN yourusername ;

    This statement will create the user from specified login in your database.

    At the end we need to append some roles to the user. They can be enlisted as follows: 
    image

    For example if you want to add it in the role of owners do following:

    EXEC sp_addrolemember 'db_owner', yourusername ;

    Now you can use use DB in the cloud. I know that last few steps are not very common task of every developer. I have tried to keep them simple. T-SQL can look much worse, believe me.
    An alternative to these steps was to setup completely new infrastructure which will publicly provide secure access to database. My steps have taken about 20 mins to provision and migrate one DB in the cloud.
    To do all that On-Prem will take much, much more time.

  • Integration Styles – University of Applied Sciences Frankfurt am Main

    Announcing Agenda for April 15. 2013. The focus of the session will be “Introduction in Integration Styles”.

    image

  • Distributed Systems and Service Patterns Session – University of Applied Sciences Frankfurt am Main

    Here is the recap of the session Distributed Systems and Service Patterns.

    image

  • SharePoint Workflows cannot be stopped in Workflow Manager?

    You might notice that (sometimes) workflows which running in endless-loop cannot be stopped. For example, imagine there is a workflow which is running in while(true) loop after is started.

    1. Issue 1:


    If you try to stop such workflow it will not be stopped for very long time (depending on system load, it can take hours). It seems that some messages used for stop operation are not treaded with high priority.

    2. Issue 2:


    Sometimes even if the workflow is stopped (it does not appear in instance table and workflow client api does not return it in running state) it will continue to run.
    I have activity which continues to trace out some data even if the workflow is stopped.

     

    WORKAROUND: The only possible work around in both cases is to remove the scope which holds that workflow.

    - Remove the scope from Scopes table of WFResourceManagementDb database.
    - Restart ServiceBus Gateway and Broker services
    - Create scope programmatically.
    - Publish workflow again.


    This will cause all running instances of the workflow to fail!!

  • Windows Azure Global Bootcamp

     

    We are glad to invite you to  Windows Azure Global Bootcamp. On April 27th, 2013, you’ll have the ability to join a Windows Azure Bootcamp on a location close to you. Recognized Experts and Microsoft Partners are organizing bootcamps over the globe to get in touch with newest innovations form software and cloud technology. Damir Dobric Microsoft Integration MVP and Windows Azure VTSP will be on stage for you with Sascha Dittmann Windows Azure MVP. DAENET has organized even more experts for you who are willing to help you to understand this amassing technology.
    image
    The bootcamp will be hold on many places across the world. In the same time the bootcamp will also be organized in Berlin and we will als be connected via Lync with folks in German’s capitol.

    For all of you who work in Germany but eventually still not speak German well, don’t worry all our team is English speaking too.

    On this day we will have many MVP-s and other local experts on site. You will have a unique opportunity to meet all of them at one place.

    For more information please contact our office: mailto:info@daenet.de
    image
    Location

    We are organizing the bootcamp in Microsoft office in Bad Homburg, which is just few km away from daenet’s office.

    REGISTRATION:

    http://www.eventbrite.de/event/5640886042#

    image                                                                                                        image

  • Agenda for MSNetwork Web vNext Session

    Here is the preliminary agenda for MSNetwork upcoming session next week.

    image 

    There are few important things which will unfortunately not be covered in this session.
    But if you really want to dive deeper behind Steaming and Push technologies, I would recommend you to read this post.
  • ExpressionTranslator Error when publishing Workflows

    When working with Workflows, which running in Workflow Manager (SP devs call it usually SharePoint Workflow) on-premises or in Office 365 you might get following error:

    Expression: DateTime.Now.ToString()

    "Property access conversion to an activity is not supported for property 'CurrentDomain' defined on type 'System.AppDomain'."

    This error occurs during Translation of the workflow. The translation is a step in process of publishing of the Workflow in Workflow Manager. it basically translates all expressions in Workflow Activities in a form
    required by XAML, before the workflow is published (installed) to the host.

    Following picture shows an expression which will cause described error:

    image

    The picture left below shows XAML expression which is translated in a bit different expression (picture right below). Note that DateTime.Now.ToString() is in this case not evaluated. It is a pure string like “BLA, BLA”.

       <Assign sap2010:WorkflowViewState.IdRef="Assign_1">
          <Assign.To>
            <OutArgument x:TypeArguments="x:String">
              <mca:CSharpReference 
                x:TypeArguments
    ="x:String">result</mca:CSharpReference>
            </OutArgument>
          </Assign.To>

          <Assign.Value>
            <InArgument
             x:TypeArguments="x:String">DateTime.Now.ToString()
            </InArgument>

          </Assign.Value>

        </Assign>

    image

     

    Right now, it is not possible to access properties within Expressions. To make this working you will unfortunately have to define the type to access properties. For example, if you want to access MyCustomTye.MyProp you will have to create the activity like GetMyCustomPropActivity and define InArgument<MyCustomTye> and OutArgument<yourproptrustedtype>. The later one will hold the value of MyProp.
    This activity have to extend trusted surface (se URL below) even if the type is common .NET type like DateTime.

    How to create custom activities:

    http://developers.de/blogs/damir_dobric/archive/2012/09/16/workflow-trusted-surface.aspx

    http://msdn.microsoft.com/en-us/library/windowsazure/jj193517(v=azure.10).aspx

  • Welcome BizTalk Server 2013 RTM

    The new BizTalk Server has as usual many improvements, new adapters and it focuses now additionally the cloud model.  Cloud related strategy includes Infrastructure as a Service (IaaS) capabilities as well as Platform as a Service (PaaS) capabilities. To get a good feeling about IaaS offering for Biztalk take a look on Saravana’s post. Second cloud related offering targets the general Cloud-Connectivity within BizTalk Server. Basically this means new out-of-the box adapter to send and receive messages from Windows Azure Service Bus. This enables hybrid solutions in a  “Make Easy” manner. If you want to try this, take a look on Paulo’s sample.
    RESTful services support is another BizTalk Server 2013 feature. Now, there is a REST capable adapter. Enhanced SharePoint adapter can behave as a client-side or a server-side object model to interface with a SharePoint.

    For more information take a look on summary of the BETA version and BizTalk Team Blog announcements.

    Be aware there are also licensing changes. BizTalk is moving to a per-core licensing model to keep BizTalk consistent with our SQL Server licensing.

    Last but not least the logo is now in vector format :)

    BizTalk-Server-2013

     

    Not sure if you already  know, but this is the eight release of BizTalk Server.

  • Why SignalR does not use WebSockets Part II?

    If you notice that signalR does not use websockets you might first take a look on this post. But if this does not help there is also seething you have to be aware of. That means depending on how you have created the solution it might happen that websockets will be be used as a default transport.

    If you create your solution like this the websockets will be downgraded (not used):

    1. Create new project like MVC4, empty web or any other.

    2. Add Nuget Reference to SignalR

    3. Change the project to 4.5 (within project properties)

    4. Set httpRuntime to 4.5

     

    Now create solution like describe below:

    1. Create new project like MVC4, empty web or any other.

    2. Change the project to 4.5 (within project properties)

    3. Add Nuget Reference to SignalR

    4. Set httpRuntime to 4.5

    Note, the order of steps 2 and 3 is changed. If you do it this way and you did already this, websockets will be used as expected.

  • Why does ~/signalr/hubs return 404 ?

    When working with SignalR hubs probably your first experience will be HTTP Error File not found (snapshot from Fiddler).

    image

    This happen when java script reference tries to download dynamically created hub.js file which helps you to easily deal with hub proxies. This is something similar to WCF dynamically created proxies in a case of AJAX. SignalR is very easy to use. However somehow I never started the project without running in this issue. :)

    First of all you have to make sure that this file is generated at all. To generate this file you have to append following line in Application_Start.

    protected void Application_Start()
    {
        RouteTable.Routes.MapHubs();
    }

    This instructs SignalR runtime to prepare this file. However, exactly on this place there are few things you have to be aware of. If you are working ASP.NET MVC and Co. the Application_Start might look like:

          protected void Application_Start(){

                AreaRegistration.RegisterAllAreas();

                WebApiConfig.Register(GlobalConfiguration.Configuration);        

                FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);          

                RouteConfig.RegisterRoutes(RouteTable.Routes);

     

                BundleConfig.RegisterBundles(BundleTable.Bundles);

     

                RouteTable.Routes.MapHubs();      // Here is HUB initialization    
            }

    If you start this the client you will be surprised, but HUB file will not be found. This is because the hub must be initialized before registration of routes.
    Following code shows the right registration order.

    protected void Application_Start(){

                AreaRegistration.RegisterAllAreas();

                WebApiConfig.Register(GlobalConfiguration.Configuration);        

                FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);   

                RouteTable.Routes.MapHubs();  // Here is HUB initialization           

                RouteConfig.RegisterRoutes(RouteTable.Routes);  // HUB initialization must be before route initialization!!!

                BundleConfig.RegisterBundles(BundleTable.Bundles);           
            }

     

    Start now the client and be happy.

    image

    Note that the same issue can be caused be invalid script reference. Following snippets show how to create valid reference:


    ASP.NET MVC 4:

          <script src="~/signalr/hubs"></script>

    ASP.NET MVC 3 :

        <script src="@Url.Content("~/signalr/hubs")"></script>

    ASP.NET page:

        <script src='<%: ResolveClientUrl("~/signalr/hubs") %>'></script>

  • How to get client config data from ServiceBus Server?

    When working with Service Bus MessagingFactory the easiest way to setup the SB-API is to use connection string. In a case of Service Bus in Windows Azure, the connections string can be obtained directly from management portal:

    image

    However when working with Service Bus for Windows Server you will have to use PowerShell to obtain the string.

    Open power shell and navigate to folder (if not already there):

    C:\Program Files\Service Bus\1.0

    Then execute command let: get-sbclientconfiguration

    .. and you will get the connection strings:

     

    Endpoint=sb://NODE12.DAENET.SB/WorkflowDefaultNamespace;StsEndpoint=https://NODE12.DAENET.SB:9355/WorkflowDefaultNamespace;
    RuntimePort=9354;ManagementPort=9355Endpoint=sb://NODE12.DAENET.LAN/mysbnamespace;
    StsEndpoint=https://NODE12.DAENET.LAN:9355/mysbnamespace;RuntimePort=9354;ManagementPort=9355

     

    As you see above, the retrieved config data contains two connection strings; one for each namespace.

    Posted ožu 07 2013, 06:07 by anonymous
    Filed under:
  • Announcing German Windows Azure Global BOOTCAMP at April 27th 2013

    With this post I’m proud to unofficially announce the Windows Azure Global BOOTCAMP at April 27th. Sascha Dittmann (Windows Azure MVP) and me (Integration MVP and Windows Azure VTSP) will setup the bootcamp in Frankfurt area. The event is supported and powered by daenet and Microsoft Germany. The official and final agenda is still in execution, but the storyboard defined last week in Redmond looks like :

    -    Intro (30 Min)

    o   Windows Azure Platform Overview

    o   Hosting Centers

     

    -    Leverage Compute Capabilities

    o   Web Sites (15 Min Intro/Demo + 30 Min Hands On Lab)

    §  Create Hello World Web Application

    §  Publish your application

    §  Publish from gallery

    o   Web/Worker Roles (30 Min Intro/Demo + 60 Min Hands On Lab)

    §  Compute + Storage Emulator

    §  Create Web Worker Application (Hello World)

    §  Configuration

    §  Tracing and Debugging

    o   Execute global across planet over hundreds machines (15 Min for start – collect results at the end)

    -    Leverage Storage

    o   Blob Storage (Page+Block) (15 Min Intro/Demo +30 Min Hands on Lab)

    o   SQL Azure (15 Min Intro/Demo +30 Min Hands on Lab)

    -    VM Roles (10 Min Intro / Demo -20 Min Hands on Lab)

    o   Create VM from Gallery

    -    Middleware/Integration (45 Intro/Demo – due the complexity of integration scenarios we will not do HandsOnLab. If you are interested on this topic please contact me.)

    o   Service Bus

    o   Distributed Cache

    o   Access Control Service

    image

     

    For more information please follow:

    Sascha’s blog: http://www.sascha-dittmann.de/

    My blog : http://developers.de/blogs/damir_dobric/default.aspx and twitter: https://twitter.com/ddobric

    Location: Microsoft Office in Bad Homburg.

  • Cumulative Updates for Workflow Manager, Service Bus (SharePoint 2013 – Workflow Engine)

    The first Cumulative Update for Workflow Manager and Service Bus or formally known SharePoint workflow is online. which actually includes Suspend/Resume of instances support. (It will also be available via WebPI soon).

    WF Manager:

    KB article (KB2799754): here

    Download page: here

     

    Service Bus:

    KB article (KB2799752): here

    Download page: here

     

    Windows

  • Prepare Development Machine for Workflow Manager

    If you want to develop workflows for Workflow Manager, you do not have to necessarily install the full Service Bus and Workflow Manager server on development box. You can do this, but it is not required. To prepare you box go to this official download page: http://www.microsoft.com/en-us/download/details.aspx?id=35375 and download Client and Tools packages described below:

    Workflow Client package:

    Core Assemblies and API for Workflow Manager client applications including associated components Visual Studio 2012 tools.
    Note that after installing of this package, no full VS support is installed. That means you will not have activity designer in VS toolbox.


    Workflow Manager Tools for Visual Studio 2012
    Provides the Visual Studio activity designers including SharePoint support, debugging and expression translation for Workflow Manager.


    At the and following might be necessary too: http://developers.de/blogs/damir_dobric/archive/2012/12/13/how-to-export-servicebus-certificates-to-client-machines.aspx

  • Migrating form .NET 4.0 to .NET 4.5, WebApi, NuGet and Co.

    Few months ago I tought, I finally survived transition of ASP.NET, WebApi and Co. form VS20010 to VS2012. This was a hard time. Imaging migration of 50 projects in one solution by referencing various version of System.Net.Http, NuGet etc., etc.
    This post should archive a few workarounds which might help.

    One night mares is error: “Cannot load assembly System.Net.Http …”.

    Depending on your current assembly stage (set of referenced assemblies) this error might be caused by various reasons. First this assembly was gaced, then after NuGet has come, Microsoft decided to remove it from GAC and name it by version 2.0.0.0. At the end this assembly is in version 1.0.0.0 which has been rolled out with VS2012, .NET 4.5 and actual NuGet Asp.Net NuGet packages which have been delivered at that time.

    If you have this problem, unload your web project and go to edit. Depending on how your project has been created you might find in the project file something like this:

    <Reference Include="System.Net.Http />

    This referenced assembly is of version 2.0.0.0. You will se that after build process in your bin folder. If you don’t see it in the bin folder it means that the project is pretty old one and expects the Net.Http in GAC.

    You should first reference ASP.NET WebApi. The NuGet will do almost everything for you. Everything is meant in term of time which you need to do it by yourself. The only problem with NuGet is that it will not do everything for you and it will let crap of solution. NuGet will ne replace existing references of the same assembly. That means that result of build is 100% fail in such cases. So, if you have assembly A1 already referenced by using some old solution without NuGet and if you add reference to the same assembly by NuGet, the reference will not be replaced in the project file.
    Imagine now what happen if you have A1 and NuGet brings you new version of same assembly A1 which now depends on two more assemblies A2 and A3.
    As result of adding NuGet reference the project will keep old reference to A1 and add new references to A2 and A3. This will never ever work.
    Please feel for a moment the pain of solutions which consist of 50+ such projects.
    To workaround this problem by using example of my favorite Net.Http.Dll you will have to do following:

    <Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">

          <HintPath>..\..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll</HintPath>

        </Reference>

        <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

          <HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>

        </Reference>

        <Reference Include="System.Net.Http.WebRequest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">

          <HintPath>..\..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll</HintPath>

        </Reference>

     

    You project will probably already contain references to Net.Http or even Formatting, etc. assemblies. Please remove these references, because they caused the pain. 
    And please don’t be confused with following. The referenced version of Net.Http is 2.0.20710.

      <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net40" />

    But the file and product versions are 1.0.0.0:

    image

    Finally, you don’t have to take this seriously. Open it in Reflector and watch. It is 2.0.0.0.

    image

    Hope this helps a bit.
    PS: I remember System Journal articles from 90-tenths, which tried to explain DLL-Hell. Hmmm.

    This articles is related to ASP.NET, IIS, SharePoint and Workflow Host Manager technologies. (at lest).

More Posts Next page »
Copyright of SQL/Developers Community
Powered by Community Server (Commercial Edition), by Telligent Systems