Towards the end of the First World War, Britain sent troops to Baku, Azerbaijan’s capital city – in order to protect our interests in Iran and the Indian Ocean, prevent the biggest oil centre in the world from falling into the hands of the Bolsheviks, and capture “the bridge between Europe and the East“: Azerbaijan itself.

During the course of this action, a Jewish British soldier married a Jewish Azerbaijani lady – the daughter of a wealthy local oil engineer.  She then sailed from strife-torn Baku to rural Warwickshire, where she set up, scarcely speaking a word of English, as that officer’s wife in Henley-in-Arden, deep in Shakespeare country.

A little later, the Bolsheviks took control of Baku and its oil, and the engineer left for what was then Palestine – minus his money, which the Bolsheviks had removed.  He was my great-grandfather, and readers will understand that when I travelled to Baku recently I had no expectation whatever of getting any of it back, but had none the less a family interest in Azerbaijan itself – what it’s like, how its relations with Britain are coming along, where it’s going.

First things first: in this case, a cautionary note. I went as part of a delegation, all other members of which were members of Parliament. And as I’ve written before, “politicians tend to travel abroad, when working, as guests of governments.  They therefore often see what those governments want them to see – and can end up thinking what they’re led to think”.

One fact, however, was inescapable right from the start. “If oil is a queen, Baku is her throne,” Churchill said.  That is no longer true: many countries are bigger producers (Azerbaijan comes in outside the top 20 and lower down the list than Britain), but oil is no less important to it than it was when my grandfather was sent out to fight the Bolsheviks almost a hundred years ago. It has been joined by gas.  A southern gas corridor is to run from Azerbaijan to Europe, as supplies already do.

Nor is Azerbaijan less of a bridge than it was a century ago.  It has Russia and Georgia to its north, Iran to its south (more Azeris live there than in Azerbaijan itself), Armenia to its west, and the vast expanse of the Caspian Sea to its east.  Its governing elites like to see the country as a mix of an Islamic heritage, European modernisation, and a secular culture.

That secularism is an inheritance of its recent past.  The British expedition to Baku failed.  The Bolsheviks annexed Azerbaijan to the Soviet Union, and it only struggled free some 70 years later when communism collapsed.  Most people in the country are nominally Shi’ite Muslims, but the Soviet inheritance lingers.  We saw few mosques in central Baku, though there are more elsewhere in the city and in Azerbaijan itself.  The language is a form of Turkish.

I have seen “dry” public places and “wet” private ones in Muslim countries before – that’s to say, cities in which alcohol isn’t officially available, but where it flows lavishly in private houses.  In Baku, booze is pretty much on public display, and not just confined to dining room sideboards.  (One of the latter I saw had a photograph of our hosts at Mecca placed proudly next to a bottle of Glenfiddich.)

“Religion and politics should be separate.  It is possible to be both secular and Muslim,” one senior politician told us.  Azerbaijan is one of the few Islamic countries to maintain good relations with Israel – though its leadership is strongly supportive, as we were reminded, of the establishment of a Palestinian state.  Heydar Aliyev, the founder of modern Azerbaijan, made the transition from sitting on the Soviet Politburo to sitting alongside Margaret Thatcher: the photograph is in a cultural centre named after him.

So far, so promising: what’s not to like?  The answer, unfortunately, is that Azerbaijan’s story isn’t nearly as simple as that of a secular western ally standing up to imperialist Russian bullying and expansionist Iranian ambitions.  The clue lies in the story of Aliyev himself, and that of the country since his death.  Freedom House’s report on it makes dispiriting reading.

“Azerbaijan is ruled by an authoritarian regime characterized by intolerance for dissent and disregard for civil liberties and political rights,” it says near the beginning.  It has “consistently ranked among the world’s most corrupt countries”. The Parliament is a “rubber-stamp body with no oversight or public debate function”.  Recent elections have been “marred by fraud”. The judiciary remains “a tool for carrying out the regime’s political will”.  There is “systematic suppression” of the media.

Aliyev established “a Soviet-style, vertical power system based on patronage and the suppression of political dissent” – and was duly succeeded by his son, Ilham Aliyev who, together with his immediate family, “control huge assets, including monopolies in the economy’s most lucrative sectors”.  But you get the picture.  Two big questions trail in its wake.

The first is whether Azerbaijan’s gas and oil wealth will simply be squandered, as those of, say, Saudi Arabia surely will be.  (What will become of that country when its natural reserves are spent?)  This seems unlikely.  The Azeris have cleared up a lot of the post-Soviet pollution.  The centre of Baku – architecturally, the old city is a kind of mix of old-Paris-meets-modern-Dubai – has been lavishly restored.  It is true that none of this guarantees spending on education or investment in people.

And we were told when we there that most of the rest of the country is most unlike uptown Baku: there is real poverty.  Parts of the city that we saw away from the centre which were (I would judge) “middle class” looked as dilapidated as they felt safe.  But Azerbaijan scores in the “high” category of the U.N’s human development index.  Economically, it has come a long way since the civil war of the 1990s.

The next question is a general one in which the country is enveloped: should Britain have anything to do with repressive states at all?  My own answer is nearer the realist than idealist end of the scale.  Azerbaijan’s neighbours aren’t exactly Utopias.  We found its leaders worrying away about Russia (what will Putin do next?) and looking more benignly on Rouhani. (But is he too good to last?  And how much ice does he cut in Iran, anyway?)

There is a national interest balance between pushing states on their human rights records and severing ties completely – at least, if there’s a good chance that any replacement regime would be be worse.  Iran would certainly like to get its own form of the Shi’ite version of Islam into Azerbaijan, just as Saudi Arabia would like to get their own forms of the Sunni branch in.  There are real security threats.

Azerbaijan claims to be striving to tackle corruption – at the lower end of the power scale, at any rate.  We saw a shiny-clean “Asan” centre, a kind of one-stop shop where citizens can go to get their passports, driving licences, car insurance, and so on: all done without cash, in order to eliminate corruption.  14,000 people a week apparently go through the centre we saw.  There are four in Baku; two elsewhere.

You may well ask what on earth the country is doing on the Council of Europe, in terms either of right or geography.  But Azerbaijan sees itself, in some senses, as a European country.  The European Games will take place in Baku next year.  The Eurovision happened there in 2012.  The first stage of the FIDE Grand Prix is happening more or less now.  (We clocked Lord Coe and Bernie Ecclestone in town.)

There are strict limits to our engagement with Azerbaijan.  There is little Britain can do about the continuing strife between it and Armenia over Ngarno-Karabakh, for example.  But the case for engagement is solid: British jobs, interests and prosperity are linked to the country.  There is a British war memorial in Baku.  I think as I write of my grandfather’s comrades-in-arms who did not return.