Hello Raviteja,
From a similar post found at https://learn.microsoft.com/en-us/answers/questions/1006937/terraform-script-to-enable-azure-ad-login-feature
AAD login is enabled via VM extension. You can find the details about the extension via the following CLI command. The name for the Windows extension is AADLoginForWindows and for Linux it is AADLoginForLinux. Deploying extension via terraform is here.
If this is helpful please accept answer.