エラスティック プールを作成または更新します。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}?api-version=2025-01-01
URI パラメーター
| 名前 |
/ |
必須 |
型 |
説明 |
|
elasticPoolName
|
path |
True
|
string
|
エラスティック プールの名前。
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
リソース グループの名前。 名前の大文字と小文字は区別されません。
|
|
serverName
|
path |
True
|
string
|
サーバーの名前。
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
ターゲット サブスクリプションの ID。 値は UUID である必要があります。
|
|
api-version
|
query |
True
|
string
minLength: 1
|
この操作に使用する API バージョン。
|
要求本文
| 名前 |
必須 |
型 |
説明 |
|
location
|
True
|
string
|
リソースが存在する地理的な場所
|
|
properties.autoPauseDelay
|
|
integer
(int32)
|
エラスティック プールが自動的に一時停止されるまでの時間 (分)。 -1 の値は、自動一時停止が無効になっていることを意味します
|
|
properties.availabilityZone
|
|
AvailabilityZoneType
|
プールのプライマリ レプリカがピン留めされている可用性ゾーンを指定します。
|
|
properties.highAvailabilityReplicaCount
|
|
integer
(int32)
|
高可用性を提供するために使用される Business Critical、Premium、または Hyperscale エディションのエラスティック プールに関連付けられているセカンダリ レプリカの数。 Hyperscale エラスティック プールにのみ適用されます。
|
|
properties.licenseType
|
|
ElasticPoolLicenseType
|
このエラスティック プールに適用するライセンスの種類。
|
|
properties.maintenanceConfigurationId
|
|
string
|
エラスティック プールに割り当てられたメンテナンス構成 ID。 この構成では、メンテナンスの更新が行われる期間を定義します。
|
|
properties.maxSizeBytes
|
|
integer
(int64)
|
データベース エラスティック プールのストレージ制限 (バイト単位)。
|
|
properties.minCapacity
|
|
number
(double)
|
一時停止されていない場合、サーバーレス プールが以下に縮小しない最小容量
|
|
properties.perDatabaseSettings
|
|
ElasticPoolPerDatabaseSettings
|
エラスティック プールのデータベースごとの設定。
|
|
properties.preferredEnclaveType
|
|
AlwaysEncryptedEnclaveType
|
エラスティック プールで要求されたエンクレーブの種類。
|
|
properties.zoneRedundant
|
|
boolean
|
このエラスティック プールがゾーン冗長であるかどうか。つまり、このエラスティック プールのレプリカは複数の可用性ゾーンに分散されます。
|
|
sku
|
|
Sku
|
エラスティック プール SKU。
SKU の一覧は、リージョンとサポート プランによって異なる場合があります。 Azureリージョンでサブスクリプションで利用可能なSKU(SKU名、ティア/エディション、ファミリー、容量を含む)を特定するには、Capabilities_ListByLocation REST APIまたは以下のコマンドを使用します。
az sql elastic-pool list-editions -l <location> -o table
|
|
tags
|
|
object
|
リソース タグ。
|
応答
| 名前 |
型 |
説明 |
|
200 OK
|
ElasticPool
|
リソース「ElasticPool」更新操作が成功しました
|
|
201 Created
|
ElasticPool
|
リソース「ElasticPool」作成操作が成功しました
ヘッダー
Azure-AsyncOperation: string
|
|
202 Accepted
|
|
リソース操作が受け入れられます。
ヘッダー
- Location: string
- Retry-After: integer
|
|
Other Status Codes
|
ErrorResponse
|
予期しないエラー応答。
|
セキュリティ
azure_auth
Azure Active Directory OAuth2 Flow.
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
| 名前 |
説明 |
|
user_impersonation
|
ユーザー アカウントを偽装する
|
例
Create or Update an elastic pool with Availability Zone
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
{
"location": "Japan East",
"properties": {
"availabilityZone": "1",
"perDatabaseSettings": {
"maxCapacity": 2,
"minCapacity": 0.25
},
"zoneRedundant": true
},
"sku": {
"name": "HS_Gen5_4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python create_elastic_pool_with_availability_zone.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.begin_create_or_update(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
parameters={
"location": "Japan East",
"properties": {
"availabilityZone": "1",
"perDatabaseSettings": {"maxCapacity": 2, "minCapacity": 0.25},
"zoneRedundant": True,
},
"sku": {"name": "HS_Gen5_4"},
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/CreateElasticPoolWithAvailabilityZone.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an elastic pool.
*
* @summary creates or updates an elastic pool.
* x-ms-original-file: 2025-01-01/CreateElasticPoolWithAvailabilityZone.json
*/
async function createOrUpdateAnElasticPoolWithAvailabilityZone() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.createOrUpdate(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
{
location: "Japan East",
availabilityZone: "1",
perDatabaseSettings: { maxCapacity: 2, minCapacity: 0.25 },
zoneRedundant: true,
sku: { name: "HS_Gen5_4" },
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateElasticPoolWithAvailabilityZone.json
// this example is just showing the usage of "ElasticPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
ElasticPoolData data = new ElasticPoolData(new AzureLocation("Japan East"))
{
Sku = new SqlSku("HS_Gen5_4"),
PerDatabaseSettings = new ElasticPoolPerDatabaseSettings
{
MinCapacity = 0.25,
MaxCapacity = 2,
},
IsZoneRedundant = true,
AvailabilityZone = SqlAvailabilityZoneType.One,
};
ArmOperation<ElasticPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticPoolName, data);
ElasticPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"availabilityZone": "1",
"creationDate": "2017-02-10T01:25:25.033Z",
"maxSizeBytes": 102400,
"perDatabaseSettings": {
"maxCapacity": 2,
"minCapacity": 0.25
},
"state": "Ready",
"zoneRedundant": true
},
"sku": {
"name": "StandardPool",
"capacity": 100,
"tier": "Standard"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2022-08-01
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"availabilityZone": "1",
"creationDate": "2017-02-10T01:25:25.033Z",
"maxSizeBytes": 102400,
"perDatabaseSettings": {
"maxCapacity": 2,
"minCapacity": 0.25
},
"state": "Ready"
},
"sku": {
"name": "StandardPool",
"capacity": 100,
"tier": "Standard"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2022-08-01
Create or Update an elastic pool with serverless properties
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
{
"location": "Japan East",
"properties": {
"autoPauseDelay": 60,
"minCapacity": 0.5,
"perDatabaseSettings": {
"autoPauseDelay": 80,
"maxCapacity": 2,
"minCapacity": 0
}
},
"sku": {
"name": "GP_S_Gen5_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python elastic_pool_create_or_update_serverless_properties.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.begin_create_or_update(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
parameters={
"location": "Japan East",
"properties": {
"autoPauseDelay": 60,
"minCapacity": 0.5,
"perDatabaseSettings": {"autoPauseDelay": 80, "maxCapacity": 2, "minCapacity": 0},
},
"sku": {"capacity": 2, "name": "GP_S_Gen5_2", "tier": "GeneralPurpose"},
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/ElasticPoolCreateOrUpdateServerlessProperties.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an elastic pool.
*
* @summary creates or updates an elastic pool.
* x-ms-original-file: 2025-01-01/ElasticPoolCreateOrUpdateServerlessProperties.json
*/
async function createOrUpdateAnElasticPoolWithServerlessProperties() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.createOrUpdate(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
{
location: "Japan East",
autoPauseDelay: 60,
minCapacity: 0.5,
perDatabaseSettings: { autoPauseDelay: 80, maxCapacity: 2, minCapacity: 0 },
sku: { name: "GP_S_Gen5_2", capacity: 2, tier: "GeneralPurpose" },
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateServerlessProperties.json
// this example is just showing the usage of "ElasticPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
ElasticPoolData data = new ElasticPoolData(new AzureLocation("Japan East"))
{
Sku = new SqlSku("GP_S_Gen5_2")
{
Tier = "GeneralPurpose",
Capacity = 2,
},
MinCapacity = 0.5,
PerDatabaseSettings = new ElasticPoolPerDatabaseSettings
{
MinCapacity = 0,
MaxCapacity = 2,
AutoPauseDelay = 80,
},
AutoPauseDelay = 60,
};
ArmOperation<ElasticPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticPoolName, data);
ElasticPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"autoPauseDelay": 60,
"creationDate": "2017-02-10T01:25:25.033Z",
"maxSizeBytes": 102400,
"minCapacity": 0.5,
"perDatabaseSettings": {
"autoPauseDelay": 80,
"maxCapacity": 2,
"minCapacity": 0
},
"state": "Ready"
},
"sku": {
"name": "GP_S_Gen5_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2023-05-01
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"autoPauseDelay": 60,
"creationDate": "2017-02-10T01:25:25.033Z",
"maxSizeBytes": 102400,
"minCapacity": 0.5,
"perDatabaseSettings": {
"autoPauseDelay": 80,
"maxCapacity": 2,
"minCapacity": 0
},
"state": "Ready"
},
"sku": {
"name": "GP_S_Gen5_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2023-05-01
Create or update elastic pool with all parameter
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
{
"location": "Japan East",
"properties": {
"perDatabaseSettings": {
"maxCapacity": 2,
"minCapacity": 0.25
}
},
"sku": {
"name": "GP_Gen4_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python elastic_pool_create_or_update_max.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.begin_create_or_update(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
parameters={
"location": "Japan East",
"properties": {"perDatabaseSettings": {"maxCapacity": 2, "minCapacity": 0.25}},
"sku": {"capacity": 2, "name": "GP_Gen4_2", "tier": "GeneralPurpose"},
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/ElasticPoolCreateOrUpdateMax.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an elastic pool.
*
* @summary creates or updates an elastic pool.
* x-ms-original-file: 2025-01-01/ElasticPoolCreateOrUpdateMax.json
*/
async function createOrUpdateElasticPoolWithAllParameter() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.createOrUpdate(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
{
location: "Japan East",
perDatabaseSettings: { maxCapacity: 2, minCapacity: 0.25 },
sku: { name: "GP_Gen4_2", capacity: 2, tier: "GeneralPurpose" },
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateMax.json
// this example is just showing the usage of "ElasticPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
ElasticPoolData data = new ElasticPoolData(new AzureLocation("Japan East"))
{
Sku = new SqlSku("GP_Gen4_2")
{
Tier = "GeneralPurpose",
Capacity = 2,
},
PerDatabaseSettings = new ElasticPoolPerDatabaseSettings
{
MinCapacity = 0.25,
MaxCapacity = 2,
},
};
ArmOperation<ElasticPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticPoolName, data);
ElasticPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"maxSizeBytes": 5242880000,
"perDatabaseSettings": {
"maxCapacity": 2,
"minCapacity": 0.25
},
"state": "Ready"
},
"sku": {
"name": "GP_Gen4_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2017-10-01
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"maxSizeBytes": 5242880000,
"perDatabaseSettings": {
"maxCapacity": 2,
"minCapacity": 0.25
},
"state": "Ready"
},
"sku": {
"name": "GP_Gen4_2",
"capacity": 2,
"tier": "GeneralPurpose"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2017-10-01
Create or update elastic pool with maintenance configuration parameter
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
{
"location": "Japan East",
"properties": {
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python elastic_pool_create_or_update_set_maintenance_configuration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.begin_create_or_update(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
parameters={
"location": "Japan East",
"properties": {
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"
},
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an elastic pool.
*
* @summary creates or updates an elastic pool.
* x-ms-original-file: 2025-01-01/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json
*/
async function createOrUpdateElasticPoolWithMaintenanceConfigurationParameter() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.createOrUpdate(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
{
location: "Japan East",
maintenanceConfigurationId:
"/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json
// this example is just showing the usage of "ElasticPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
ElasticPoolData data = new ElasticPoolData(new AzureLocation("Japan East"))
{
MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"),
};
ArmOperation<ElasticPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticPoolName, data);
ElasticPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1",
"maxSizeBytes": 102400,
"perDatabaseSettings": {
"maxCapacity": 100,
"minCapacity": 0
},
"state": "Ready"
},
"sku": {
"name": "StandardPool",
"capacity": 100,
"tier": "Standard"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2020-08-01
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1",
"maxSizeBytes": 102400,
"perDatabaseSettings": {
"maxCapacity": 100,
"minCapacity": 0
},
"state": "Ready"
},
"sku": {
"name": "StandardPool",
"capacity": 100,
"tier": "Standard"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2020-08-01
Create or update elastic pool with minimum parameters
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
{
"location": "Japan East"
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python elastic_pool_create_or_update_min.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.begin_create_or_update(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
parameters={"location": "Japan East"},
).result()
print(response)
# x-ms-original-file: 2025-01-01/ElasticPoolCreateOrUpdateMin.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an elastic pool.
*
* @summary creates or updates an elastic pool.
* x-ms-original-file: 2025-01-01/ElasticPoolCreateOrUpdateMin.json
*/
async function createOrUpdateElasticPoolWithMinimumParameters() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.createOrUpdate(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
{ location: "Japan East" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateMin.json
// this example is just showing the usage of "ElasticPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
ElasticPoolData data = new ElasticPoolData(new AzureLocation("Japan East"));
ArmOperation<ElasticPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticPoolName, data);
ElasticPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"maxSizeBytes": 102400,
"perDatabaseSettings": {
"maxCapacity": 100,
"minCapacity": 0
},
"state": "Ready"
},
"sku": {
"name": "StandardPool",
"capacity": 100,
"tier": "Standard"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2017-10-01
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": null,
"location": "Japan East",
"properties": {
"creationDate": "2017-02-10T01:25:25.033Z",
"maxSizeBytes": 102400,
"perDatabaseSettings": {
"maxCapacity": 100,
"minCapacity": 0
},
"state": "Ready"
},
"sku": {
"name": "StandardPool",
"capacity": 100,
"tier": "Standard"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2017-10-01
Create or update elastic pool with preferred enclave type parameter as Default
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
{
"location": "Japan East",
"properties": {
"preferredEnclaveType": "Default"
},
"sku": {
"name": "GP_Gen5_4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python elastic_pool_create_with_default_preferred_enclave_type.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.begin_create_or_update(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
parameters={
"location": "Japan East",
"properties": {"preferredEnclaveType": "Default"},
"sku": {"name": "GP_Gen5_4"},
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/ElasticPoolCreateWithDefaultPreferredEnclaveType.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an elastic pool.
*
* @summary creates or updates an elastic pool.
* x-ms-original-file: 2025-01-01/ElasticPoolCreateWithDefaultPreferredEnclaveType.json
*/
async function createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsDefault() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.createOrUpdate(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
{ location: "Japan East", preferredEnclaveType: "Default", sku: { name: "GP_Gen5_4" } },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateWithDefaultPreferredEnclaveType.json
// this example is just showing the usage of "ElasticPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
ElasticPoolData data = new ElasticPoolData(new AzureLocation("Japan East"))
{
Sku = new SqlSku("GP_Gen5_4"),
PreferredEnclaveType = SqlAlwaysEncryptedEnclaveType.Default,
};
ArmOperation<ElasticPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticPoolName, data);
ElasticPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": "vcore,pool",
"location": "Japan East",
"properties": {
"creationDate": "2022-08-26T03:46:20.57Z",
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 0,
"perDatabaseSettings": {
"maxCapacity": 4,
"minCapacity": 0
},
"preferredEnclaveType": "Default",
"state": "Ready",
"zoneRedundant": false
},
"sku": {
"name": "GP_Gen5",
"capacity": 4,
"family": "Gen5",
"tier": "GeneralPurpose"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2022-08-01
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": "vcore,pool",
"location": "Japan East",
"properties": {
"creationDate": "2022-08-26T03:46:20.57Z",
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 0,
"perDatabaseSettings": {
"maxCapacity": 4,
"minCapacity": 0
},
"preferredEnclaveType": "Default",
"state": "Ready",
"zoneRedundant": false
},
"sku": {
"name": "GP_Gen5",
"capacity": 4,
"family": "Gen5",
"tier": "GeneralPurpose"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2022-08-01
Create or update elastic pool with preferred enclave type parameter as VBS
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
{
"location": "Japan East",
"properties": {
"preferredEnclaveType": "VBS"
},
"sku": {
"name": "GP_Gen5_4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python elastic_pool_create_with_vbs_preferred_enclave_type.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.begin_create_or_update(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
parameters={
"location": "Japan East",
"properties": {"preferredEnclaveType": "VBS"},
"sku": {"name": "GP_Gen5_4"},
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/ElasticPoolCreateWithVBSPreferredEnclaveType.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an elastic pool.
*
* @summary creates or updates an elastic pool.
* x-ms-original-file: 2025-01-01/ElasticPoolCreateWithVBSPreferredEnclaveType.json
*/
async function createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsVBS() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.createOrUpdate(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
{ location: "Japan East", preferredEnclaveType: "VBS", sku: { name: "GP_Gen5_4" } },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateWithVBSPreferredEnclaveType.json
// this example is just showing the usage of "ElasticPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
ElasticPoolData data = new ElasticPoolData(new AzureLocation("Japan East"))
{
Sku = new SqlSku("GP_Gen5_4"),
PreferredEnclaveType = SqlAlwaysEncryptedEnclaveType.Vbs,
};
ArmOperation<ElasticPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticPoolName, data);
ElasticPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": "vcore,pool",
"location": "Japan East",
"properties": {
"creationDate": "2022-08-26T03:46:20.57Z",
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 0,
"perDatabaseSettings": {
"maxCapacity": 4,
"minCapacity": 0
},
"preferredEnclaveType": "VBS",
"state": "Ready",
"zoneRedundant": false
},
"sku": {
"name": "GP_Gen5",
"capacity": 4,
"family": "Gen5",
"tier": "GeneralPurpose"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2022-08-01
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": "vcore,pool",
"location": "Japan East",
"properties": {
"creationDate": "2022-08-26T03:46:20.57Z",
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 0,
"perDatabaseSettings": {
"maxCapacity": 4,
"minCapacity": 0
},
"preferredEnclaveType": "VBS",
"state": "Ready",
"zoneRedundant": false
},
"sku": {
"name": "GP_Gen5",
"capacity": 4,
"family": "Gen5",
"tier": "GeneralPurpose"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2022-08-01
Create or update Hyperscale elastic pool with high availability replica count parameter
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102?api-version=2025-01-01
{
"location": "Japan East",
"properties": {
"highAvailabilityReplicaCount": 2
},
"sku": {
"name": "HS_Gen5_4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.elastic_pools.begin_create_or_update(
resource_group_name="sqlcrudtest-2369",
server_name="sqlcrudtest-8069",
elastic_pool_name="sqlcrudtest-8102",
parameters={
"location": "Japan East",
"properties": {"highAvailabilityReplicaCount": 2},
"sku": {"name": "HS_Gen5_4"},
},
).result()
print(response)
# x-ms-original-file: 2025-01-01/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SqlManagementClient } = require("@azure/arm-sql");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an elastic pool.
*
* @summary creates or updates an elastic pool.
* x-ms-original-file: 2025-01-01/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json
*/
async function createOrUpdateHyperscaleElasticPoolWithHighAvailabilityReplicaCountParameter() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.elasticPools.createOrUpdate(
"sqlcrudtest-2369",
"sqlcrudtest-8069",
"sqlcrudtest-8102",
{ location: "Japan East", highAvailabilityReplicaCount: 2, sku: { name: "HS_Gen5_4" } },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json
// this example is just showing the usage of "ElasticPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-2369";
string serverName = "sqlcrudtest-8069";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this ElasticPoolResource
ElasticPoolCollection collection = sqlServer.GetElasticPools();
// invoke the operation
string elasticPoolName = "sqlcrudtest-8102";
ElasticPoolData data = new ElasticPoolData(new AzureLocation("Japan East"))
{
Sku = new SqlSku("HS_Gen5_4"),
HighAvailabilityReplicaCount = 2,
};
ArmOperation<ElasticPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticPoolName, data);
ElasticPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ElasticPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": "vcore,pool",
"location": "Japan East",
"properties": {
"creationDate": "2021-08-26T03:46:20.57Z",
"highAvailabilityReplicaCount": 2,
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 0,
"perDatabaseSettings": {
"maxCapacity": 4,
"minCapacity": 0
},
"state": "Ready",
"zoneRedundant": false
},
"sku": {
"name": "HS_Gen5",
"capacity": 4,
"family": "Gen5",
"tier": "Hyperscale"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2021-08-01
{
"name": "sqlcrudtest-8102",
"type": "Microsoft.Sql/servers/elasticPools",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102",
"kind": "vcore,pool",
"location": "Japan East",
"properties": {
"creationDate": "2021-08-26T03:46:20.57Z",
"highAvailabilityReplicaCount": 2,
"licenseType": "LicenseIncluded",
"maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 0,
"perDatabaseSettings": {
"maxCapacity": 4,
"minCapacity": 0
},
"state": "Ready",
"zoneRedundant": false
},
"sku": {
"name": "HS_Gen5",
"capacity": 4,
"family": "Gen5",
"tier": "Hyperscale"
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/locations/japaneast1/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2021-08-01
定義
AlwaysEncryptedEnclaveType
列挙
データベースで要求されたエンクレーブの種類 (既定または VBS エンクレーブ)。
| 値 |
説明 |
|
Default
|
デフォルト
|
|
VBS
|
VBS
|
AvailabilityZoneType
列挙
データベースがピン留めされる可用性ゾーンを指定します。
| 値 |
説明 |
|
NoPreference
|
ノープリファレンス
|
|
1
|
1
|
|
2
|
2
|
|
3
|
3
|
createdByType
列挙
リソースを作成した ID の種類。
| 値 |
説明 |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ElasticPool
Object
エラスティック プール。
| 名前 |
型 |
説明 |
|
id
|
string
(arm-id)
|
リソースの完全修飾リソース ID。 例: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
kind
|
string
|
エラスティック プールの種類。 これはAzureポータル体験で使用されるメタデータです。
|
|
location
|
string
|
リソースが存在する地理的な場所
|
|
name
|
string
|
リソースの名前
|
|
properties.autoPauseDelay
|
integer
(int32)
|
エラスティック プールが自動的に一時停止されるまでの時間 (分)。 -1 の値は、自動一時停止が無効になっていることを意味します
|
|
properties.availabilityZone
|
AvailabilityZoneType
|
プールのプライマリ レプリカがピン留めされている可用性ゾーンを指定します。
|
|
properties.creationDate
|
string
(date-time)
|
エラスティック プールの作成日 (ISO8601形式)。
|
|
properties.highAvailabilityReplicaCount
|
integer
(int32)
|
高可用性を提供するために使用される Business Critical、Premium、または Hyperscale エディションのエラスティック プールに関連付けられているセカンダリ レプリカの数。 Hyperscale エラスティック プールにのみ適用されます。
|
|
properties.licenseType
|
ElasticPoolLicenseType
|
このエラスティック プールに適用するライセンスの種類。
|
|
properties.maintenanceConfigurationId
|
string
|
エラスティック プールに割り当てられたメンテナンス構成 ID。 この構成では、メンテナンスの更新が行われる期間を定義します。
|
|
properties.maxSizeBytes
|
integer
(int64)
|
データベース エラスティック プールのストレージ制限 (バイト単位)。
|
|
properties.minCapacity
|
number
(double)
|
一時停止されていない場合、サーバーレス プールが以下に縮小しない最小容量
|
|
properties.perDatabaseSettings
|
ElasticPoolPerDatabaseSettings
|
エラスティック プールのデータベースごとの設定。
|
|
properties.preferredEnclaveType
|
AlwaysEncryptedEnclaveType
|
エラスティック プールで要求されたエンクレーブの種類。
|
|
properties.state
|
ElasticPoolState
|
エラスティック プールの状態。
|
|
properties.zoneRedundant
|
boolean
|
このエラスティック プールがゾーン冗長であるかどうか。つまり、このエラスティック プールのレプリカは複数の可用性ゾーンに分散されます。
|
|
sku
|
Sku
|
エラスティック プール SKU。
SKU の一覧は、リージョンとサポート プランによって異なる場合があります。 Azureリージョンでサブスクリプションで利用可能なSKU(SKU名、ティア/エディション、ファミリー、容量を含む)を特定するには、Capabilities_ListByLocation REST APIまたは以下のコマンドを使用します。
az sql elastic-pool list-editions -l <location> -o table
|
|
systemData
|
systemData
|
create By と modifiedBy の情報を含む Azure Resource Manager メタデータ。
|
|
tags
|
object
|
リソース タグ。
|
|
type
|
string
|
リソースの型。 例えば「Microsoft。Compute/virtualMachines」または「Microsoft」などです。ストレージ/ストレージアカウント」
|
ElasticPoolLicenseType
列挙
このエラスティック プールに適用するライセンスの種類。
| 値 |
説明 |
|
LicenseIncluded
|
ライセンス含録
|
|
BasePrice
|
BasePrice
|
ElasticPoolPerDatabaseSettings
Object
エラスティック プールのデータベースごとの設定。
| 名前 |
型 |
説明 |
|
autoPauseDelay
|
integer
(int32)
|
プール内のデータベースごとの自動一時停止遅延
|
|
maxCapacity
|
number
(double)
|
1 つのデータベースで使用できる最大容量。
|
|
minCapacity
|
number
(double)
|
すべてのデータベースの最小容量が保証されます。
|
ElasticPoolState
列挙
エラスティック プールの状態。
| 値 |
説明 |
|
Creating
|
作成
|
|
Ready
|
準備完了
|
|
Disabled
|
Disabled
|
ErrorAdditionalInfo
Object
リソース管理エラーの追加情報。
| 名前 |
型 |
説明 |
|
info
|
object
|
追加情報。
|
|
type
|
string
|
追加情報の種類。
|
ErrorDetail
Object
エラーの詳細。
| 名前 |
型 |
説明 |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
エラーの追加情報。
|
|
code
|
string
|
エラー コード。
|
|
details
|
ErrorDetail[]
|
エラーの詳細。
|
|
message
|
string
|
エラー メッセージ。
|
|
target
|
string
|
エラーターゲット。
|
ErrorResponse
Object
エラー応答
Sku
Object
ARM リソース SKU。
| 名前 |
型 |
説明 |
|
capacity
|
integer
(int32)
|
特定の SKU の容量。
|
|
family
|
string
|
同じ SKU に対して、サービスの世代が異なるハードウェアがある場合は、ここでキャプチャできます。
|
|
name
|
string
|
SKU の名前 。通常は、文字 + 番号コード (P3 など)。
|
|
size
|
string
|
特定の SKU のサイズ
|
|
tier
|
string
|
特定の SKU のレベルまたはエディション (Basic、Premium など)。
|
systemData
Object
リソースの作成と最後の変更に関連するメタデータ。
| 名前 |
型 |
説明 |
|
createdAt
|
string
(date-time)
|
リソース作成のタイムスタンプ (UTC)。
|
|
createdBy
|
string
|
リソースを作成した ID。
|
|
createdByType
|
createdByType
|
リソースを作成した ID の種類。
|
|
lastModifiedAt
|
string
(date-time)
|
リソースの最終変更のタイムスタンプ (UTC)
|
|
lastModifiedBy
|
string
|
リソースを最後に変更した ID。
|
|
lastModifiedByType
|
createdByType
|
リソースを最後に変更した ID の種類。
|