The marijuana business has come a long way from baggies sold out of shifty looking vans.

As more states make marijuana legal for medical and recreational purposes, the industry is becoming legitimate. That means increasing regulation and tracking from local and state governments.

Microsoft is one of the first major technology companies to get involved with the cannabis industry, lending mainstream credibility to what's sure to be a booming business in the coming years.

The company is working with Kind Financial on software that lets governments track the legal marijuana business and make sure everyone is compliant with regulations.

Related: Women cash in on the marijuana boom

"Microsoft is helping us support governments in their expansion of cannabis legislation," said Kind CEO David Dinenberg. "They're experienced at providing platforms for government regulation. This is something Microsoft does every day of the week with other businesses in other categories."

The service will use Microsoft's Azure government cloud platform, which has already been designed to comply with HIPPA requirements from agencies like the FDA.

Microsoft's involvement is strictly on the government and compliance side, but Kind's business is much broader. It makes "seed to sale" software that can track everything from the growth and harvest of marijuana plants to sales in stores. There are tools for managing marijuana cookie and edible recipes and nutritional value. It makes a kiosk that customers use to select their products and pay (usually in cash).

One of the biggest opportunities for legal marijuana businesses is in regulation. Even though 25 states now allow some kind of legal cannabis sales, only nine have implemented track and trace systems. Many are looking to partner with companies on solutions for managing the controlled substance. The right system could help them see things like how much is being sold to whom, the amount of taxes being collected, and if all growers and sellers are obeying the law.

Related: Take a weed break at work. It's allowed!

"No one can predict the future of legalization of marijuana. The one thing I am comfortable saying is as it gets more highly accepted, it's going to be a highly regulated industry. And the backbone of any highly regulated industry is compliance," said Dinenberg.

Companies like Kind and competitors Metric and NJ Freeway are competing for the potentially lucrative contracts. Associations with mainstream companies, like Microsoft, can help them in the long run.

"We support government customers and partners to help them meet their missions. Kind Financial is building solutions on our government cloud to help these agencies regulate and monitor controlled substances and items, and manage compliance with jurisdictional laws and regulations," said Microsoft in a statement.