Active Directory密码连接Azure自动化导致Azure SQL失败 [英] Active Directory Password Connection Azure SQL Failure from Azure Automation

查看:93
本文介绍了Active Directory密码连接Azure自动化导致Azure SQL失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用设置为Azure SQL Server AZ AD Admin的Azure Active Directory Admin帐户通过Azure Automation连接到Azure SQL Server.

I need to connect via Azure Automation to an Azure SQL Server using my Azure Active Directory Admin account that is set as the Azure SQL Server AZ AD Admin.

我能够连接到Azure SQL:

I am able to connect to Azure SQL:

  1. 将SSMS与Azure AD管理员帐户一起使用
  2. 在SQL ConnectionString中将PowerShell ISE与Azure AD管理员帐户一起使用
  3. 在SQL ConnectionString中将Azure Automation与Azure SQL Admin帐户(创建新的Azure SQL Server时创建的帐户)一起使用

但是,当尝试使用SQL ConnectionString中的Azure Automation中的Active Directory Admin帐户连接到Azure Automation中的Azure SQL时,出现以下错误:

However, when attempting to connect to Azure SQL in Azure Automation using the Active Directory Admin account in Azure Automation in a SQL ConnectionString, I get the following error:

新对象:使用"1"参数调用".ctor"的异常:关键字 不支持:身份验证"."

New-Object : Exception calling ".ctor" with "1" argument(s): "Keyword not supported: 'authentication'."

这是我的连接尝试:

$server = "tcp:myazuresql.database.windows.net,1433"
$database = "TestDB"
$adminName = "test@mytest.onmicrosoft.com"
$adminPassword = "test1234"

$connectionString = "Server=$server;Database=$database;User ID=$adminName;Password=$adminPassword;authentication=Active Directory Password;"
$connection = New-Object -TypeName System.Data.SqlClient.SqlConnection($connectionString)

关于为什么我可以通过PowerShell ISE和SSMS而不通过Azure Active Directory Admin通过Azure自动化进行连接的任何想法?我还可以通过Azure自动化和Azure SQL管理员帐户(您使用Azure SQL创建的默认管理员帐户)进行连接.

Any ideas on why I can connect via PowerShell ISE and SSMS but not Azure Automation with the Azure Active Directory Admin? I can also connect via Azure Automation and the Azure SQL Admin account (the default admin account you create with Azure SQL).

我无法连接的唯一方法是在使用Azure自动化时使用绑定到Azure SQL的Azure Active Directory管理员.

The only way I can't connect is when using the Azure Active Directory Admin tied to Azure SQL when using Azure Automation.

推荐答案

Azure自动化帐户尚不支持使用Azure AD连接到SQL.此功能需要.NET Framework 4.6,当前Azure自动化工作人员只有.NET Framework. 4.5.

Using Azure AD to connect to SQL is not yet supported with Azure Automation Account.This feature requires .NET Framework 4.6 and currently Azure Automation workers only had .NET Framework 4.5.

建议:

  • 尝试使用SQL Server身份验证自动化,而不是使用Azure Active Password身份验证
  • 尝试使用Hybrid Runbook worker,因为它们能够安装最新版本的.Net Framework(参考: 查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆