On a pitch more suited to the Sunday morning parks game than elite European competition, a doggedly determined display from the Dons saw them leave Azerbaijan just a goal behind - and with an absolute cracker of a tie in prospect next Thursday at Pittodrie.
Stephen Glass made six changes to the team beaten by Raith Rovers last Sunday as the Dons headed into the Conference League play-off game. Scott Brown, Andrew Considine, Calvin Ramsay, Lewis Ferguson, Jack MacKenzie and Christian Ramirez all returned to the starting line-up in place of Jack Gurr, Jonny Hayes, Dylan McGeouch, Connor McLennan, Teddy Jenks and Niall McGinn, all of whom were on the bench.
Qarabag came through to the play-off by beating AEL Limassol 2-1 on aggregate, completing the job with a 1-0 home win last Thursday. They made just one change to that team, Kady, who scored the goal after coming on as a substitute, replacing Ozobić in the team - he drops to the bench.
The pre-match worries about the pitch were soon shown to have real foundation, the turf cutting up quickly, the ball bobbling away on the surface, an evening for safety first, certainly at the back.
Joe Lewis was called into his first sharp action on seven minutes, pushing away a shot from Bayramov after he had slalomed his way past a couple of challenges before firing off a shot from the edge of the area.
There was real concern for Aberdeen on 10 minutes as Considine slumped to the turf clutching his left knee after getting barged by one of the home players, the Slovenian referee oblivious to it all. He received lengthy treatment before being carried from the scene on a stretcher, a dreadful start to the evening. Hayes was the man to come on in his place, MacKenzie going into the back three.
A throw from the left from Jay Emmanuel-Thomas caused problems on 16 minutes, Hayes helping it onto Ramirez at the back post but his header looped over.
The surface was making any kind of passing football difficult and it was a game without any real rhythm, Garayev expressed his frustration by smashing one well wide from 30 yards after 25 minutes, whereupon the sides took a break to get a drink.
Qarabag were a bit livelier after the drinks interval, Ross McCrorie having to be alert to make a key interception on 27 minutes as the hosts began to pass the ball a little better.
On the half hour though, Qarabag were in front, Romero getting the ball just inside the box on the right side. With Huseynov making a decoy run outside him to make it 2v1 on Hayes, it gave Romero the chance to come inside to open up the angle. He took his shot early and drilled a left foot shot just inside the post, a fierce finish.
Qarabag were suddenly looking a good side now, beginning to push the Dons further back and looking much more secure in their passing. Declan Gallagher had to get an important block on Zoubir's shot on 39 minutes, taking it full in the face and diverting it behind.
McCrorie was the first to be booked on 42 minutes, coming across Kady as he ran towards the Aberdeen box. The free-kick, very central, from 30 yards out, saw Romero put his shot into the heart of the wall.
Aberdeen put their first real spell of possession together on 44 minutes, the ball enduing with Hayes on the left, his cross cleared by the Qarabag defence.
HALF-TIME: QARABAG FK 1 ABERDEEN 0
Aberdeen introduced McLennan at the start of the second half, Emmanuel-Thomas making way.
Brown was in the book on 55 minutes for clipping Kady on halfway in the first really meaningful action of the second period, the Dons looking more competitive after the break and able to get the ball further forward than in the first half. The game was particularly scrappy, fouls coming from both sides, the referee apparently only having cards for one team. Garayev repeated Brown's challenge on Ferguson on the hour, but no card again.
McLennan's energy was giving Aberdeen more of a threat, but Qarabag looked content to sit back and then try to use their pace on the break, as they did on 63 minutes to force a corner. Aberdeen looked to break from that until Ferguson was poleaxed by Andrade who forced the referee into finally administering a caution to the hosts. Ferguson required plenty of treatment before he was able to continue, Stephen Glass yellow carded in the aftermath as he remonstrated with the officials.
Another drinks break was called on 69 minutes, Aberdeen encouraged by the opening period of this second half, but aware that it was soon after the first half interval that Qarabag lifted their game and grabbed the lead. On the restart, Ferguson was clobbered again by Kady, no action taken. Kady was in more legitimate action on 74 minutes, firing off a 30 yard shot that sailed over the bar.
Ozobić replaced Kady for the hosts on 78 minutes in their first change, as they looked to extend their lead ahead of the Pittodrie return. Aberdeen were looking more threatening now though and good play down the left got Hayes into a crossing position. His ball into the box caught Hüseynov on the top of the head on its way behind and he collapsed to the turf for a worrying moment before gradually getting to his feet. Ramsay's corner looked dangerous when it reached Gallagher at the back post but Qarabag ultimately manged to scramble clear.
The Dons were looking more authoritative now, Ramirez taking a first time shot on the run on 85 minutes, the goalkeeper down for a comfortable save, the striker perhaps having time to take a touch first.
Qarabag made a double change to try to change the flow of the game, Vesović and Ibrahimli on for Romero and Garayev with three minutes left. McLennan continued to be the most threatening sub though, a drilled cross into the box causing problems for Qarabag who were happy to hack clear.
Hearts in mouth into added time, Ojo losing the ball in Aberdeen's half, Vesović getting into the area before firing off a shot, Lewis staying tall and refusing to commit himself, making another good save.
Four minutes into added time, a last chance for the Dons, Medvedev crashing into Ramirez nearly 30 yards out and going into the book as a result. It took an age before the wall was set, Ozobić getting booked as things got feisty. Ferguson finally stepped up, put the ball over the wall, Magomedailyev catching it easily.