I can't comment specifically on Baku since I've never been to Azerbaijan, but I can give some general thoughts. The one thing you might want to consider/look into is how prevalent is the radical Islamic movement in Baku or other parts of the country.
I spent a couple years in Kazakhstan, and a good amount of time in the western portion where the oil companies are based (so basically across the Caspian Sea from Baku) and they were having a HUGE problem with radical Islamic elements gaining power. At one point the government had to bring in tanks and several hundred soldiers to quash a "cell" that was running rampant and killing police officers. And this was in Kazakhstan, which has been one of the most stable and least radical of all the Eurasian nations.
I'm not saying Baku is like this, but it's definitely something to look into before heading there for several years. Baku proper might be hunky dory right now, but check out how the rest of the country is doing as well.