While setting up the CMG (cloud management gateway) I encountered Failed to Sign in to Azure error. This is a common error you encounter while creating Azure web applications. There are many ways to fix the failed to sign in to Azure error and I am covering the most easiest method in this post.
While trying to setup SCCM CMG, I encountered the error failed to sign in to Azure and initially this looked like a account permission related issue. However I had setup the cloud management gateway earlier using the same credentials so I was sure that this is not a permission issue.
SCCM CMG Failed to Sign in to Azure Error
While setting up the SCCM CMG (cloud management gateway), you create two web applications. ConfigMgr Server Application and ConfigMgr client Application. These two applications are must for CMG setup.
For each of the applications, you specify the application name, home page URL and secret key validity period. Note that CMG App secret key validity period can now set to Never expire which is a great thing. Otherwise you had to renew the secret key manually whenever it got expired.
Once the details are provided to create the ConfigMgr Server Application, I encountered a Failed to sign in to Azure error.
Login to Azure portal and in the search box type App registrations. From the drop-down click App registrations.
The reason why you get Failed to Sign in to Azure error is the ConfigMgr Server App already exists under App registrations. The new App ID URI and homepage URL basically matches with that of old one.
At this point you have got some options to fix the Failed to Sign in to Azure error for SCCM CMG.
- Use a different App ID URI and Homepage URL instead of default one.
- If you wish to use the URI and URL, delete the old ConfigMgr Server App and Client app under App Registrations in Azure Portal.
- Manually register Azure Active Directory apps for the SCCM CMG.
Since I was setting up new CMG for my lab, I wanted to wipe out all the old app registrations from Azure portal. Select the ConfigMgr Server App and click Delete. You may also have to repeat the same steps while configuring the ConfigMgr client application.
When asked for confirmation to Delete Application ConfigMgr Server app, click Yes.
Within few minutes, you get a notification Successfully deleted application ConfigMgr Server App.
Get back to CMG setup and now sign-in with your Azure AD admin account and you should see Signed in successfully message.