Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def test_metric_alert_single_scope(self, resource_group, vm1):
])

@ResourceGroupPreparer(name_prefix='cli_test_metric_alert_v1_2')
@SqlServerPreparer(name_prefix='clitestservermatricalertA', parameter_name='server1', location='eastus')
@SqlServerPreparer(name_prefix='clitestservermatricalertA', parameter_name='server1', location='westus')
def test_metric_alert_for_sql_database_scope(self, resource_group, resource_group_location, server1):
self.kwargs.update({
'alert': 'alert1',
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,7 @@ def test_private_endpoint_connection_synapse_workspace(self, resource_group, sto

_test_private_endpoint(self)

@ResourceGroupPreparer(name_prefix="test_private_endpoint_connection_sql_server", location="eastus")
@ResourceGroupPreparer(name_prefix="test_private_endpoint_connection_sql_server", location="westus")
def test_private_endpoint_connection_sql_server(self, resource_group):
self.kwargs.update({
'rg': resource_group,
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/sql/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
ServerKeyType,
StorageKeyType,
TransparentDataEncryptionState,
FreemiumType,
ManagedInstanceDatabaseFormat
)

Expand Down Expand Up @@ -64,6 +63,7 @@
SqlServerMinimalTlsVersionType,
SqlManagedInstanceMinimalTlsVersionType,
AuthenticationType,
FreemiumType,
FreeLimitExhaustionBehavior,
FailoverGroupDatabasesSecondaryType
)
Expand Down
12 changes: 9 additions & 3 deletions src/azure-cli/azure/cli/command_modules/sql/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
ServerKey,
ServerKeyType,
ServerNetworkAccessFlag,
ServiceObjectiveName,
ServerTrustGroup,
ServicePrincipal,
ShortTermRetentionPolicyName,
Expand Down Expand Up @@ -719,6 +718,13 @@ class AuthenticationType(str, Enum):

sql = "SQL"
ad_password = "ADPassword"
managed_identity = "ManagedIdentity"


class FreemiumType(str, Enum):

Regular = "Regular"
Freemium = "Freemium"


def _get_server_dns_suffx(cli_ctx):
Expand Down Expand Up @@ -1795,10 +1801,10 @@ def db_update( # pylint: disable=too-many-locals, too-many-branches
# actually ignores the value of service objective name (!!). We are trying to protect the CLI
# user from this unintuitive behavior.
if (elastic_pool_id and service_objective and
service_objective != ServiceObjectiveName.ELASTIC_POOL):
service_objective != "ELASTIC_POOL"):
raise CLIError('If elastic pool is specified, service objective must be'
' unspecified or equal \'{}\'.'.format(
ServiceObjectiveName.ELASTIC_POOL))
"ELASTIC_POOL"))

# Update both elastic pool and sku. The service treats elastic pool and sku properties like PATCH,
# so if either of these properties is null then the service will keep the property unchanged -
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,53 @@ interactions:
ParameterSetName:
- -l
User-Agent:
- AZURECLI/2.45.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.9.5 (Windows-10-10.0.22621-SP0)
- AZURECLI/2.71.0 azsdk-python-core/1.31.0 Python/3.10.11 (Windows-10-10.0.26100-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages?api-version=2020-11-01-preview
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages?api-version=2024-05-01-preview
response:
body:
string: '{"value":[{"properties":{"displayName":"Regional Server Quota for westus","currentValue":0.0,"limit":150.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/ServerQuota","name":"ServerQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Free
string: '{"value":[{"properties":{"displayName":"Regional Server Quota for westus","currentValue":1.0,"limit":250.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/ServerQuota","name":"ServerQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Free
Database Count per Subscription for westus","currentValue":0.0,"limit":1.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionFreeDatabaseCount","name":"SubscriptionFreeDatabaseCount","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Free
to Basic Database Upgrade count-down in westus","currentValue":365.0,"limit":365.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionFreeDatabaseDaysLeft","name":"SubscriptionFreeDatabaseDaysLeft","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Subnet
Quota","currentValue":0.0,"limit":0.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubnetQuota","name":"SubnetQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"VCore
Quota","currentValue":0.0,"limit":0.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/VCoreQuota","name":"VCoreQuota","type":"Microsoft.Sql/locations/usages"}]}'
Quota","currentValue":0.0,"limit":8.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubnetQuota","name":"SubnetQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"VCore
Quota","currentValue":0.0,"limit":960.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/VCoreQuota","name":"VCoreQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Count
of free databases in this subscription across all Azure regions.","currentValue":1.0,"limit":1.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/FreeLimitQuota","name":"FreeLimitQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Regional
vCore Quota for SQLDB and SQLDW for westus.","currentValue":0.0,"limit":500.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/RegionalVCoreQuotaForSQLDBAndDW","name":"RegionalVCoreQuotaForSQLDBAndDW","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Managed
Instance free vCore hours left","currentValue":0.0,"limit":0.0,"unit":"SubscriptionSQLManagedInstanceFreeTokensLeft"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstanceFreeTokensLeft","name":"SubscriptionSQLManagedInstanceFreeTokensLeft","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Managed
Instance days until monthly free vCore hours are reset","currentValue":0.0,"limit":0.0,"unit":"SubscriptionSQLManagedInstanceFreeTokenRefreshDaysLeft"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstanceFreeTokenRefreshDaysLeft","name":"SubscriptionSQLManagedInstanceFreeTokenRefreshDaysLeft","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Managed
Instance months until free period expires","currentValue":0.0,"limit":0.0,"unit":"SubscriptionSQLManagedInstanceFreeMonthsLeft"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstanceFreeMonthsLeft","name":"SubscriptionSQLManagedInstanceFreeMonthsLeft","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Number
of free managed instances on subscription","currentValue":0.0,"limit":1.0,"unit":"SubscriptionSQLManagedInstanceFreeInstances"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstanceFreeInstances","name":"SubscriptionSQLManagedInstanceFreeInstances","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"VCore
quota for Standard Series SQL Managed Instance","currentValue":0.0,"limit":960.0,"unit":"SubscriptionSQLManagedInstanceStandardSeriesVCoreQuota"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstanceStandardSeriesVCoreQuota","name":"SubscriptionSQLManagedInstanceStandardSeriesVCoreQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Subnet
quota for Standard Series SQL Managed Instance","currentValue":0.0,"limit":8.0,"unit":"SubscriptionSQLManagedInstanceStandardSeriesSubnetQuota"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstanceStandardSeriesSubnetQuota","name":"SubscriptionSQLManagedInstanceStandardSeriesSubnetQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"VCore
quota for Premium Series SQL Managed Instance","currentValue":0.0,"limit":960.0,"unit":"SubscriptionSQLManagedInstancePremiumSeriesVCoreQuota"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstancePremiumSeriesVCoreQuota","name":"SubscriptionSQLManagedInstancePremiumSeriesVCoreQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Subnet
quota for Premium Series SQL Managed Instance","currentValue":0.0,"limit":8.0,"unit":"SubscriptionSQLManagedInstancePremiumSeriesSubnetQuota"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstancePremiumSeriesSubnetQuota","name":"SubscriptionSQLManagedInstancePremiumSeriesSubnetQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"VCore
quota for Premium Series Memory Optimized SQL Managed Instance","currentValue":0.0,"limit":960.0,"unit":"SubscriptionSQLManagedInstancePremiumSeriesMemoryOptimizedVCoreQuota"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstancePremiumSeriesMemoryOptimizedVCoreQuota","name":"SubscriptionSQLManagedInstancePremiumSeriesMemoryOptimizedVCoreQuota","type":"Microsoft.Sql/locations/usages"},{"properties":{"displayName":"Subnet
quota for Premium Series Memory Optimized SQL Managed Instance","currentValue":0.0,"limit":8.0,"unit":"SubscriptionSQLManagedInstancePremiumSeriesMemoryOptimizedSubnetQuota"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/SubscriptionSQLManagedInstancePremiumSeriesMemoryOptimizedSubnetQuota","name":"SubscriptionSQLManagedInstancePremiumSeriesMemoryOptimizedSubnetQuota","type":"Microsoft.Sql/locations/usages"}]}'
headers:
cache-control:
- no-cache
content-length:
- '1546'
- '6730'
content-type:
- application/json; charset=utf-8
date:
- Sat, 25 Feb 2023 00:59:31 GMT
- Tue, 08 Apr 2025 13:41:12 GMT
expires:
- '-1'
pragma:
- no-cache
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-cache:
- CONFIG_NOCACHE
x-content-type-options:
- nosniff
x-ms-operation-identifier:
- tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=6c1f60e8-d413-449a-a4bc-14ddbe9afbbc/southindia/880be6d4-9410-479f-b0eb-0196b4641154
x-ms-ratelimit-remaining-subscription-global-reads:
- '16499'
x-msedge-ref:
- 'Ref A: 29FD6BB67D0642B1BF27D67F0960E216 Ref B: MAA201060515047 Ref C: 2025-04-08T13:41:13Z'
status:
code: 200
message: OK
Expand All @@ -63,12 +77,12 @@ interactions:
ParameterSetName:
- -l -u
User-Agent:
- AZURECLI/2.45.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.9.5 (Windows-10-10.0.22621-SP0)
- AZURECLI/2.71.0 azsdk-python-core/1.31.0 Python/3.10.11 (Windows-10-10.0.26100-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/ServerQuota?api-version=2020-11-01-preview
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/ServerQuota?api-version=2024-05-01-preview
response:
body:
string: '{"properties":{"displayName":"Regional Server Quota for westus","currentValue":0.0,"limit":150.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/ServerQuota","name":"ServerQuota","type":"Microsoft.Sql/locations/usages"}'
string: '{"properties":{"displayName":"Regional Server Quota for westus","currentValue":1.0,"limit":250.0,"unit":"Count"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Sql/locations/westus/usages/ServerQuota","name":"ServerQuota","type":"Microsoft.Sql/locations/usages"}'
headers:
cache-control:
- no-cache
Expand All @@ -77,21 +91,23 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Sat, 25 Feb 2023 00:59:31 GMT
- Tue, 08 Apr 2025 13:41:13 GMT
expires:
- '-1'
pragma:
- no-cache
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-cache:
- CONFIG_NOCACHE
x-content-type-options:
- nosniff
x-ms-operation-identifier:
- tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=6c1f60e8-d413-449a-a4bc-14ddbe9afbbc/jioindiacentral/64a211e0-7a19-4937-8624-8fc2a2df8baf
x-ms-ratelimit-remaining-subscription-global-reads:
- '16499'
x-msedge-ref:
- 'Ref A: A67BB2BCC2BD47A789FD346D203105CC Ref B: MAA201060515035 Ref C: 2025-04-08T13:41:13Z'
status:
code: 200
message: OK
Expand Down
Loading
Loading