Skip to content

Commit bfc2df4

Browse files
committed
Tested System managed identity
1 parent 62d969c commit bfc2df4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

plugins/out_azure_kusto/azure_kusto_conf.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ struct flb_azure_kusto *flb_azure_kusto_conf_create(struct flb_output_instance *
641641
}
642642

643643
flb_sds_snprintf(&ctx->oauth_url, flb_sds_alloc(ctx->oauth_url),
644-
FLB_AZURE_MSIAUTH_URL_TEMPLATE, "");
644+
FLB_AZURE_MSIAUTH_URL_TEMPLATE, "", "");
645645

646646
} else {
647647
/* user assigned managed identity */
@@ -656,7 +656,7 @@ struct flb_azure_kusto *flb_azure_kusto_conf_create(struct flb_output_instance *
656656
}
657657

658658
flb_sds_snprintf(&ctx->oauth_url, flb_sds_alloc(ctx->oauth_url),
659-
FLB_AZURE_MSIAUTH_URL_TEMPLATE, ctx->managed_identity_client_id);
659+
FLB_AZURE_MSIAUTH_URL_TEMPLATE, "&client_id=", ctx->managed_identity_client_id);
660660
}
661661
}
662662
else {

plugins/out_azure_kusto/azure_msiauth.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/* MSAL authorization URL */
2323
#define FLB_AZURE_MSIAUTH_URL_TEMPLATE \
24-
"http://169.254.169.254/metadata/identity/oauth2/token?api-version=2021-02-01%s&resource=https://api.kusto.windows.net"
24+
"http://169.254.169.254/metadata/identity/oauth2/token?api-version=2021-02-01%s%s&resource=https://api.kusto.windows.net"
2525

2626
char *flb_azure_msiauth_token_get(struct flb_oauth2 *ctx);
2727

src/flb_oauth2.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ struct flb_oauth2 *flb_oauth2_create(struct flb_config *config,
227227
}
228228

229229
/* Create Upstream context */
230-
if (strcmp(prot, "https")) {
230+
if (strcmp(prot, "https") == 0) {
231231
ctx->u = flb_upstream_create_url(config, auth_url,
232232
FLB_IO_TLS, ctx->tls);
233233
}
234-
else if (strcmp(prot, "http")) {
234+
else if (strcmp(prot, "http") == 0) {
235235
ctx->u = flb_upstream_create_url(config, auth_url,
236236
FLB_IO_TCP, NULL);
237237
}

0 commit comments

Comments
 (0)