【发布时间】:2022-01-02 14:51:22
【问题描述】:
我正在使用 M1 Max MacBook,并且正在使用 docker 运行 Azure SQL Edge。我在 Azure Data Studio 中创建了一个数据库,其位置为“localhost”,名称为“localhost”。
我正在关注 ASP.NET Core 教程,并试图弄清楚如何重写 AppSettings.json 文件以访问我创建的数据库。现在我不知道如何将我拥有的数据库连接到我在 Visual Studio for Mac 中的项目。我的最终目标是在我的项目中运行“dotnet ef database update”以更新该数据库。对不起,如果这很难理解,我是一个非常大的菜鸟。但这就是我现在在 AppSettings.json 文件中的内容:
{"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Error"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"CodeCamp": "Data Source=localhost;User Id=sa;Password=MyPass@word; Initial Catalog=PSCodeCamp;Integrated Security=True;Connect Timeout=30;"
}
}
【问题讨论】:
-
您可以阅读这篇文章并参考其步骤:database.guide/how-to-install-azure-data-studio-on-a-mac
标签: asp.net azure docker visual-studio asp.net-core