Do you have $5,000 that you can afford to invest, but you aren't sure which stocks to buy? A couple of no-brainer stocks that make for ideal buy-and-forget investments are AstraZeneca (AZN 2.65%) and Microsoft (MSFT -0.32%). They are leaders in their respective industries and have terrific financials behind them; they aren't investments you will need to worry about anytime soon.

1. AstraZeneca

AstraZeneca is a robust healthcare company that has a broad portfolio of assets that can generate some promising growth. In the first half of the year, the company reported $22 billion in revenue, which rose 48% year over year (when excluding the impact of foreign exchange).

What makes AstraZeneca attractive for long-term investors is its diverse business, with the company generating billions in revenue from treatments focused on multiple therapeutic areas, including cancer, rare diseases, cardiovascular and respiratory illnesses, vaccines, and others.

The company keeps creating new products that should deliver some fantastic growth, including breast cancer drug Enhertu, which has shown to be effective in treating both low and high levels of HER2. What that means is that the drug can treat more types of breast cancer. At its peak, it could bring in $6.6 billion in annual revenue.

But even beyond that, there is more potential for the business. The number of projects AstraZeneca has in its pipeline totals an astounding 184. The company's diverse product mix and plentiful opportunities mean the growth is likely to continue over the years.

And AstraZeneca has the money to balance both growth and its dividend, which yields 2.4% (better than the S&P 500 average of 1.7%). In the past six months, the company generated $4.5 billion in cash from its day-to-day operations, which is 50% more than the nearly $3 billion that it paid out in dividends during that time.

At a forward price-to-earnings multiple of 15, the stock trades in line with the broader healthcare industry average. But given AstraZeneca's above-average growth potential and dividend, I'd argue that it's worth a premium, and thus is a cheap buy right now.

2. Microsoft

Microsoft is another growth beast that should make for an easy place to invest $5,000. The only thing that I could see putting investors off about the stock is that its market cap is around $2 trillion and it's one of the most valuable companies in the world.

It's tough to argue with that, however, given how strong the business is at present. Microsoft is trading at 27 times its future earnings, and while that isn't cheap (the tech sector averages a multiple of 21), you also would expect the stock to trade at a premium.

Microsoft's office products, its Azure cloud business, Xbox gaming platform, plus its pending acquisition of gaming company Activision Blizzard are all examples of the different growth opportunities it can pursue. And just about all of the company's various business units generated 10% growth in its most recent quarter (ended June 30) when factoring out foreign exchange.

During that period, total sales of $51.9 billion rose by 12% and led to $16.7 billion in net profit. Over the course of the past 12 months, the company has also brought in more than $89 billion in cash from its operations. Those strong financials can go a long way in helping the business grow for years and years.

And it pays a dividend that yields 1%. It's not massive, but it's a bonus for investors, and the company has room to increase it should it want to do so. The payout ratio is just 25% of net income.

Despite its high price tag, Microsoft still makes sense as a long-term buy. As Warren Buffett says, it's far better to buy a great company at a fair price than a fair company at a great price. In Microsoft's case, it's definitely the former.