Crée ou met à jour un pool élastique.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}?api-version=2025-01-01
Paramètres URI
| Nom |
Dans |
Obligatoire |
Type |
Description |
|
elasticPoolName
|
path |
True
|
string
|
Nom du pool élastique.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nom du groupe de ressources. Le nom ne respecte pas la casse.
|
|
serverName
|
path |
True
|
string
|
Le nom du serveur
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
ID de l’abonnement cible. La valeur doit être un UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Version de l’API à utiliser pour cette opération.
|
Corps de la demande
| Nom |
Obligatoire |
Type |
Description |
|
location
|
True
|
string
|
Emplacement géographique où réside la ressource
|
|
properties.autoPauseDelay
|
|
integer
(int32)
|
Durée en minutes après laquelle le pool élastique est automatiquement suspendu. Une valeur de -1 signifie que la pause automatique est désactivée
|
|
properties.availabilityZone
|
|
AvailabilityZoneType
|
Spécifie la zone de disponibilité vers laquelle le réplica principal du pool est épinglé.
|
|
properties.highAvailabilityReplicaCount
|
|
integer
(int32)
|
Nombre de réplicas secondaires associés au pool élastique Critique pour l’entreprise, Premium ou Hyperscale qui sont utilisés pour fournir une haute disponibilité. Applicable uniquement aux pools élastiques Hyperscale.
|
|
properties.licenseType
|
|
ElasticPoolLicenseType
|
Type de licence à appliquer pour ce pool élastique.
|
|
properties.maintenanceConfigurationId
|
|
string
|
ID de configuration de maintenance affecté au pool élastique. Cette configuration définit la période pendant laquelle les mises à jour de maintenance se produisent.
|
|
properties.maxSizeBytes
|
|
integer
(int64)
|
Limite de stockage du pool élastique de base de données en octets.
|
|
properties.minCapacity
|
|
number
(double)
|
Capacité minimale que le pool serverless ne réduit pas en dessous, s’il n’est pas suspendu
|
|
properties.perDatabaseSettings
|
|
ElasticPoolPerDatabaseSettings
|
Paramètres par base de données pour le pool élastique.
|
|
properties.preferredEnclaveType
|
|
AlwaysEncryptedEnclaveType
|
Type d’enclave demandé sur le pool élastique.
|
|
properties.zoneRedundant
|
|
boolean
|
Indique si ce pool élastique est redondant interzone, ce qui signifie que les réplicas de ce pool élastique sont répartis entre plusieurs zones de disponibilité.
|
|
sku
|
|
Sku
|
Référence SKU du pool élastique.
La liste des références SKU peut varier selon la région et l’offre de support. Pour déterminer les SKU (y compris le nom du SKU, le niveau/édition, la famille et la capacité) disponibles pour votre abonnement dans une région Azure, utilisez l’API REST Capabilities_ListByLocation ou la commande suivante :
az sql elastic-pool list-editions -l <location> -o table
|
|
tags
|
|
object
|
Balises de ressource.
|
Réponses
| Nom |
Type |
Description |
|
200 OK
|
ElasticPool
|
Opération de mise à jour de la ressource 'ElasticPool' réussie
|
|
201 Created
|
ElasticPool
|
Ressource 'ElasticPool' créer l’opération a réussi
En-têtes
Azure-AsyncOperation: string
|
|
202 Accepted
|
|
Exploitation des ressources acceptée.
En-têtes
- Location: string
- Retry-After: integer
|
|
Other Status Codes
|
ErrorResponse
|
Réponse d’erreur inattendue.
|
Sécurité
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flux:
implicit
URL d’autorisation:
https://login.microsoftonline.com/common/oauth2/authorize
Étendues
| Nom |
Description |
|
user_impersonation
|
emprunter l’identité de votre compte d’utilisateur
|
Exemples
Create or Update an elastic pool with Availability Zone
Exemple de requête
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://dotnet.territoriali.olinfo.it/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
Exemple de réponse
{
"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
Exemple de requête
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://dotnet.territoriali.olinfo.it/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
Exemple de réponse
{
"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
Exemple de requête
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://dotnet.territoriali.olinfo.it/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
Exemple de réponse
{
"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
Exemple de requête
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://dotnet.territoriali.olinfo.it/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
Exemple de réponse
{
"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
Exemple de requête
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://dotnet.territoriali.olinfo.it/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
Exemple de réponse
{
"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
Exemple de requête
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://dotnet.territoriali.olinfo.it/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
Exemple de réponse
{
"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
Exemple de requête
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://dotnet.territoriali.olinfo.it/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
Exemple de réponse
{
"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
Exemple de requête
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://dotnet.territoriali.olinfo.it/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
Exemple de réponse
{
"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
Définitions
AlwaysEncryptedEnclaveType
Énumération
Type d’enclave demandé sur la base de données, c’est-à-dire les enclaves par défaut ou VBS.
| Valeur |
Description |
|
Default
|
Par défaut
|
|
VBS
|
VBS
|
AvailabilityZoneType
Énumération
Spécifie la zone de disponibilité à laquelle la base de données est épinglée.
| Valeur |
Description |
|
NoPreference
|
Sans préférence
|
|
1
|
1
|
|
2
|
2
|
|
3
|
3
|
createdByType
Énumération
Type d’identité qui a créé la ressource.
| Valeur |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ElasticPool
Objet
Un pool élastique.
| Nom |
Type |
Description |
|
id
|
string
(arm-id)
|
ID de ressource complet pour la ressource. Par exemple, « /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} »
|
|
kind
|
string
|
Type de pool élastique. Ce sont des métadonnées utilisées pour l’expérience du portail Azure.
|
|
location
|
string
|
Emplacement géographique où réside la ressource
|
|
name
|
string
|
Nom de la ressource
|
|
properties.autoPauseDelay
|
integer
(int32)
|
Durée en minutes après laquelle le pool élastique est automatiquement suspendu. Une valeur de -1 signifie que la pause automatique est désactivée
|
|
properties.availabilityZone
|
AvailabilityZoneType
|
Spécifie la zone de disponibilité vers laquelle le réplica principal du pool est épinglé.
|
|
properties.creationDate
|
string
(date-time)
|
Date de création du pool élastique (format ISO8601).
|
|
properties.highAvailabilityReplicaCount
|
integer
(int32)
|
Nombre de réplicas secondaires associés au pool élastique Critique pour l’entreprise, Premium ou Hyperscale qui sont utilisés pour fournir une haute disponibilité. Applicable uniquement aux pools élastiques Hyperscale.
|
|
properties.licenseType
|
ElasticPoolLicenseType
|
Type de licence à appliquer pour ce pool élastique.
|
|
properties.maintenanceConfigurationId
|
string
|
ID de configuration de maintenance affecté au pool élastique. Cette configuration définit la période pendant laquelle les mises à jour de maintenance se produisent.
|
|
properties.maxSizeBytes
|
integer
(int64)
|
Limite de stockage du pool élastique de base de données en octets.
|
|
properties.minCapacity
|
number
(double)
|
Capacité minimale que le pool serverless ne réduit pas en dessous, s’il n’est pas suspendu
|
|
properties.perDatabaseSettings
|
ElasticPoolPerDatabaseSettings
|
Paramètres par base de données pour le pool élastique.
|
|
properties.preferredEnclaveType
|
AlwaysEncryptedEnclaveType
|
Type d’enclave demandé sur le pool élastique.
|
|
properties.state
|
ElasticPoolState
|
État du pool élastique.
|
|
properties.zoneRedundant
|
boolean
|
Indique si ce pool élastique est redondant interzone, ce qui signifie que les réplicas de ce pool élastique sont répartis entre plusieurs zones de disponibilité.
|
|
sku
|
Sku
|
Référence SKU du pool élastique.
La liste des références SKU peut varier selon la région et l’offre de support. Pour déterminer les SKU (y compris le nom du SKU, le niveau/édition, la famille et la capacité) disponibles pour votre abonnement dans une région Azure, utilisez l’API REST Capabilities_ListByLocation ou la commande suivante :
az sql elastic-pool list-editions -l <location> -o table
|
|
systemData
|
systemData
|
Azure Resource Manager : métadonnées contenant des informations createdBy et modifiedBy.
|
|
tags
|
object
|
Balises de ressource.
|
|
type
|
string
|
Type de la ressource. Par exemple : « Microsoft. Calcul/virtualMachines » ou « Microsoft. StorageAccounts"
|
ElasticPoolLicenseType
Énumération
Type de licence à appliquer pour ce pool élastique.
| Valeur |
Description |
|
LicenseIncluded
|
LicenceInclus
|
|
BasePrice
|
BasePrice
|
ElasticPoolPerDatabaseSettings
Objet
Par paramètres de base de données d’un pool élastique.
| Nom |
Type |
Description |
|
autoPauseDelay
|
integer
(int32)
|
Délai de pause automatique pour chaque base de données dans le pool
|
|
maxCapacity
|
number
(double)
|
Capacité maximale qu’une base de données peut consommer.
|
|
minCapacity
|
number
(double)
|
La capacité minimale de toutes les bases de données est garantie.
|
ElasticPoolState
Énumération
État du pool élastique.
| Valeur |
Description |
|
Creating
|
Création
|
|
Ready
|
Prêt
|
|
Disabled
|
Désactivé
|
ErrorAdditionalInfo
Objet
Informations supplémentaires sur l’erreur de gestion des ressources.
| Nom |
Type |
Description |
|
info
|
object
|
Informations supplémentaires.
|
|
type
|
string
|
Type d’informations supplémentaire.
|
ErrorDetail
Objet
Détail de l’erreur.
| Nom |
Type |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Informations supplémentaires sur l’erreur.
|
|
code
|
string
|
Code d’erreur.
|
|
details
|
ErrorDetail[]
|
Détails de l’erreur.
|
|
message
|
string
|
Message d’erreur.
|
|
target
|
string
|
Cible d’erreur.
|
ErrorResponse
Objet
Réponse d’erreur
Sku
Objet
Référence SKU de ressource ARM.
| Nom |
Type |
Description |
|
capacity
|
integer
(int32)
|
Capacité de la référence SKU particulière.
|
|
family
|
string
|
Si le service a différentes générations de matériel, pour la même référence SKU, vous pouvez le capturer ici.
|
|
name
|
string
|
Nom de la référence SKU, généralement une lettre + code numérique, par exemple P3.
|
|
size
|
string
|
Taille de la référence SKU particulière
|
|
tier
|
string
|
Niveau ou édition de la référence SKU particulière, par exemple De base, Premium.
|
systemData
Objet
Métadonnées relatives à la création et à la dernière modification de la ressource.
| Nom |
Type |
Description |
|
createdAt
|
string
(date-time)
|
Horodatage de la création de ressources (UTC).
|
|
createdBy
|
string
|
Identité qui a créé la ressource.
|
|
createdByType
|
createdByType
|
Type d’identité qui a créé la ressource.
|
|
lastModifiedAt
|
string
(date-time)
|
Horodatage de la dernière modification de ressource (UTC)
|
|
lastModifiedBy
|
string
|
Identité qui a modifié la ressource pour la dernière fois.
|
|
lastModifiedByType
|
createdByType
|
Type d’identité qui a modifié la ressource pour la dernière fois.
|