You might want to consider the following:
1. Restrict Login to Specific IP Ranges
- Configure a Conditional Access policy to restrict the account’s login access to specific, trusted IP ranges (e.g., on-premises networks or a secure VPN).
- Ensure the IP ranges are tightly controlled to reduce exposure.
- Avoid allowing access from public IPs or unknown locations.
2. Block Interactive Logins
- If the account is exclusively used for scripts and automation:
- Use a Conditional Access policy to block interactive logins (client apps set to Browser and Modern authentication clients).
3. Enable Risk-Based Alerts
- Azure AD Identity Protection:
- Enable alerts for suspicious activities like login attempts from unfamiliar locations, devices, or impossible travel scenarios.
- Use the Risky sign-ins and Identity Protection risk detection to monitor real-time activity and respond to flagged anomalies.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin