Figured it out.
Got it to working.
There is a config file inside the apps folder under the add-on, where the proxy settings has to be explicitly mentioned.
Under: /opt/splunk/etc/apps/Splunk_TA_microsoft-cloudservices/local/splunk_ta_ms_o365_client_settings.conf
[proxy]
proxy_enabled = 1
proxy_rdns = 1
proxy_type = http
proxy_password = password of proxy account
proxy_port = 8000
proxy_url = proxy1.your.server.com
disabled = 0
proxy_username = user name of proxy account
... View more