[v10.1.x] Azure: Settings for Azure AD Workload Identity (#75683)

* Azure: Settings for Azure AD Workload Identity (#75283)

* Settings for Azure AD Workload Identity

* Update dependency on Grafana Azure SDK

* Documentation

* Fix JS code

* Cleanup Prometheus backend code

* Making prettier happy

(cherry picked from commit 3ee40d3a5a)

# Conflicts:
#	go.mod
#	go.sum
#	public/app/plugins/datasource/mssql/azureauth/AzureAuth.testMocks.ts

* Fix go.sum

---------

Co-authored-by: Sergey Kostrukov <sekost@microsoft.com>
This commit is contained in:
Andreas Christou
2023-09-29 11:47:34 +01:00
committed by GitHub
co-authored by Sergey Kostrukov
parent 8476f5acdc
commit 6445e1f907
10 changed files with 106 additions and 35 deletions
+18
View File
@@ -17,6 +17,24 @@ func (cfg *Cfg) readAzureSettings() {
azureSettings.ManagedIdentityEnabled = azureSection.Key("managed_identity_enabled").MustBool(false)
azureSettings.ManagedIdentityClientId = azureSection.Key("managed_identity_client_id").String()
// Workload Identity authentication
if azureSection.Key("workload_identity_enabled").MustBool(false) {
azureSettings.WorkloadIdentityEnabled = true
workloadIdentitySettings := &azsettings.WorkloadIdentitySettings{}
if val := azureSection.Key("workload_identity_tenant_id").String(); val != "" {
workloadIdentitySettings.TenantId = val
}
if val := azureSection.Key("workload_identity_client_id").String(); val != "" {
workloadIdentitySettings.ClientId = val
}
if val := azureSection.Key("workload_identity_token_file").String(); val != "" {
workloadIdentitySettings.TokenFile = val
}
azureSettings.WorkloadIdentitySettings = workloadIdentitySettings
}
// User Identity authentication
if azureSection.Key("user_identity_enabled").MustBool(false) {
azureSettings.UserIdentityEnabled = true