Troubleshooting Cloud Management Gateway: Quick & effectively /w CMG Connector Analyzer

In Configuration Manager Current Branch 1806, Microsoft introduced the Cloud Management Gateway Connector Analyzer. A highly valued feature which is a great starting point to troubleshoot your Cloud Management Gateway (CMG) in case you ran in to any issues. In short, it’s a more than welcome and helpful feature!
In a nutshell the Cloud Management Gateway Connection Analyzer validates you Cloud Management Gateway deployment on 6 points, namely:
- Validates whether CMG is in a ready state;
- Validates whether CMG services are running;
- Validates whether CMG is using a up to date configuration;
- Validates connection state between CMG Connection Point and CMG;
- Validates whether site systems are associated with CMG;
- Validates whether Management Point is available and/or well configured;
This blog post provides a first aid guidance to troubleshoot you Cloud Management Gateway(s).
Client Authentication Method
The Cloud Management Gateway Connection Analyzer can be found in the Cloud Services section part of the Administration pane. There are two clients authentication options to connect to the Cloud Management Gateway.
- Azure AD User (this can be a regular Azure AD user);
- Client certificate (currently use the Certificate File option as the console is by default started in a user context instead of system context);
Once connected successfully with a valid Azure AD Account or Client Certificate we can start the connection analyzer to verify the Cloud Management Gateway is working properly.
Cloud Management Gateway Ready State
By deploying the Cloud Management Gateway as a cloud service in Microsoft Azure, you can manage traditional clients that roam on the internet without additional infrastructure. The cloud services authenticates and forwards Configuration Manager client requests to the CMG connection point. The status of the cloud services has the following statuses:
- ServiceState 0 – Started
- ServiceState 3 – UndergoingMaintenance
- ServiceState 4 – Starting
- ServiceState 5 – Stopping
- ServiceState 6 – Stopped
- ServiceState 7 – ReadyRole
The illustration below indicates the CMG service is in ready state and therefore available.
The illustration below indicates the CMG service is not in a ready state.
To troubleshoot CMG Ready state, use CloudMgr.log.
Cloud Management Gateway Services
The illustration below indicates the CMG service is running.
The illustration below indicates the CMG service is not running and therefore not available.
In this case the CMG cloud services might be not running. To troubleshoot CMG services, use CMG-<cloud_service_name>-ProxyService_IN_0-CMGService.log (or CMG-<cloud_service_name>-ProxyService_IN_1-CMGService.log in case of 2 or more VM instances) and SMS_Cloud_ProxyConnector.log.
Cloud Management Gateway Configuration
The illustration below indicates the CMG configuration between on-premise CMG connection point and in CMG in Azure is in sync.
The illustration below indicates the CMG configuration between on-premise CMG connection point and in CMG in Azure is in sync.
This is an easy one, just makes sure the CMG configuration data is in sync by enforcing “Synchronize configuration” under Cloud Services section part of the Administration pane.
Cloud Management Gateway Connection Point
The CMG connection point is the site system role for communicating with the CMG. By default the CMG connection point establishes TCP-TLS connections (10140-10155) to connect to CMG cloud service in Azure. In case of 2 or more VM instances, the second VM instance uses port 10141, up to the sixteenth on port 10155.
Make sure <cloud_service_name>.cloudapp.net:10140 is reachable and can be resolved (name resolution) properly. To troubleshoot CMG service health, use CMGService.log and SMS_Cloud_ProxyConnector.log.
The illustration below indicates the CMG configuration point is able to communicate with CMG in Azure.
The illustration below indicates the CMG configuration point is not able to communicate with CMG in Azure.
To troubleshoot CMG services, use SMS_Cloud_ProxyConnector.log.
Site System roles assigned to Cloud Management Gateway
Make sure you have configured the management point and/or software update point site systems linked to your CMG to accept CMG traffic from clients which are on the internet.
When there is no site system role assigned (whether management point or software update point) clients on the internet won’t be able to take benefit of the concerning service(s).
Make sure you’ve assigned at least one management point or more to service clients on the internet.
Management Point Availability & Configuration
The CMG connect point forwards client communications to on-premise site system role(s) (management point(s) and/or software update point(s). In this case the site system roles should be available
In case you’ve bind a wrong web server certificate to you management point or software update point (IIS) or the certificate isn’t trusted (certificate chain) incoming client communications from CMG cloud service won’t be accepted.
In the table below an overview of a few scenarios whereby the management point isn’t available for various reasons.
Error | Solution | |||||||||||||||||||||
Failed to get ConfigMgr token with Azure AD token. Status code is ‘503’ and status description is ‘CMGConnector_ServiceUnavailable’. | A possible reason for this failure is the CMG connection point failed to forward the message to the management point. The management point returned the following error: ‘ServiceUnavailable’. | Make sure IIS services is running properly. | ||||||||||||||||||||
Failed to get ConfigMgr token with Azure AD token. Status code is ‘500’ and status description is ‘CMGConnector_InternalServerError’. | A possible reason for this failure is the CMG connection point failed to forward the message to the management point. Internal server error. For more information, see the management point logs for more details to see why internal server error returns. | Make sure you bind the right web server certificate to IIS or make sure the correct root- and/or intermediate CA is added. | ||||||||||||||||||||
Succeed to get ConfigMgr token with Azure AD token. | Failed to refresh MP location. Status code is ‘401’ and status description is ‘CMGConnector_Unauthorized’ | A possible reason for this failure is the CMG connection point failed to forward the message to the management point. The management point returned the following error: ‘Unauthorized’. | ||||||||||||||||||||
Succeed to get ConfigMgr token with Azure AD token. | Failed to refresh MP location. Status code is ‘500’ and status description is ‘CMGService_No_Connector’. | A possible reason for this failure is the CMG service failed to forward the message to the CMG connection point. There is no CMG connection point that is connecting to the CMG service. For more information, see the SMS_CLOUD_PROXYCONNECTOR.log on the CMG connection point. | Make sure firewall or proxies aren’t blocking network traffic. Click here for a complete overview of ports required by CMG. |
Cloud Management Gateway Log files
The following table lists the log files that contain information related to the cloud management gateway.
Log name | Description | Computer with log file | |||||||||||
CloudMgr.log | Records details about deploying the cloud management gateway service, ongoing service status, and use data associated with the service. | You can configure the logging level be editing the Logging level value in the registry key HKLM\SOFTWARE\ Microsoft\SMS\COMPONENTS\ SMS_CLOUD_ SERVICES_MANAGER | The installdir folder on the primary site server or CAS. | ||||||||||
CMGSetup.log1 | Records details about the second phase of the cloud management gateway deployment (local deployment in Azure) | You can configure the logging level using the setting Trace level (Information (Default), Verbose, Error) on the Azure portal\Cloud services configuration tab. | The %approot%\logs on your Azure server, or the SMS/Logs folder on the site system server | ||||||||||
CMGHttpHandler.log1 | Records details about the cloud management gateway http handler binding with Internet Information Services in Azure | You can configure the logging level using the setting Trace level (Information (Default), Verbose, Error) on the Azure portal\Cloud services configuration tab. | The %approot%\logs on your Azure server, or the SMS/Logs folder on the site system server | ||||||||||
CMGService.log1 | Records details about the cloud management gateway service core component in Azure | You can configure the logging level using the setting Trace level (Information (Default), Verbose, Error) on the Azure portal\Cloud services configuration tab. | The %approot%\logs on your Azure server, or the SMS/Logs folder on the site system server | ||||||||||
SMS_Cloud_ | ProxyConnector.log | Records details about setting up connections between the cloud management gateway service and the cloud management gateway connection point. | Site system server |
1 These are local Configuration Manager log files that cloud service manager sync from Azure storage every five minutes. The cloud management gateway pushes logs to Azure storage every five minutes. So the maximum delay is 10 minutes. Verbose switches affect both local and remote logs. The actual file names include the service name and role instance identifier. For example, CMG-ServiceName-RoleInstanceID-CMGSetup.log
- For troubleshooting deployments, use CloudMgr.log and CMGSetup.log
- For troubleshooting service health, use CMGService.log and SMS_Cloud_ProxyConnector.log.
- For troubleshooting client traffic, use CMGHttpHandler.log, CMGService.log, and SMS_Cloud_ProxyConnector.log.
Sources
Please find below the resources I’ve used to writeup this blog post.
Microsoft, Plan for the cloud management gateway in Configuration Manager
https://docs.microsoft.com/en-us/sccm/core/clients/manage/cmg/plan-cloud-management-gateway
Microsoft, Log files in System Center Configuration Manager
https://docs.microsoft.com/en-us/sccm/core/plan-design/hierarchy/log-files#cloud-management-gateway
Further I want to pay attentions of a great blog post series of how to set up your Cloud Manage Gateway by fellow MVP Zeng Yinghua
SCConfigMgr, How to setup Co-Management
http://www.scconfigmgr.com/2017/11/23/how-to-setup-co-management-part-1/
Many thanks for your post ! very helpful…
Does it also work with the new feature from CB1806, HTTP Enhanced ?
I always get an error (403) with the last check “Testing the CMG channel for MP”.
Thanks Phil. Yes, the CMG connection analyzer works for HTTP Enhanced scenario however the Management Point check doesn’t seems taking account you’ve configured HTTP instead of HTTPS. Therefore I expect this might be a false positive when configured HTTP Enhanced scenario. I assume you haven’t bind any Web Server certificate to IIS, correct?
I reply to myself
It works now ;-)
The Azure Active Directory User Discovery was disabled (on Azure Services in ConfigMgr). Therefore the MP couldn’t verify/allow the inbound connection.
This error : “Return code: 403, Description: Un-authorized request, AAD user is not discovered” in CCM_STS.log was the clue.
Regards from Switzerland
Thanks Phil for sharing your valuable feedback, highly appreciated! Great to hear it works. Greetings from the Netherlands 😉
So fast ! thanks for your reply Ronny…
Yes.. you’re right.. I’ve not bind any Web Server certificate on my Default Website (which host the MP).
Nota Bene :
– I use a custom port for HTTP (8181)
– ConfigMgr setup add a binding to HTTS (443) with a SSL (self signed) Cert “SMS Role SSL Certificate”
I am getting the following error during the “Testing the CMG channel for management point” :
Failed to get ConfigMgr token with Azure AD token. Status code is ‘403’ and status description is ‘CMGConnector_Un-authorizedrequest’.
A possible reason for this failure is the CMG connection point failed to forward the message to the management point. The management point returned the following error: ‘Un-authorizedrequest’.
Do you have Azure Active Directory User Discovery enabled?
Yes, it is enabled and syncing
i have setup a cmg with an enhanced http enabled mp and sup. so far everything looks good…i can run the connection analyzer without errors.
But it seems that the clients don’t get the cmg. (client settings are enabled).
Watching the clientlocation.log is still only detects my on-prem management point.If i click on the network tab in the config mgr agent properties, its empty.
any idea what is wrong here?
It sounds like it is quite complicated to manage data all on your own. I need to get a cloud solution set up for my office. We can’t make sense of all the data we have coming in.
It depends on your starting point, maturity level and (business-, technical or regulatory) requirements, but a cloud (SaaS) solution make sense for sure. Endpoint Manager does fit in here and provides a transition path for hybrid- or native cloud deployment scenarios.