The judge also imposed a minimum period of imprisonment of four years before the defendant could apply for parole.
On March 24 last year, the vessel the CV Luminous Fortuna unloaded a range of consignments in Auckland, including six items of furniture bound for an Onehunga homeware company.
A bedroom dresser had the heroin powder hidden inside it in what police described as a "very complex and professional concealment".
Three weeks later, Azim hired a storage container in Onehunga where the furniture was stashed.
Police executed a search warrant and took a sample of the heroin in July before beginning a period of surveillance against the defendant.
By August, Azim was desperately trying to sell the valuable cargo, speaking to associates in Pakistan, Afghanistan and Australia.
A trip to Melbourne to find a buyer also proved unsuccessful.
One Australian drug dealer refused the heroin because he was overstocked by 50kg, the summary of facts said.
At the end of the year, police in Australia and New Zealand simultaneously executed search warrants in what was dubbed Operation Smaug.
Azim was found at his Blockhouse Bay address where he directed officers to 2kg of heroin under the house.
Next to the bag was the key for the storage unit where the rest of the shipment was found.
Azim immediately confessed about his role in the drug ring.
Crown prosecutor Thomas Refoy-Butler said the haul was the largest found by police in this country in about 30 years.
"It's as serious as it gets," he said.
But Azim's lawyer Louise Freyer said her client had no control over the size of the importation and stressed he had not made any money from the enterprise.
References provided to the court painted him as a "kind and helpful" person and Judge Thomas reduced the sentence for them, for his guilty plea and his genuine remorse.
The judge said it was important to deter the defendant from future offending but also "to deter people who use New Zealand as a conduit to get heroin into other international markets".
TIMELINE
March 2014 - 13.8kg of heroin shipped into NZ hidden in furniture consignment
April 2014 - Azim stashes it in a storage container in Onehunga
July 2014 - Police execute a search warrant at the site and begin following him
August 2014 - Azim travels to Melbourne to try and finder a buyer for the heroin
December 2014 - Simultaneous search warrants executed in Australia and NZ