Peter Corstorphine, also known as Peter Smith, was found guilty of supplying the drugs to officers at the Grey Horse Pub in Edinburgh's Dalkeith Road.
The officers had assumed fake identities to infiltrate the drug trade in the Capital. The operation was launched in 1998 to combat the increased availability of Class A drugs, particularly heroin.
One officer, who used the identity 'Sean', had rented a dilapidated flat in Prestonfield as part of his cover and Corstorphine told him he could assist with its painting and decorating.
He later told 'Sean' he could supply cannabis.
Corstorphine later introduced the undercover officers to other dealers and was arrested when the operation was completed.
But Lords Clarke, Abernethy and Philip ruled entrapment was not involved as "there was no evidence the police officers had induced or incited (Corstorphine] to deal in drugs".
The appeal by Corstorphine, who was admonished after the original trial in October 2000, was refused.