Auth pipeline rules are not working as expected after Azure AD authentication

I have set up Auth pipeline rules to add app_metadata to IdToken. This is working fine when the user is logged in using email / pwd. But same is not working when login via MS Azure AD service.