I finally figured it out. The error message gotten in the command line wasn't descriptive enough.
The issue was caused by me hitting the maximum limit of CDN profiles under my subscription. A Content Delivery Network subscription can contain one or more Content Delivery Network profiles.
- Azure Content Delivery Network profiles have a limit of 25
- Azure Content Delivery Network endpoints per profile have a limit of 25
- Azure Custom domains per endpoint have a limit of 25
So a workaround for this will be to organize the endpoints for your apps into different categories, say, production, test, and staging. And then create Content Delivery Network profiles for each of these categories to house the corresponding endpoints that fall into the category.
Resources: Content Delivery Network limits
That's all.
I hope this helps