There’s nothing like having oil and natural gas to lift national self-confidence and power. The Caucasus republic of Azerbaijan is no exception.

With less than four weeks to go before it hosts the Eurovision Song Contest, the Azeri authorities are working against the clock to finish the Baku Crystal Palace, where the event will be held in the Azeri capital. The building is already the source of great pride for President Ilham Aliyev’s regime, but not for the residents in the vicinity.

Many have been forcibly evicted to make way for the huge complex that juts out into the Caspian Sea. Those who sought redress in the courts have often had their cases dismissed. Campaigners supporting the evictees have been detained or imprisoned.

One would imagine that the Azeri regime would make every effort to improve its image in the buildup to the Eurovision Song Contest. Yet it is doing the opposite.

“The wealth from oil makes it easier for the regime to ignore criticism over how it deals with the opposition and independent media,” said Leila Alieva, president of the independent Center for National and International Studies in Baku. “The regime is very self-confident.”

Over the past few months, harassment and violence against journalists have increased, according to Human Rights Watch. Leaders of pro-democracy organizations are routinely detained and imprisoned. Peaceful protests are broken up and the participants arrested or beaten. Dozens of political prisoners are behind bars.

All the elections held since Azerbaijan broke away from the former Soviet Union in 1991 have been considered flawed, according to the Organization for Security and Cooperation in Europe. Yet somehow Azerbaijan has been able to avoid censure by the European Union and NATO, with whom it wants closer ties, but especially the Council of Europe, the organization for human rights and democracy in Europe. Azerbaijan joined it in 2001.

Because of its poor human rights records, there was reluctance to admit Azerbaijan, Thorbjorn Jagland, the secretary general of the Council of Europe, explained in an interview. But most members thought it was better to have Azerbaijan admitted in order to provide it with standards for human rights and democratic institutions, rather than leave it outside, where influence would be minimal.

Once a member, Azerbaijan flouted the Council of Europe’s principles. In 2006, there was even an attempt to suspend Azerbaijan’s voting rights in the organization. It failed, but it stung the regime. “Azerbaijan then started a massive lobbying campaign in Britain, Germany and other countries,” said Gerald Knaus, chairman of the European Stability Initiative, an independent research group based in Istanbul.

Azerbaijan could afford it. It was flush with money, having opened, in 2006, one of the world’s longest pipelines, which connected it to European markets. This gave Mr. Aliyev great standing. Besides needing no outside aid, he has been wooed by European governments and energy companies.

Inside the 44-nation Council of Europe, Azerbaijan began an intense public relations campaign, according to Mr. Knaus, who will publish a report in May on how Mr. Aliyev’s lobbyists function inside the organization. Azeri-supported consulting firms managed by former British lawmakers and German journalists are tasked with improving Azerbaijan’s image and thwarting criticism.

The lobbyists cannot be blamed for doing their jobs. But it is a different matter when Council of Europe delegations, including Malta, Spain and Turkey, play down Azerbaijan’s human rights record.

“I’m always worried about lobbying. But I can’t stop it. It is part of society, of democracy,” Mr. Jagland said. “In this regard, my job is to remind delegations of their obligations to the conventions.”

Such reminders have had little positive impact, according to Christoph Strässer. The German Social Democrat federal lawmaker is a member of the Council of Europe’s parliamentary assembly and its legal affairs and human rights committee.

His role is to write a report about political prisoners in Azerbaijan. But Mr. Strässer has repeatedly been denied a visa for Azerbaijan because he wants to meet political prisoners, which he says is part of his mandate. The Azeri authorities claim that he is overstepping his brief.

“Mr. Strässer is trying to change the terms of the mandate. He is one-sided and unobjective,” said Nurchin Aliyev, spokesman for the Azeri Embassy in Berlin. “He can always travel as a private person,” he added.

Regardless of the travel ban, Mr. Strässer said he would write his report. “I have a mandate and I am going to stick to it,” he said in an interview.

So Mr. Strässer will doggedly pursue his mission even as Europe’s most glitzy pop musicians are gathering in Baku for a show that captivates millions of television viewers across the continent.

Analysts say that, clearly, the president, Mr. Aliyev, hopes the Eurovision Song Contest will help polish his country’s reputation in Europe.

Just as clearly, his critics wish it would serve to draw attention to Azerbaijan’s miserable human rights record and what the Council of Europe can do about it.

This article was originally published in the New York Times.