通过EF Core自动创建时的默认Azure SQL DB定价 [英] Default Azure SQL DB pricing when created automatically through EF Core

查看:93
本文介绍了通过EF Core自动创建时的默认Azure SQL DB定价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用Entity Framework Core的网络应用.如果为它提供了到Azure上不存在的数据库的连接字符串,则调用dbContext.Database.Migrate()将自动创建它.这对于我们的开发分支非常有用,因为我们用数据库名称等于分支名称的连接字符串来调用它,并且它会自动创建Azure SQL DB资源.

We have a web app that uses Entity Framework Core. If it is given a connection string to a database on Azure that doesn't exist, calling dbContext.Database.Migrate() will create it automatically. This is great for our development branches as we call it with a connection string with a database name equal to the branch name and it creates the Azure SQL DB resource automatically.

当我们开始时,默认情况下似乎是使用DTU定价模型和基本"层创建数据库,这是最便宜的选项,每月5英镑,非常适合开发部门.

When we started it seemed by default to be creating databases with the DTU pricing model and the 'Basic' tier, which is the cheapest option at 5 GBP/month, ideal for development branches.

但是,它似乎已经改变了,默认定价模型现在是vCore General Purpose Generation 5,每月价格为320+英镑!这是我们在发票上注意到的完全不同的地方!

However it seems to have changed and the default pricing model is now vCore General Purpose Generation 5 which comes out at 320+ GBP/month! This is quite a difference that we noticed on our invoice!

是否可以指定创建的默认Azure SQL DB配置?这可能与实体框架无关,但可能是在订阅级别在Azure上进行的设置.

Is there a way to specify the default Azure SQL DB configuration created? This might not be anything to do with entity framework but could be a setting on Azure at the subscription level.

推荐答案

在运行迁移之前,使用正确的选项发布CREATE DATABASE语句,或者甚至更好地使用ARM模板并在发布期间进行部署.

Issue a CREATE DATABASE statement with the correct option before running migrate, or even better use an ARM template and deploy that during release.

这篇关于通过EF Core自动创建时的默认Azure SQL DB定价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆