Masked Ryan Scullion threatened the wife with a knife as he and accomplices made off with £400 and a bottle of Irn Bru.
A judge told Scullion (25) at the High Court in Edinburgh: “There is no suitable alternative to a prison sentence.”
Lord Beckett said Scullion’s actions during the crime were “violent, intimidating and terrifying” and would have led to a five-year prison sentence, but for his guilty plea.
The judge told him: “The courts must seek to protect those who provide a service to the public by working in shops.”
Scullion admitted assaulting Supatha and Kasinarthar Kasiananthan and robbing them while acting with two accomplices at the Glendevon service station, in Winchburgh, in West Lothian, on July 6 last year.
Advocate depute Jo McDonald said Mr Kasiananthan and his wife Supatha were cashing up for the day after 10 pm when the trio entered the premises wearing masks.
One robber stood at the door to act as a lookout while another brandished a hammer at the husband.
Scullion, formerly of Bridgeness Lane, Bo’ness, climbed over the counter armed with a large knife and ordered the wife to sit on the floor, telling her not to scream or shout.
He then opened the till and looted it of banknotes and coins before the robbers fled. A woman who was at the back door of her home about 10 yards from the service station heard the sound of car doors slamming and someone shouting: “Go, go, go.”
Police were called to the raid scene and found the victims shaken and upset.
About a month after the robbery police received confidential information naming the three men responsible for carrying out the crime.
Scullion was detained and a knife identified as similar to that used in the robbery was found. He was interviewed but denied any involvement in the offence.
The raid was captured on camera and the court was shown footage of the incident.
Defence solicitor advocate Ian Bryce said Scullion was “horrified” at his actions and offered his sincere apologies.
He said the labourer had returned to Scotland with a new partner but the relationship broke down and he became homeless.
He said Scullion began taking valium but his drug use escalated into a heroin habit. Scullion fell into debt and came under pressure to repay the money and committed the offence.
Mr Bryce said: “He is under no illusions that a custodial sentence is inevitable.”