All the examples I can find for Authenticating a Runbook use the AzureRM modules:
$connectionName = "AzureRunAsConnection"
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
Add-AzureRmAccount `
-ServicePrincipal `
-TenantId $servicePrincipalConnection.TenantId `
-ApplicationId $servicePrincipalConnection.ApplicationId `
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
However, if you are using the new Az Modules, this code does not work AND you cannot mix AzureRM Modules AND Az Modules in the same Runbook. How do you get authentication to work with the new Az Modules.