This article is amazing, recommend it https://arantes.net.br/posts/service-principal-secret-certificate-expire-report/