使用 MSI 时的 Azure Sql Db 连接字符串
Azure Sql Db connection string when using MSI
我正在尝试找出在使用 MSI 时要使用的正确 Azure sql 数据库连接字符串
我现在正在通过托管服务标识 (MSI) 向 sql 进行身份验证,并且没有 "username and password"
连接字符串类型为ADO.NET
在使用 MSI 之前,我的连接字符串格式如下:
Server=tcp:sqlserver.azurenet,1433;Initial Catalog=testdb;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets =假;加密=真;TrustServerCertificate=假;身份验证="Active Directory Password";
我只是删除了 用户 ID={your_username};密码={your_password}??
谢谢
使用 MSI 连接到 Azure SQL 时,连接身份验证方法是令牌。因此,您不能使用上面指出的常规连接字符串。
MSI 教程中提供了一个 C# 示例(见下文)
https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-sql
虽然我没有自己尝试过。
谢谢,
米雷克
我正在尝试找出在使用 MSI 时要使用的正确 Azure sql 数据库连接字符串
我现在正在通过托管服务标识 (MSI) 向 sql 进行身份验证,并且没有 "username and password"
连接字符串类型为ADO.NET
在使用 MSI 之前,我的连接字符串格式如下:
Server=tcp:sqlserver.azurenet,1433;Initial Catalog=testdb;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets =假;加密=真;TrustServerCertificate=假;身份验证="Active Directory Password";
我只是删除了 用户 ID={your_username};密码={your_password}??
谢谢
使用 MSI 连接到 Azure SQL 时,连接身份验证方法是令牌。因此,您不能使用上面指出的常规连接字符串。 MSI 教程中提供了一个 C# 示例(见下文) https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-sql 虽然我没有自己尝试过。 谢谢, 米雷克