diff --git a/receiver/azuremonitorreceiver/config.go b/receiver/azuremonitorreceiver/config.go index 90f7d7ef6292..6e835003e781 100644 --- a/receiver/azuremonitorreceiver/config.go +++ b/receiver/azuremonitorreceiver/config.go @@ -16,6 +16,7 @@ import ( const ( azureCloud = "AzureCloud" azureGovernmentCloud = "AzureUSGovernment" + azureChinaCloud = "AzureChinaCloud" ) var ( @@ -292,7 +293,7 @@ func (c Config) Validate() (err error) { return fmt.Errorf("authentication %v is not supported. supported authentications include [%v,%v,%v,%v]", c.Authentication, servicePrincipal, workloadIdentity, managedIdentity, defaultCredentials) } - if c.Cloud != azureCloud && c.Cloud != azureGovernmentCloud { + if c.Cloud != azureCloud && c.Cloud != azureGovernmentCloud && c.Cloud != azureChinaCloud { err = multierr.Append(err, errInvalidCloud) } diff --git a/receiver/azuremonitorreceiver/scraper.go b/receiver/azuremonitorreceiver/scraper.go index 8e5440dae0cd..1e4449016647 100644 --- a/receiver/azuremonitorreceiver/scraper.go +++ b/receiver/azuremonitorreceiver/scraper.go @@ -126,6 +126,8 @@ func (s *azureScraper) getArmClientOptions() *arm.ClientOptions { switch s.cfg.Cloud { case azureGovernmentCloud: cloudToUse = cloud.AzureGovernment + case azureChinaCloud: + cloudToUse = cloud.AzureChina default: cloudToUse = cloud.AzurePublic }