In the moments leading up to the incident at the One Stop Shop in Hatfield House Lane, Shiregreen at 10pm on May 29 this year, staff had just closed the shop and were cashing up in the locked back office, Sheffield Crown Court heard.
While watching the store's CCTV monitor, staff noticed three masked men, with their hoods up, acting 'suspiciously' near to the front door's partially-closed shutters, which led them to call the police.
The court was shown CCTV footage of defendants, Kyle Bayliss, 31, and Connor Roulson, 21, along with a third man who has never been identified, pulling and kicking the shutters for around two minutes, before one of the men smashed the front door with his foot.
"The two defendants go inside, while the other man waits outside...they go straight for the locked cigarette kiosk but are unable to get in so take loose cigarettes and alcohol," prosecutor, Louise Gallagher said.
She added: "The police come in and the defendants run towards the back of the shop...they are trying to get out of the back door and start banging on it."
A female police officer is then seen to tackle Bayliss to the ground, before using pava spray on him.
Ms Gallagher described how while Bayliss was being apprehended, Roulson took out the machete he was hiding and attempted to stash it in a nearby fridge, but it dropped it to the floor and he was then arrested.
She added: "While Kyle Roulson was being detained, he saw the manager of the shop, who had come out of the back office and said: 'Just you wait until I get out of prison'."
At an earlier hearing, Roulson, of Shiregreen Lane, Wincobank pleaded guilty to aggravated burglary and possession of a blade, while Bayliss, of Hucklow Road, Firth Park pleaded guilty to a single charge of aggravated burglary.
Francis Edusei, defending Roulson, said the execution of the offence was unsophisticated, and stressed that Roulson was a young man who was lightly convicted.
He said: "When the police turned up, Mr Roulson disposed of the machete, laid on the floor and put his hands behind his back, ready to be handcuffed."
Defending Bayliss, who has an extensive criminal record, Rebecca Tanner, said: "He knows he has let himself, and more importantly his family, down by committing an offence of this gravity. The last matters that attracted a significant sentence were almost 10-years-ago, and this defendant said he hoped to put this sort of offending behind him."
Judge Rachel Harrison jailed Bayliss for four years, eight months and Roulson for three years, four months.
She told the pair: "This was a terrible offence committed at a shop where you knew staff would be locking up. It was committed against those who provide a vital community service by working in that shop."