mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 10:17:05 +08:00

* Scopes in Azure middleware * Enable Azure middleware without feature flag * Use common Azure middleware in Azure Monitor * Apply feature flag to JsonData configuration of Azure auth * Enforce feature flag in Prometheus datasource * Prometheus provider tests * Datasource service tests * Fix http client provider tests * Pass sdkhttpclient.Options by reference * Add middleware to httpclient.Options * Remove dependency on Grafana settings * Unit-tests updated * Fix ds_proxy_test * Fix service_test
20 lines
615 B
Go
20 lines
615 B
Go
package setting
|
|
|
|
import "github.com/grafana/grafana/pkg/tsdb/azuremonitor/azsettings"
|
|
|
|
func (cfg *Cfg) readAzureSettings() {
|
|
azureSettings := &azsettings.AzureSettings{}
|
|
|
|
azureSection := cfg.Raw.Section("azure")
|
|
|
|
// Cloud
|
|
cloudName := azureSection.Key("cloud").MustString(azsettings.AzurePublic)
|
|
azureSettings.Cloud = azsettings.NormalizeAzureCloud(cloudName)
|
|
|
|
// Managed Identity
|
|
azureSettings.ManagedIdentityEnabled = azureSection.Key("managed_identity_enabled").MustBool(false)
|
|
azureSettings.ManagedIdentityClientId = azureSection.Key("managed_identity_client_id").String()
|
|
|
|
cfg.Azure = azureSettings
|
|
}
|