Microsoft Authenticator is Time-based OTP that is equivalent to Google Authenticator.
There are some examples of how to use F5 with Google Authenticator.
Btw, if this response suits you, please don't forget to give some thumbs up or mark the response as "resolved" to let other people to find it.
No mate, this iRule is for GA verifying.
Take into account that there are several steps involved on using Time-based OTP.
In a production enviroment, F5 should only be doing the third step.
In my lab, I have the user key generated already stored in my A/D.
If my user wants to figure out what the key they have is, then uses a APM policy which captures the user key (LDAP query) and redirects this info to a PHP QR-code generator. Base on this syntax:
This is my PHP QR-Code generator
After my user has the TOTP key already installed in their device, this previous iRule enters into play.
To be more precise, I'm using this API REST iRule to verify if the validation was passed.
BTW, with "generate_ga_code" I think you mean this iRule.
But never tested, I recommend you to work in the approach I mentioned previously.