我的设置中所有组件都位于 Azure 云中,我想针对 Azure DevOps 发布管道中的 Azure SQL 数据库进行实体框架迁移。
在 Azure Devops 中运行发布管道时,发布管道在“服务原则”下运行,我必须授予具有提升权限的数据库访问权限。 迁移需要用户名和密码,但这并不安全,我不想使用它。
我该怎么做? 这是验证 Azure Devops 和数据库之间连接的正确方法吗?
介绍的 EF Core 迁移捆绑包来执行 EF 迁移。 尝试在管道中运行以下步骤:
dotnet tool install --global dotnet-ef --version xxxx
或更新捆绑包。
dotnet tool update --global dotnet-ef --version xxxx
dotnet ef migrations bundle
./bundle --connection {connection strin}
应用迁移”中提到的相关命令行。