Azure SQL DB超规模ServiceObjectiveName/Cores

Azure SQL DB超规模ServiceObjectiveName/Cores,azure,azure-sql-database,azure-sdk,Azure,Azure Sql Database,Azure Sdk,我正在使用azure libraries for.net SDK,遇到了一个问题 如果DatabaseEdition为Hyperscale,ServiceObjectiveName的可用选项有哪些 当我创建一个超刻度数据库时,ServiceObjectiveName默认值是Gen4。有没有办法指定Gen5和核心数量 我找到了ServiceObjectiveNames列表,但它们似乎都与超尺度值无关。 基本DS100 DS1000 DS1200 DS1500 DS200 DS2000 DS300

我正在使用azure libraries for.net SDK,遇到了一个问题

如果DatabaseEdition为Hyperscale,ServiceObjectiveName的可用选项有哪些

当我创建一个超刻度数据库时,ServiceObjectiveName默认值是Gen4。有没有办法指定Gen5和核心数量

我找到了ServiceObjectiveNames列表,但它们似乎都与超尺度值无关。

基本DS100 DS1000 DS1200 DS1500 DS200 DS2000 DS300 DS400 DS500 DS600 DW100 DW1000 DW10000c DW1000c DW1200 DW1500 DW15000c DW1500c DW200 DW2000 DW2000c DW2500c DW300 DW3000 DW30000c DW3000c DW400 DW500 DW5000c DW600 DW6000 DW6000c DW7500c弹性池自由P1 P11 P15 P2 P3 P4 P6 PRS1 PRS2 PRS4 PRS6 S0 S1 S12 S2 S3 S4 S6 S7 S9系统 系统0系统1系统2系统2L系统3系统3L系统4系统4L
根据我的测试,如果我们使用创建超大规模Gen5数据库,我们可以使用ServiceObjectiveName.Parse方法指定Gen5和核心数量

比如说

如果我们使用ServiceObjectiveName.ParseHS_Gen5_2,这意味着该数据库是超规模的:Gen5,2 vCores

详细的STEP如下所示:

创建服务主体并将角色分配给sp 代码:

不错!非常感谢你。这是一种非常直观的方法来解决这个问题。您是否碰巧知道可以在该解析方法中输入的所有可能值?Nvm。我想我是在这里找到的:
az ad sp create-for-rbac --name ServicePrincipalName --role contributor
var tenantId = "<your tenant id>";
            var clientId = "<your sp app id>";
            var clientSecret = <your sp password>;

            var SubscriptionId = "<your subscription id>";

            var credentials = SdkContext.AzureCredentialsFactory.FromServicePrincipal(
                                    clientId,
                                    clientSecret,
                                    tenantId,
                                    AzureEnvironment.AzureGlobalCloud);
            var azure = Microsoft.Azure.Management.Fluent.Azure.Configure()
                        .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
                        .Authenticate(credentials)
                        .WithSubscription(SubscriptionId);

            var sqlServer = azure.SqlServers.GetByResourceGroup("test", "testsql07");
            Console.WriteLine(sqlServer.Name);

            var database = await sqlServer.Databases.Define("test1")
                                                   .WithEdition(DatabaseEdition.Hyperscale)
                                                   .WithServiceObjective(ServiceObjectiveName.Parse("HS_Gen5_2"))
                                                   .CreateAsync();
            Console.WriteLine(database.Edition.Value);
            Console.WriteLine(database.RequestedServiceObjectiveName.Value);