apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    grafana_datasource: "1"
  name: azure-datasource-configmap
  namespace: monitoring
data:
  azure-datasource.yaml: |
    apiVersion: 1
    datasources:
    - name: Azure Monitor
      type: grafana-azure-monitor-datasource
      orgId: 1
      typeLogoUrl: public/plugins/grafana-azure-monitor-datasource/img/logo.jpg
      access: proxy
      url: /api/datasources/proxy/2
      isDefault: false
      jsonData:
        cloudName: azuremonitor
        subscriptionId: {{ .Values.subscriptionId }}
        tenantId: {{ .Values.tenantId }}
        clientId: {{ .Values.clientId }}
        logAnalyticsDefaultWorkspace: {{ .Values.workspace }}
        azureLogAnalyticsSameAs: true
        logAnalyticsSubscriptionId: {{ .Values.subscriptionId }}
        logAnalyticsTenantId: {{ .Values.tenantId }}
        logAnalyticsClientId: {{ .Values.clientId }}
      keepCookies: []
      secureJsonData:
        clientSecret: {{ .Values.secret }}
        logAnalyticsClientSecret: {{ .Values.secret }}
      editable: true
