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