{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "az-appconfig-k8s-provider.serviceAccountName" . }}
  labels:
    {{ include "az-appconfig-k8s-provider.labels" . | nindent 4 }}
  annotations:
    {{- if .Values.serviceAccount.annotations }}
    {{ toYaml .Values.serviceAccount.annotations | nindent 4 }}
    {{- end }}
    {{- if and (.Values.workloadIdentity.enabled) (.Values.workloadIdentity.globalServiceAccountEnabled) }}
    azure.workload.identity/client-id: ""
    {{- end }}
{{- end }}