简体   繁体   English

无法在远程Azure SQL Server数据库上执行EF Core迁移-未知此类主机

[英]Cannot execute EF Core migration on remote Azure SQL Server database - No such host is known

I try to execute migration on remote, Azure SQL Server database. 我尝试在远程Azure SQL Server数据库上执行迁移。

Command: 命令:

dotnet ef --startup-project ./../Teamdare.Bot database update -e Production

Connection string in appsettings.Production.json : appsettings.Production.json连接字符串:

"ConnectionString": "Server=tcp:project.database.windows.net,1433;Database=project;Persist Security Info=False;User ID=login@project;Password=projectPassword;"

The migrations work for local database and database credentials are correct as well - they work with previous app and by db GUI client. 迁移适用于本地数据库,并且数据库凭据也正确-它们可与以前的应用程序一起使用,并由db GUI客户端使用。

The error: 错误:

One or more errors occurred. 发生一个或多个错误。 (No such host is known) (尚无此类主机)

I tried some variations of connection string, this one seem to be most similar to one provided here: https://www.connectionstrings.com/sql-azure/ 我尝试了一些连接字符串的变体,该变体似乎与此处提供的变体最为相似: https : //www.connectionstrings.com/sql-azure/

当时我使用的是错误的处理程序-我留下了用于PostgreSQL数据库的程序,我们将其用于本地开发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM