I had this with an Azure automation runbook. I found that I had to install/import ldap3 and then pyasn1 0.6.1.
The module import on my laptop brought down pyasn1 0.6.1 as well. Looks like Azure Automation didn't.
hth.