Bloomberg expects the generative artificial intelligence (AI) market to compound at 42% annually to reach $1.3 trillion by 2032. Investors might assume Nvidia is best positioned to benefit given its leadership in machine learning processors. But some Wall Street analysts see Microsoft (MSFT -0.18%) as the bigger winner because it can monetize AI across a broader range of infrastructure and software products.

Indeed, CFRA analyst Angelo Zino recently wrote that Microsoft is "best positioned to monetize generative AI given its ample offerings and pricing power." He listed cloud services, software copilots, and OpenAI large language models (LLMs) as key AI revenue streams in the future.

Likewise, Morgan Stanley analyst Keith Weiss believes Microsoft is "best positioned in software to monetize GenAI across infrastructure and apps." And Oppenheimer analyst Timothy Horan recently noted that "Microsoft stands alone by having the best AI infrastructure and LLMs."

Here's what investors should know.

Microsoft is the market leader in enterprise software

Microsoft has a strong presence in several enterprise software categories. Most notably, Microsoft Teams is the leading unified communications platform, Microsoft Dynamics is the leading enterprise resource planning platform, and Microsoft 365 is the leading office productivity suite.

That list is by no means exhaustive. For instance, Microsoft Power BI holds the top spot in business intelligence software, and industry analysts have recognized the company as a leader in several cybersecurity software verticals, including corporate endpoint security. But the upshot is that Microsoft has a massive customer base.

In fact, the company accounts for more than 16% of all software-as-a-service (SaaS) revenue, nearly twice as much as its closest competitor Salesforce. That supports the idea of Microsoft being the software company best positioned to monetize AI, and the company is leaning into that opportunity with new copilot products.

Microsoft 365 Copilot is a generative AI assistant that automates workflows across its office productivity applications. It can draft and rewrite text in Word, create content and presentations in PowerPoint, organize and analyze data in Excel, and summarize conversations in Teams. Microsoft 365 Copilot became generally available in November.

Microsoft has taken a similar tack with its other software products. For instance, Dynamics 365 Copilot automates workflows across sales, marketing, customer service, and supply chain management. Likewise, Security Copilot automates workflows across various cybersecurity software products.

Those generative AI assistants should ultimately help Microsoft better monetize its market-leading enterprise software.

Microsoft has a strong presence in cloud computing

Microsoft is also well positioned to monetize AI with its cloud computing platform. Azure captured 23% market share in cloud infrastructure and platform services in the third quarter, second only to Amazon Web Services. But Azure has steadily gained share over the past five years because of strength in AI infrastructure and developer services.

In fact, CEO Satya Nadella says Azure has the "best AI infrastructure for both training and inference." He also believes Microsoft's exclusive partnership with OpenAI has positioned the company as the market leader in cloud-based AI services.

Per that partnership, Microsoft is the exclusive cloud provider for all OpenAI workloads, meaning the company earns revenue from ChatGPT because the application runs on Azure infrastructure. Microsoft is also the only cloud provider that offers access to OpenAI machine learning models. Businesses can use those models, including the GPT models that power ChatGPT, to build custom generative AI applications.

That could certainly draw customers to Azure in the future, possibly helping Microsoft gain more ground on Amazon. In any case, JPMorgan Chase analysts have opined that "Microsoft's investment into OpenAI, which started years ago, could potentially prove to be some of the best money ever spent."

Microsoft is an AI stock worth buying, but diversification would be prudent

To summarize the key points, Microsoft has a strong presence in enterprise software and cloud computing, and the company is levering AI to improve its products and create new revenue streams across both business segments.

With that in mind, enterprise SaaS spending is forecasted to increase at 13.7% annually through 2030, while cloud spending is projected to increase at 14.1% annually during the same period. That gives Microsoft a good shot at low-double-digit revenue growth through the end of the decade, which should translate into similar earnings growth.

Indeed, the Wall Street consensus calls for annual earnings-per-share growth of 14.6% over the next three to five years. That forecast makes its current valuation of 35.6 times earnings seems tolerable, despite being a premium to the three-year average of 32.2 times earnings. Patient investors should consider buying a small position in this stock today.

As a caveat, while some analysts have intimated that Microsoft is the best AI stock, it would be foolish for investors to put all their chips on one company. Building a basket of AI stocks is a more prudent strategy. I believe Microsoft has a place in such a basket, but given its market capitalization of $2.7 trillion, other AI stocks (smaller companies) probably have more upside.