我将grafana与azure广告集成,但在登录过程中它给出了登录失败的错误请求

问题描述 投票:0回答:1

我想知道为什么会发生这种情况。我已经添加了客户端 ID 和秘密身份验证,并获取了身份验证所需的所有内容的 url 我不知道为什么会发生这种情况。在应用程序注册中,我也给出了正确的 uri。给予足够的权限.

azure azure-active-directory grafana microsoft-entra-id azure-app-registration
1个回答
0
投票

以下是使用 Azure AD 配置 Grafana 身份验证所需的步骤。

  1. 登录到 Azure 门户 (https://portal.azure.com/),然后单击侧面菜单中的 Azure Active Directory。
  2. 导航到“Azure Active Directory”并选择“应用程序注册”。
  3. 单击“新注册”创建新的应用程序注册。
  4. 提供应用程序的名称,然后为 Grafana 选择适当的重定向 URI,例如 https://your-grafana-url/login/azureadhttps://your-grafana-url。确保 Azure AD 中的重定向 URI 与 Grafana 中配置的 URI 完全匹配。然后点击注册。
  5. 注册应用程序后,将打开应用程序的概述页面。记下“应用程序(客户端)ID”和“目录(租户)ID”。

enter image description here

  1. 在“证书和机密”部分下,生成客户端机密,并确保安全记下它。

enter image description here

到目前为止,上述步骤保持不变。

  1. 这里我将在 aks 集群上通过 helmchart 使用 grafana,因此使用这种方法相应地为 grafana 添加 helm 图表

    头盔初始化 helm 仓库添加 grafana https://grafana.github.io/helm-charts 舵回购更新

在Grafana helm图表中,我们可以使用values.yaml文件设置配置值。以下是要在 grafana.ini 部分下的 value.yaml 中添加的示例配置:

grafana.ini:  
auth.azuread:  
name:  Azure  AD  
enabled:  true  
allow_sign_up:  true  
auto_login  =  false  
client_id:  YOUR_CLIENT_ID  
client_secret:  YOUR_SECRET_ID  
scopes:  openid  email  profile  
auth_url:  
https://login.microsoftonline.com/AZURE_TENENT_ID/oauth2/v2.0/authorize  
token_url:  https://login.microsoftonline.com/AZURE_TENENT_ID/oauth2/v2.0/token  
allowed_groups:  GROUP_OBJECT_ID  
allowed_organizations:  TENANT_ID

您已经在上述 AD 步骤中保存了这些客户端 ID 和密码。在这里添加这些。

  1. 使用 Helm Chart 安装或升级 Grafana
helm upgrade -install chart_name -f values.yaml

你的grafana就准备好了。

第二个选项-

如果您只是设置标准 grafana 实例,而不是将其部署在 AKS 上,请转到 azure 门户 -> Azure 托管 Grafana -> 创建新实例,然后按照 MS 文档链接中提供的步骤进行操作。只需确保您在通过门户或 cli 设置 grafana 时选择了托管身份即可。

enter image description here

准备好后,您可以通过提供的端点访问它 enter image description here enter image description here

参考:

在 AKS 上管理 Grafana MS Doc 管理 Grafana

© www.soinside.com 2019 - 2024. All rights reserved.