To rotate the keyfile using the API instead of the user interface, see Rotate a Key File with the API.
To perform a rolling keyfile rotation:
Authentication must be enabled.
At least one cluster in the project must be configured with the clusterAuthMode option set to
All clusters in the project must be running MongoDB version 4.2 or higher.
If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
If it is not already displayed, click Deployment in the sidebar.
Click the Security tab.
Click the Settings tab.