Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update backend to common AzureCredentials #360

Closed
Tracked by #366
kostrse opened this issue Apr 15, 2022 · 0 comments · Fixed by #459
Closed
Tracked by #366

Update backend to common AzureCredentials #360

kostrse opened this issue Apr 15, 2022 · 0 comments · Fixed by #459

Comments

@kostrse
Copy link
Contributor

kostrse commented Apr 15, 2022

Grafana Azure SDK provides hierarchy of domain entities that describe Azure credentials:

ADX has additional authentication method, On-Behalf-Of, which is not supported by Grafana Azure SDK and could be defined locally in the ADX plugin code:

// inherits azcredentials.AzureCredentials interface
type OnBehalfOfCredentials struct {

	AzureCloud   string
	Authority    string
	TenantId     string
	ClientId     string
	ClientSecret string
}

func (credentials *OnBehalfOfCredentials) AzureAuthType() string {
	return "clientsecret-obo"
}

Credentials should be parsed from JsonData during datasource initialization and passed over further as an abstract AzureCredentials object (see Azure Monitor example here).

NewServiceCredentials here doesn't need to receive raw models.DatasourceSettings as an input (at least not for credentials) but a AzureCredentials object.

The ADX plugin has been using own schema for storage of credentials in JsonData which requires custom parser. New implementation should first try to read credentials in the common format using standard parser azcredentials.FromDatasourceData and if credentials not found using this parser then fallback to a legacy parser and read them in legacy format.
This would allow to migrate ADX datasource into the new format of credentials in JsonData while preserving compatibility with existing format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants