Hello,
The multi factor authentication cannot be automated, as a large point of the multi factor is to provide secure authentication from a human that is logging in with multiple points of security from said human to prove their identity.
Perhaps you could utilize a different authentication protocol, such as providing the sharepoint server a service principal that has exclusive access to your azure development pipeline.
If your azure dev pipeline is utilizing AAD OAuth2 you would be able to utilize the AAD Client Credential flow. https://learn.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow
Note per the post below, for further help on this azure devops pipeline authentication question please open a developer community item with the tag [AltCreds] in the title. For faster service, please search for [AltCreds] in the developer community forum first, as your question might already be answered. You can reach out to us on Twitter at @Azure Dev Ops too.
https://devblogs.microsoft.com/devops/azure-devops-will-no-longer-support-alternate-credentials-authentication/
Reference Links : https://developercommunity.visualstudio.com/spaces/8/index.html
https://twitter.com/AzureDevOps
Please remember to mark one of the responses as answer if your question has been answered. If not please let us know if there are anymore questions.