{{- if .Values.armAuth -}}
{{- if and (eq .Values.armAuth.type "servicePrincipal") (not .Values.armAuth.existingSecret) -}}
apiVersion: v1
kind: Secret
metadata:
  name: networking-appgw-k8s-azure-service-principal
type: Opaque
data:
  armAuth.json: "{{- required "armAuth.secretJSON is required when using servicePrincipal" .Values.armAuth.secretJSON -}}"
{{- end -}}
{{- end -}}
