grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
65.14k stars 12.15k forks source link

Azure Monitor: Current-user auth errors when viewing subscriptions and resources #96651

Open kayodeprinceMS opened 1 day ago

kayodeprinceMS commented 1 day ago

What happened?

Subscription list did not load as expected in Azure Monitor plugin when configured with current-user auth

Image

Resource selector for Azure Monitor metrics throws and error when subscription is expanded when using current user auth

Image

What did you expect to happen?

Subscription list to load at data source configuration Resource groups to be displayed in resource selector when a subscription is selected

Did this work before?

Yes

How do we reproduce it?

  1. Grant a user Monitoring reader access to resource group or resource within a subscription but not to the subscription itself.
  2. Enable current user authentication in Azure Monitor plugin.
  3. Attempt to create a panel with Azure Monitor metrics by navigating to a resource within any subscription.

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: Grafana v11.4.0-207922 (e331b778c1) OS: Windows 11 Browser: Edge

Azure Managed Grafana

Grafana platform?

Other

Datasource(s)?

Azure Monitor

kayodeprinceMS commented 1 day ago

cc: @aangelisc @taleena

shawncx commented 23 hours ago

For subscription load issue, here's the grafana log

runtime/panic.go:262 (0x6a47cf8)
runtime/signal_unix.go:900 (0x6a47cc8)
github.com/grafana/grafana/pkg/tsdb/azuremonitor/azuremonitor-resource-handler.go:120 (0xbb85b46)
github.com/grafana/grafana/pkg/tsdb/azuremonitor/azuremonitor-resource-handler.go:155 (0xbb86d3d)
net/http/server.go:2220 (0x6dd2068)
net/http/server.go:2747 (0x6dd3f69)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/resource/httpadapter/handler.go:61 (0x7a825d7)
github.com/grafana/grafana/pkg/tsdb/azuremonitor/azuremonitor.go:85 (0xbb87f07)
github.com/grafana/grafana/pkg/plugins/backendplugin/coreplugin/core_plugin.go:102 (0xc3dff90)
github.com/grafana/grafana/pkg/plugins/plugins.go:337 (0x7a43f3a)
github.com/grafana/grafana/pkg/plugins/manager/client/client.go:117 (0xc5b6b5e)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0x778f996)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/error_source_middleware.go:93 (0x778f987)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb42047a)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/httpclient_middleware.go:84 (0xb42044e)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb42ceb7)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb41ea13)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/forward_id_middleware.go:64 (0xb41e9d7)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb41c756)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/caching_middleware.go:157 (0xb41c757)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb41e513)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/cookies_middleware.go:108 (0xb41e4d7)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb425c33)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/oauthtoken_middleware.go:108 (0xb425bf7)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb41cd82)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/clear_auth_headers_middleware.go:58 (0xb41cd58)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb42610e)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/tracing_header_middleware.go:57 (0xb426102)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb41d4d9)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/contextual_logger_middleware.go:52 (0xb41d42a)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb42443e)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/metrics_middleware.go:166 (0xb424428)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/metrics_middleware.go:114 (0xb4235e1)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/metrics_middleware.go:165 (0xb424397)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler.go:37 (0xb42742c)
github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware/tracing_middleware.go:94 (0xb4273f4)
github.com/grafana/grafana-plugin-sdk-go@v0.258.0/backend/handler_middleware.go:80 (0x7790925)
github.com/grafana/grafana/pkg/api/plugin_resource.go:120 (0xb5675bb)
github.com/grafana/grafana/pkg/api/plugin_resource.go:82 (0xb567005)
github.com/grafana/grafana/pkg/api/datasources.go:692 (0xb53b164)
github.com/grafana/grafana/pkg/api/response/web_hack.go:40 (0x839e00f)
net/http/server.go:2220 (0x838c5d8)
github.com/grafana/grafana/pkg/web/macaron.go:131 (0x838c595)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/csp.go:50 (0x8a2a7b3)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/csp.go:41 (0x8a2a506)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/validate_action_url.go:51 (0x8a2e45a)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/services/contexthandler/contexthandler.go:147 (0xb57c56a)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/render.go:51 (0x838d109)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/macaron.go:137 (0x838c674)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/csrf/csrf.go:66 (0xab33b0f)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/recovery.go:180 (0xb5512eb)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/gziper.go:63 (0xb57adeb)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/loggermw/logger.go:72 (0xab34a9e)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/request_metrics.go:82 (0x8a2ceb8)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/request_tracing.go:102 (0xb55221c)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/middleware/requestmeta/request_metadata.go:66 (0xb57ac41)
net/http/server.go:2220 (0x6dd2068)
github.com/grafana/grafana/pkg/web/context.go:52 (0x838ae1a)
github.com/grafana/grafana/pkg/web/router.go:155 (0x838e94d)
github.com/grafana/grafana/pkg/web/router.go:221 (0x838f454)
github.com/grafana/grafana/pkg/web/macaron.go:174 (0x838cabc)
net/http/server.go:3210 (0x6df25cd)
net/http/server.go:2092 (0x6dd0a0f)
runtime/asm_amd64.s:1700 (0x6a4e500)

shawncx commented 21 hours ago

When first login and try loading subscriptions, it was succeeded. But if I do it again, it will always fail.