Check for expiring credentials
The secret is read from the environment only — there is deliberately no
--client-secret flag, because anything on the command line is readable through ps and lands in shell history.Application.Read.All application permission with admin consent. Authentication is Microsoft’s own ClientSecretCredential from @azure/identity, and paging is the Graph SDK’s PageIterator — no Graph URL is built by hand.
Rotate before it lapses
--rotate fixes the expiring-secret finding instead of only reporting it: for each expiring secret it adds a replacement through Graph’s own addPassword action and prints the new value once. The old secret stays valid during the switchover, so rotation needs no downtime; retiring it is your call once the deployment presents the new one.
Certificates are report-only — a key pair is something only you can mint.