2021-05-12 09:23:37 -05:00
|
|
|
package setting
|
|
|
|
|
2022-04-04 04:23:13 -05:00
|
|
|
import "github.com/grafana/grafana-azure-sdk-go/azsettings"
|
2021-05-12 09:23:37 -05:00
|
|
|
|
|
|
|
func (cfg *Cfg) readAzureSettings() {
|
2022-04-01 06:26:49 -05:00
|
|
|
azureSettings := &azsettings.AzureSettings{}
|
|
|
|
|
2021-05-12 09:23:37 -05:00
|
|
|
azureSection := cfg.Raw.Section("azure")
|
|
|
|
|
|
|
|
// Cloud
|
2022-04-01 06:26:49 -05:00
|
|
|
cloudName := azureSection.Key("cloud").MustString(azsettings.AzurePublic)
|
|
|
|
azureSettings.Cloud = azsettings.NormalizeAzureCloud(cloudName)
|
2021-05-12 09:23:37 -05:00
|
|
|
|
|
|
|
// Managed Identity
|
2022-04-01 06:26:49 -05:00
|
|
|
azureSettings.ManagedIdentityEnabled = azureSection.Key("managed_identity_enabled").MustBool(false)
|
|
|
|
azureSettings.ManagedIdentityClientId = azureSection.Key("managed_identity_client_id").String()
|
2021-05-12 09:23:37 -05:00
|
|
|
|
2022-04-01 06:26:49 -05:00
|
|
|
cfg.Azure = azureSettings
|
2021-05-12 09:23:37 -05:00
|
|
|
}
|