Monday, January 24, 2011

Migration to Azure - Part2 -real Work, some thoughts

Here comes the the problems you are goign to face in Azure [if you are
conventoanl programmer]

  1.  Authentication especially if it is active directory
    based. As the netowrk is internet
  2.  DB connetion which is simple string pointing to Sql Azure
    DB, the User name will be, 'username @DBName'. For eaxample
    connection string in my case was  "server=tcp:xyz.database.windows.net;Database=PTS;User
    ID=userName@xyz;Password=<anypwd>;Trusted_Connection=False;Encrypt=True;
    ".
    The question here is why do we need SQL azure when Windows azure is proving
    tables - SQL Azure is providing RDBMS whereas Windows azure is not.
  3.  Session and Application variable :) Application variable
    as avaiable as it is, as this is application based. where is sessions are not
    availabe OOB, they need some extra effort. Reason being if number of sessions
    are increased due ot scalibility you will never know from where it is being
    excuted. so the answer is to use SQL based session.

DB Connection is very basic and easilyt avaiable. for session you need to find
some alternate or user SQl based session. Below I am posting very basic
Helloword with ADFS authentication.

Below are the minimum items needed -

  1. One certificate which is uploaded on Windows Azure as well. .pfx file
  2. Location for ADFS2.0 server as this will provide your claims.
  3. Adding relying party on ADFS2.0 server, which means telling ADFS server "the
    request will come form this site, and provide claims for it"
  4. Within Application following changes are needed -
  5. Changes in Application_OnStart [Adding two events associated to Authentication]
  6. Adding Certificate [the same must be uploaded on azure]
  7. Adding ADFS server location reference, running FedUtil tool.

Next Post - Post3 Minimum Hello world with ADFS integration>

 

MIgration to Azure - Part 1

Hi All,
I got chance to work on Azure very recently, and the work of course was related to migration. Keeping it short I will try to explain the problems and challenges I faced in this process –


Getting Startup, reading material and understanding –

• VS 2010 gives option for creating cloud app. Two things to mention for new bee –

• Worker role and Web Role [Web role is nothing but your asp.net application]

• The Azure project has webrole.cs which is responsible for executing the application.

• Start keeping break points from application_Start [that will give clear understanding of flow]

After first Hello world and understanding the flow, now comes how migration should go , most common scenario is to have SQl Azure as well [a separate license]

Open http://windows.azure.com, click SQL Azure create your DB with help of script. There are no wizards till now.

• Once DB created, it is better to create simple application to access database programmatically. Few things here –

• To Access DB programmatically in your SQL Azure DB, click the Tab “Firewall Settings” and add Ip of your computer, so Azure will bypass that.

Also install Microsoft Firewall Client [I do not know exactly why this is needed but this happened in my case]

I am not providing any code snippet for the same as material is very easily and widely available on net.

Now it is time for real work  Post-2

Wednesday, October 27, 2010

ExcelService - RangeCoordinate

small discription about range coordinat, cause I was pretty confused while using it, so sharing my exp
RangeCoordinates rngCrd = new RangeCoordinates();


rngCrd.Row = 0;


rngCrd.Column = 0;

rngCrd.Height = 3;

rngCrd.Width = 10;
 
.Row = start Row
.Column = start column
.Height = no of rows. in this case total three rows.
.Width = no of columns, total ten columns.
 
So the above line mean, range starting from 0th row,0th column and ending at 10th column of 3rd row.
 
Happy coding

Tuesday, October 26, 2010

ExcelService, You donot have permission to open this file

Hi All,

I was getting this error from 3-4 days, and it was becoming frustrating, since the error is resolved I want to share my experience with all of you. The error from ULS log is-
1.       From ULS log the error is -            w3wp.exe (0x1EC0)                       0x21B4  SharePoint Server                           Logging Correlation Data               xmnv     Medium               Result=Id=OpenWorkbookAccessDenied; Microsoft.Office.Excel.Server.CalculationServer.FileOpenException: You do not have permissions to open this file. ---> Microsoft.Office.Excel.Server.Host.HostFileException     at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.GetSPFile(IClaimsIdentity claimsIdentity)     at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.CheckForPermissions(IClaimsIdentity claimsIdentity)     at Microsoft.Office.Excel.Server.MossHost.MossHostHelperMethods.<>c__DisplayClass4.b__2()     at Microsoft.Office.Excel.Server.MossHost.MossHostHelperMethods.WithEnsureClaimsIdentitySetOnThread(IClaimsIdentity claimsIdentity, MethodToRun action)
  • In my case ClaimsToWindows was set correctly,
  • file  was under trusted file location
  • App Pool account was added as owner in comtentDB
So nothing was helping me. Lastly I run the configwizard, which ended up in running farm config wizard (I did farm config earlier, noting helped). I cross varified web.config and what helped is -

IIS authentication settings :) The site and sharePoint web services both should run with "Windows Authentication" and it was resolved.
Some times we miss very simple point and that hurts badly :)

Keep programmig...