api, aws

Lately i was working with micro service and leveraging AWS to crete a serverless infrastucture. To achieve this i was using aws lambda as the service host with aws api gateway as the entry point. However i ran into a strage problem. I had to update my IAM policy for a lambda function, after doing that when i went back and tested the lambda function it worked fine. I was able to access the dynamodb and it worked. However when i tried to access it via API it failed. I got the following error

1
Execution failed due to configuration error: Invalid permissions on Lambda function

The error looks wiered because the Lambda did have access. I played around with access, but couldnt find anything. Eventually i came across this video. Apprently all i had to is goto to Integration Requst and edit the lamda function and just resave it. When we save it back, it prompts saying lambda will be given permission and that solved the issue.

Bloggin after a long time. Its been a while. Busy helping out a friends startup, and doing some mobile developement. Mobile is getting big even in my work life, where we have decided to go ahead with Xamarin. But MDM is still up in the air, so the Mac on my work is gathering dust right now, as no Xamarin iOS developement is going on. Anwyays, for this starup i have been using Ionic which is angularjs + cordova. Its a good mix. As long as you try to stick with basic developement it works great. But if you try to get native feature it works, but i have few complaines about anrdoid version compatibility. So have been playing around with that a lot. When a got a email from M.D.Khan, about giving a talk about a topic i posted long time back about Home Automation using angularjs. I actually created a basic POC for angular conference, but it didnt get selected. Here is the link to the Meetup. Its already house full, which makes me nervous and puts more pressure.
In the near future i will be creating a few more tutorials around what i build and how its done. So stay tuned.

First cut of Lycn presence awareness javascript library. I just release the working code. There are still few pending items, like getting the test coverage to be 100% making gulp work to do a CI etc, but i need to get this working copy out as it was dependent on another project i was working on. You can find more details about this project in the github repo. I am use coffee script for both creating the app as well as for testing. I havent uploaded the test cases, but you can take look at it if you see the commit log. The reason the latest commit doesnt have it is because i had to use the window object and Mocha doesnt support window. I had to integrate it with PhantomJS or something like that, for which i had to create a index.html too, so more work, which i know will have to do. But i wanted to get this out there first. In addition to this i also wanted to see how much traction it gets. If see good response i am willing to work more on it.
So looking forward for your feedback and suggestions.

So #WinndyCityHack was over a week back. Couldnt gt anything done so didnt do a demo. Hopefully in the next hack we can showcase something. I didnt build any IoT stuff which i was planning because i had made the proejct to complicated for the time frame. Let see how it works out in the next hackathon.

So in the meantime work required me to build a few javscript apps, and i have been using backbone and TDD via mocha and chai. Its all working out great so far. I am also using grunt as a build tool, and its really nice, then while using grunt i came across, gulp and that was really hooked into it. It uses node.js streams to piple tasks together and hence makes the process super fsat, not that grunt was slow, but its more cleaner and easier to understand.

So far my experiance with gulp is nothing but great. I highly recommed it to anyone who wants to use a build tool for client side or javascript projects. But i does lack maturity and access to plugins that grunt comes with. But its growing and i am pretty sure it will overtake or atleast be at par with grunt pretty soon.

I will post my finding in my next blog post, about gulp and what itresting thing i learnt from it.

Got my Raspberry Pi today, so i decided since i have some time might as well try to load the OS on it. I followed this link to load the OS on the board. Worked like a charm. I choose Raspbian as the image, because i think thats whats recommended and most of the blogs use that. Plan to play around with it and then decide if i need to switch it to something else. It took around 5-10 min for the whole setup to complete, but i didnt have to do anything to it. It was fairly straight forward, considering what i had to do to install Linux in my college days(create partion which has to in primary sector etc etc)
I also got a wifi module and got that to work with the board, by following the instructions listed in the site. So all set for IoT what do i do with it next, any ideas?

Haven’t bloged for sometime. Had gone back to India for a few months and with the Internet speed back in Guwahati, it was hard getting work done leave aside, bloging. But anyways i had a good time, however since the title of this post is not my vacation time, but rather jquery deferred i will stop.
Recently as part of sharepoint app development i have been doing a lot of javascript. While doing that i came across a scenario where i had to make multiple ajax call, and wait for the response to render the view. Something like this

1
2
3
4
5
6
7
8
9
10
11
12
http.get('api/employmenttype', null, false)
.done(function (response) {
console.log('loaded: employmenttype');
vm.lookups.allEmploymentTypes(response);
});
http.get('api/actionlist', null, false)
.done(function (response) {
console.log('loaded: actionlist');
vm.lookups.allActionListOptions(response);
});

view.render()

As you can see above i am using false so that the method is asych. The drawback to this is that its blocking code and does the executing in sequence. Ideally i should be able to call them in parallel and when complete combine them.

Thats exactly what my next set of code will do

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$.when(
http.get('api/employmenttype').done(function (response) {
console.log('loaded: employmenttype');
vm.lookups.allEmploymentTypes(response);
}),
http.get('api/actionlist').done(function (response) {
console.log('loaded: actionlist');
vm.lookups.allActionListOptions(response);
}),
http.get('api/company').done(function (response) {
console.log('loaded: company');
vm.lookups.allCompanies(response);
}),
// … some more
).done(view.render());

This is how we should be doing it. Its much better way to do asych programing. So basically what when does is it waits for each ajax call to complete or in javascript world promise to complete before it executes the done function. Also the ajax calls can now we asyc, i didnt pass a `false; to the get method.
In addition I think there is something call defer, but i havent gone in details on what that does as of today. But there is a nice article listed here you might wanna take a look.

Have been busy with work, but i still havent given up on migrating this blog over to node. In the mean time, i have been working a lot SharePoint, weather i like it or not. I thought i like the new app model for sharepoint, but the more deep i get, the more i lose hope on it. Its good thought, however i think its still has a long way to go before it can be matured enought. The reason i say that is because if i follow a provider hosted app vs auto hosted or sharepoint hosted link, i am dommed. The boiler plate code provided by microsoft is only assuming you are hosted in IIS and using the same AD provider. If you have a differenet federation provider i couldnt find any code for it and plus it gets fairly complicated. So i had to roll back and use CSOM model and use elevate privalges to run my code. It suffices my need as all i wanted was to read data. However in future if i need to take into account user context, this approach would not work.
Ok lets move back to apps. So i was looking and using cross site domain library to levrage javascript to query other sharepoint list link. So far it looks promising, and seems a better approach. However i dont like the way it create a domain on the fly to reigster these apps. I guess thats how Micorosft thought would be better and i think for security reasons.
Anyways so far i was able to
1.Create a wild card domain
2.Get on the fly domain working use the above wild card domain
3.Enable proper trust in appmanifest.xml
4.Now pending is calling this app from a completly outside application using javascript.
Look out for my next post on this

So its been a while since my last post. I have busy as my 1 year old has started walking and i spend most of the time after work running after him. In addition to this, work has been hectic, not that i am complaining, actually getting to learn a lot of things thanks to @luisbocaletti. I also went to some great conference, and got to meet and see a few open source projects happing in the .net and Microsoft world, and how Microsoft is promoting a lot for node.js. I really like node.js and how its light weight and you can easily, bring up a text editor and start coding. That was also the reason i started learning Ruby and hence blogged using octopress. However i havent had much luck actually using Ruby is real world. Probably because of work. However i do use javascript a lot, and familar with the code. Hence i am thinking of moving this blog to a node.js platform and probably host it in Azure or AWS. Still contemplating the decision. Hope fully next time i blog, it will be not using Octopress but something else.

I have been recently working on a sharepoint2010 to 2013 migration project, and even though this might not be related to migration we stumbled upon an issue, which took forver to be resolved. Before i dive into the issue, let me explain the background and give you a run down of what was happening.

###Background
As a part of the migration, we where moving existing application from a fairly open data center to a location where everything is locked down. So when we did the move, we found that another farm, which was consuming the Managed Metadata service, wasn’t able to do this. This was expected, and we knew we had to open up firewalls, but what firewalls. Internally sharepoint user topology service to expose all its end points published as a service. So what we ended up doing is opening the firewall between two servers, which enable traffic over 32844 and 32843.(Prior to this we also had to setup trust and all the stuff require to publish managed metadata across farm. More can be found this this article).

###Error
So ideally this should work, and in a way it did. When we try to connect to our farm form the external farm, we where able to see all the service and even add them. However thats all we could do. We couldn’t consume the services. After reviewing the log we found this error
Microsoft.SharePoint.SPException: Addresses for this application have not yet been fetched.

###Solution
After chaning our logs to be verbose, we found that sharepoint was trying not only connect to the application server where the service was hosted but also to the other servers in the fram. Why, even though the service was turned off? Till date i couldn’t figure out. However i learned that sharepoint internal does some kind of load balancing on its own for the topology service and since we hadn’t open up the entire farm to each other, we where getting the error as it couldn’t fetch the other site via the url.(More details about load balancing can be found here)

###Conslusion
So after opening up ports between all the servers in the farm we where able to consume the Managed Metadata Service as well as view it from the other farm. So opening just the ports to the app server isn’t sufficient because of Sharepoint’s internal load balancing feature, which i know is being done with the right thoughts in mind. We want to make the service highly available. However we missed this one small thing, and it caused us a lot of pain and time. Also as a side note, we even tried to spoof this, but creating an entry in the DNS so that all url/server point to one IP, which is of the server to which the port is open. However this didnt help because the SSL certificate for some reason goofed up and we get error related to SSL/TSL trust issue as WCF level. So we can conclude that there is no option but to open up the firewalls for the entire farm. If there are other ways to get around this, i will surely like to know and fell free to drop me a line and we can hook up.

For our SOA application we are using Nancy to host our service layer. So far, it was only an anonymous read so no reason to worry about security. But the next iteration has put for a requirement to impose security on who can update what.
I could have used someone of the existing modules of there, which enables me to put some authorization and authentication around a service. However, none of them suffice what we have in place. The plan is to use a product called Site Minder for authorization, and building a Nancy modules around it. Over the next few weeks as i start working on this, i will post updates and how i went about it and hopefully even fork and contribute this modules to the Nancy repo. So watch our for my posts.

Copyright © 2013 - Debajyoti Mahanta - Powered by Hexo
- Ported theme GreyShade -