无法使用mdbc从Azure Powershell Runbook连接到Mongo Atlas数据库。我可以从本地Powershell ISE中执行相同的操作。
$connstring = "mongodb+srv://username:pwd@catsdf-atb1y.azure.mongodb.net/"
#Connect to the database.
Connect-mdbc -ConnectionString $connstring
当我测试Runbook时,这将引发以下错误。
Connect-mdbc : No connection could be established to any of the following name servers: [2001:4860:4860::8844]:53 (Udp:
512), [2001:4860:4860::8888]:53 (Udp: 512), 8.8.4.4:53 (Udp: 512), 8.8.8.8:53 (Udp: 512).
At line:20 char:1
+ Connect-mdbc -ConnectionString $connstring
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-Mdbc], DnsResponseException
+ FullyQualifiedErrorId : DnsClient.DnsResponseException,Mdbc.Commands.ConnectCommand