Skip to content

Commit 1703817

Browse files
authored
Set-SqlDscDatabaseProperty: Remove AzureEdition and AzureServiceObjective (#2336)
1 parent 34abdf2 commit 1703817

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- BREAKING CHANGE: `Set-SqlDscDatabase`
1414
- Removed parameter `OwnerName` [issue #2177](https://github.com/dsccommunity/SqlServerDsc/issues/2177).
1515
Use the new command `Set-SqlDscDatabaseOwner` to change database ownership instead.
16+
- BREAKING CHANGE: `Set-SqlDscDatabaseProperty`
17+
- Removed parameters `AzureEdition` and `AzureServiceObjective`. Azure SQL Database
18+
service tier and SLO changes should be managed using `Set-AzSqlDatabase` from the
19+
Azure PowerShell module instead. See [issue #2177](https://github.com/dsccommunity/SqlServerDsc/issues/2177).
1620

1721
### Added
1822

source/Public/Set-SqlDscDatabaseProperty.ps1

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@
7777
.PARAMETER AutoUpdateStatisticsEnabled
7878
Specifies whether statistics are automatically updated when they are out-of-date.
7979
80-
.PARAMETER AzureEdition
81-
Specifies the Azure SQL Database edition (e.g., Basic/Standard/Premium/GeneralPurpose/BusinessCritical).
82-
83-
.PARAMETER AzureServiceObjective
84-
Specifies the Azure SQL Database service objective (e.g., S3, P1, GP_Gen5_4).
85-
8680
.PARAMETER BrokerEnabled
8781
Specifies whether Service Broker is enabled for the database.
8882
@@ -321,6 +315,10 @@
321315
There are some database properties that require method calls instead of direct
322316
property assignment and will be supported through separate commands, e.g.
323317
`Set-SqlDscDatabaseDefaultFileGroup`.
318+
319+
Azure SQL Database service tier and service objective changes should be managed
320+
using Azure management cmdlets (e.g., `Set-AzSqlDatabase` with `-Edition` and
321+
`-RequestedServiceObjectiveName` parameters) rather than through SMO.
324322
#>
325323
function Set-SqlDscDatabaseProperty
326324
{
@@ -572,10 +570,6 @@ function Set-SqlDscDatabaseProperty
572570
$MaxSizeInBytes,
573571

574572
# String Properties
575-
[Parameter()]
576-
[System.String]
577-
$AzureServiceObjective,
578-
579573
[Parameter()]
580574
[ValidateNotNullOrEmpty()]
581575
[System.String]
@@ -629,10 +623,6 @@ function Set-SqlDscDatabaseProperty
629623
[System.String]
630624
$RemoteDatabaseName,
631625

632-
[Parameter()]
633-
[System.String]
634-
$AzureEdition,
635-
636626
# Enum Properties
637627
[Parameter()]
638628
[Microsoft.SqlServer.Management.Smo.RetentionPeriodUnits]

tests/Unit/Public/Set-SqlDscDatabaseProperty.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ Describe 'Set-SqlDscDatabaseProperty' -Tag 'Public' {
366366
It 'Should have the correct parameters in parameter set ServerObjectSet' -ForEach @(
367367
@{
368368
ExpectedParameterSetName = 'ServerObjectSet'
369-
ExpectedParameters = '-ServerObject <Server> -Name <string> [-Refresh] [-AcceleratedRecoveryEnabled <bool>] [-AnsiNullDefault <bool>] [-AnsiNullsEnabled <bool>] [-AnsiPaddingEnabled <bool>] [-AnsiWarningsEnabled <bool>] [-ArithmeticAbortEnabled <bool>] [-AutoClose <bool>] [-AutoCreateIncrementalStatisticsEnabled <bool>] [-AutoCreateStatisticsEnabled <bool>] [-AutoShrink <bool>] [-AutoUpdateStatisticsAsync <bool>] [-AutoUpdateStatisticsEnabled <bool>] [-BrokerEnabled <bool>] [-ChangeTrackingAutoCleanUp <bool>] [-ChangeTrackingEnabled <bool>] [-CloseCursorsOnCommitEnabled <bool>] [-ConcatenateNullYieldsNull <bool>] [-DatabaseOwnershipChaining <bool>] [-DataRetentionEnabled <bool>] [-DateCorrelationOptimization <bool>] [-EncryptionEnabled <bool>] [-HonorBrokerPriority <bool>] [-IsFullTextEnabled <bool>] [-IsLedger <bool>] [-IsParameterizationForced <bool>] [-IsReadCommittedSnapshotOn <bool>] [-IsSqlDw <bool>] [-IsVarDecimalStorageFormatEnabled <bool>] [-LegacyCardinalityEstimation <bool>] [-LegacyCardinalityEstimationForSecondary <bool>] [-LocalCursorsDefault <bool>] [-NestedTriggersEnabled <bool>] [-NumericRoundAbortEnabled <bool>] [-ParameterSniffing <bool>] [-ParameterSniffingForSecondary <bool>] [-QueryOptimizerHotfixes <bool>] [-QueryOptimizerHotfixesForSecondary <bool>] [-QuotedIdentifiersEnabled <bool>] [-ReadOnly <bool>] [-RecursiveTriggersEnabled <bool>] [-RemoteDataArchiveEnabled <bool>] [-RemoteDataArchiveUseFederatedServiceAccount <bool>] [-TemporalHistoryRetentionEnabled <bool>] [-TransformNoiseWords <bool>] [-Trustworthy <bool>] [-ChangeTrackingRetentionPeriod <int>] [-DefaultFullTextLanguage <int>] [-DefaultLanguage <int>] [-MaxDop <int>] [-MaxDopForSecondary <int>] [-MirroringRedoQueueMaxSize <int>] [-MirroringTimeout <int>] [-TargetRecoveryTime <int>] [-TwoDigitYearCutoff <int>] [-MaxSizeInBytes <double>] [-AzureServiceObjective <string>] [-Collation <string>] [-DatabaseSnapshotBaseName <string>] [-DefaultSchema <string>] [-FilestreamDirectoryName <string>] [-MirroringPartner <string>] [-MirroringPartnerInstance <string>] [-MirroringWitness <string>] [-PersistentVersionStoreFileGroup <string>] [-PrimaryFilePath <string>] [-RemoteDataArchiveCredential <string>] [-RemoteDataArchiveEndpoint <string>] [-RemoteDataArchiveLinkedServer <string>] [-RemoteDatabaseName <string>] [-AzureEdition <string>] [-ChangeTrackingRetentionPeriodUnits <RetentionPeriodUnits>] [-CompatibilityLevel <CompatibilityLevel>] [-ContainmentType <ContainmentType>] [-DelayedDurability <DelayedDurability>] [-FilestreamNonTransactedAccess <FilestreamNonTransactedAccessType>] [-MirroringSafetyLevel <MirroringSafetyLevel>] [-PageVerify <PageVerify>] [-RecoveryModel <RecoveryModel>] [-UserAccess <DatabaseUserAccess>] [-Force] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]'
369+
ExpectedParameters = '-ServerObject <Server> -Name <string> [-Refresh] [-AcceleratedRecoveryEnabled <bool>] [-AnsiNullDefault <bool>] [-AnsiNullsEnabled <bool>] [-AnsiPaddingEnabled <bool>] [-AnsiWarningsEnabled <bool>] [-ArithmeticAbortEnabled <bool>] [-AutoClose <bool>] [-AutoCreateIncrementalStatisticsEnabled <bool>] [-AutoCreateStatisticsEnabled <bool>] [-AutoShrink <bool>] [-AutoUpdateStatisticsAsync <bool>] [-AutoUpdateStatisticsEnabled <bool>] [-BrokerEnabled <bool>] [-ChangeTrackingAutoCleanUp <bool>] [-ChangeTrackingEnabled <bool>] [-CloseCursorsOnCommitEnabled <bool>] [-ConcatenateNullYieldsNull <bool>] [-DatabaseOwnershipChaining <bool>] [-DataRetentionEnabled <bool>] [-DateCorrelationOptimization <bool>] [-EncryptionEnabled <bool>] [-HonorBrokerPriority <bool>] [-IsFullTextEnabled <bool>] [-IsLedger <bool>] [-IsParameterizationForced <bool>] [-IsReadCommittedSnapshotOn <bool>] [-IsSqlDw <bool>] [-IsVarDecimalStorageFormatEnabled <bool>] [-LegacyCardinalityEstimation <bool>] [-LegacyCardinalityEstimationForSecondary <bool>] [-LocalCursorsDefault <bool>] [-NestedTriggersEnabled <bool>] [-NumericRoundAbortEnabled <bool>] [-ParameterSniffing <bool>] [-ParameterSniffingForSecondary <bool>] [-QueryOptimizerHotfixes <bool>] [-QueryOptimizerHotfixesForSecondary <bool>] [-QuotedIdentifiersEnabled <bool>] [-ReadOnly <bool>] [-RecursiveTriggersEnabled <bool>] [-RemoteDataArchiveEnabled <bool>] [-RemoteDataArchiveUseFederatedServiceAccount <bool>] [-TemporalHistoryRetentionEnabled <bool>] [-TransformNoiseWords <bool>] [-Trustworthy <bool>] [-ChangeTrackingRetentionPeriod <int>] [-DefaultFullTextLanguage <int>] [-DefaultLanguage <int>] [-MaxDop <int>] [-MaxDopForSecondary <int>] [-MirroringRedoQueueMaxSize <int>] [-MirroringTimeout <int>] [-TargetRecoveryTime <int>] [-TwoDigitYearCutoff <int>] [-MaxSizeInBytes <double>] [-Collation <string>] [-DatabaseSnapshotBaseName <string>] [-DefaultSchema <string>] [-FilestreamDirectoryName <string>] [-MirroringPartner <string>] [-MirroringPartnerInstance <string>] [-MirroringWitness <string>] [-PersistentVersionStoreFileGroup <string>] [-PrimaryFilePath <string>] [-RemoteDataArchiveCredential <string>] [-RemoteDataArchiveEndpoint <string>] [-RemoteDataArchiveLinkedServer <string>] [-RemoteDatabaseName <string>] [-ChangeTrackingRetentionPeriodUnits <RetentionPeriodUnits>] [-CompatibilityLevel <CompatibilityLevel>] [-ContainmentType <ContainmentType>] [-DelayedDurability <DelayedDurability>] [-FilestreamNonTransactedAccess <FilestreamNonTransactedAccessType>] [-MirroringSafetyLevel <MirroringSafetyLevel>] [-PageVerify <PageVerify>] [-RecoveryModel <RecoveryModel>] [-UserAccess <DatabaseUserAccess>] [-Force] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]'
370370
}
371371
) {
372372
$result = (Get-Command -Name 'Set-SqlDscDatabaseProperty').ParameterSets |
@@ -383,7 +383,7 @@ Describe 'Set-SqlDscDatabaseProperty' -Tag 'Public' {
383383
It 'Should have the correct parameters in parameter set DatabaseObjectSet' -ForEach @(
384384
@{
385385
ExpectedParameterSetName = 'DatabaseObjectSet'
386-
ExpectedParameters = '-DatabaseObject <Database> [-AcceleratedRecoveryEnabled <bool>] [-AnsiNullDefault <bool>] [-AnsiNullsEnabled <bool>] [-AnsiPaddingEnabled <bool>] [-AnsiWarningsEnabled <bool>] [-ArithmeticAbortEnabled <bool>] [-AutoClose <bool>] [-AutoCreateIncrementalStatisticsEnabled <bool>] [-AutoCreateStatisticsEnabled <bool>] [-AutoShrink <bool>] [-AutoUpdateStatisticsAsync <bool>] [-AutoUpdateStatisticsEnabled <bool>] [-BrokerEnabled <bool>] [-ChangeTrackingAutoCleanUp <bool>] [-ChangeTrackingEnabled <bool>] [-CloseCursorsOnCommitEnabled <bool>] [-ConcatenateNullYieldsNull <bool>] [-DatabaseOwnershipChaining <bool>] [-DataRetentionEnabled <bool>] [-DateCorrelationOptimization <bool>] [-EncryptionEnabled <bool>] [-HonorBrokerPriority <bool>] [-IsFullTextEnabled <bool>] [-IsLedger <bool>] [-IsParameterizationForced <bool>] [-IsReadCommittedSnapshotOn <bool>] [-IsSqlDw <bool>] [-IsVarDecimalStorageFormatEnabled <bool>] [-LegacyCardinalityEstimation <bool>] [-LegacyCardinalityEstimationForSecondary <bool>] [-LocalCursorsDefault <bool>] [-NestedTriggersEnabled <bool>] [-NumericRoundAbortEnabled <bool>] [-ParameterSniffing <bool>] [-ParameterSniffingForSecondary <bool>] [-QueryOptimizerHotfixes <bool>] [-QueryOptimizerHotfixesForSecondary <bool>] [-QuotedIdentifiersEnabled <bool>] [-ReadOnly <bool>] [-RecursiveTriggersEnabled <bool>] [-RemoteDataArchiveEnabled <bool>] [-RemoteDataArchiveUseFederatedServiceAccount <bool>] [-TemporalHistoryRetentionEnabled <bool>] [-TransformNoiseWords <bool>] [-Trustworthy <bool>] [-ChangeTrackingRetentionPeriod <int>] [-DefaultFullTextLanguage <int>] [-DefaultLanguage <int>] [-MaxDop <int>] [-MaxDopForSecondary <int>] [-MirroringRedoQueueMaxSize <int>] [-MirroringTimeout <int>] [-TargetRecoveryTime <int>] [-TwoDigitYearCutoff <int>] [-MaxSizeInBytes <double>] [-AzureServiceObjective <string>] [-Collation <string>] [-DatabaseSnapshotBaseName <string>] [-DefaultSchema <string>] [-FilestreamDirectoryName <string>] [-MirroringPartner <string>] [-MirroringPartnerInstance <string>] [-MirroringWitness <string>] [-PersistentVersionStoreFileGroup <string>] [-PrimaryFilePath <string>] [-RemoteDataArchiveCredential <string>] [-RemoteDataArchiveEndpoint <string>] [-RemoteDataArchiveLinkedServer <string>] [-RemoteDatabaseName <string>] [-AzureEdition <string>] [-ChangeTrackingRetentionPeriodUnits <RetentionPeriodUnits>] [-CompatibilityLevel <CompatibilityLevel>] [-ContainmentType <ContainmentType>] [-DelayedDurability <DelayedDurability>] [-FilestreamNonTransactedAccess <FilestreamNonTransactedAccessType>] [-MirroringSafetyLevel <MirroringSafetyLevel>] [-PageVerify <PageVerify>] [-RecoveryModel <RecoveryModel>] [-UserAccess <DatabaseUserAccess>] [-Force] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]'
386+
ExpectedParameters = '-DatabaseObject <Database> [-AcceleratedRecoveryEnabled <bool>] [-AnsiNullDefault <bool>] [-AnsiNullsEnabled <bool>] [-AnsiPaddingEnabled <bool>] [-AnsiWarningsEnabled <bool>] [-ArithmeticAbortEnabled <bool>] [-AutoClose <bool>] [-AutoCreateIncrementalStatisticsEnabled <bool>] [-AutoCreateStatisticsEnabled <bool>] [-AutoShrink <bool>] [-AutoUpdateStatisticsAsync <bool>] [-AutoUpdateStatisticsEnabled <bool>] [-BrokerEnabled <bool>] [-ChangeTrackingAutoCleanUp <bool>] [-ChangeTrackingEnabled <bool>] [-CloseCursorsOnCommitEnabled <bool>] [-ConcatenateNullYieldsNull <bool>] [-DatabaseOwnershipChaining <bool>] [-DataRetentionEnabled <bool>] [-DateCorrelationOptimization <bool>] [-EncryptionEnabled <bool>] [-HonorBrokerPriority <bool>] [-IsFullTextEnabled <bool>] [-IsLedger <bool>] [-IsParameterizationForced <bool>] [-IsReadCommittedSnapshotOn <bool>] [-IsSqlDw <bool>] [-IsVarDecimalStorageFormatEnabled <bool>] [-LegacyCardinalityEstimation <bool>] [-LegacyCardinalityEstimationForSecondary <bool>] [-LocalCursorsDefault <bool>] [-NestedTriggersEnabled <bool>] [-NumericRoundAbortEnabled <bool>] [-ParameterSniffing <bool>] [-ParameterSniffingForSecondary <bool>] [-QueryOptimizerHotfixes <bool>] [-QueryOptimizerHotfixesForSecondary <bool>] [-QuotedIdentifiersEnabled <bool>] [-ReadOnly <bool>] [-RecursiveTriggersEnabled <bool>] [-RemoteDataArchiveEnabled <bool>] [-RemoteDataArchiveUseFederatedServiceAccount <bool>] [-TemporalHistoryRetentionEnabled <bool>] [-TransformNoiseWords <bool>] [-Trustworthy <bool>] [-ChangeTrackingRetentionPeriod <int>] [-DefaultFullTextLanguage <int>] [-DefaultLanguage <int>] [-MaxDop <int>] [-MaxDopForSecondary <int>] [-MirroringRedoQueueMaxSize <int>] [-MirroringTimeout <int>] [-TargetRecoveryTime <int>] [-TwoDigitYearCutoff <int>] [-MaxSizeInBytes <double>] [-Collation <string>] [-DatabaseSnapshotBaseName <string>] [-DefaultSchema <string>] [-FilestreamDirectoryName <string>] [-MirroringPartner <string>] [-MirroringPartnerInstance <string>] [-MirroringWitness <string>] [-PersistentVersionStoreFileGroup <string>] [-PrimaryFilePath <string>] [-RemoteDataArchiveCredential <string>] [-RemoteDataArchiveEndpoint <string>] [-RemoteDataArchiveLinkedServer <string>] [-RemoteDatabaseName <string>] [-ChangeTrackingRetentionPeriodUnits <RetentionPeriodUnits>] [-CompatibilityLevel <CompatibilityLevel>] [-ContainmentType <ContainmentType>] [-DelayedDurability <DelayedDurability>] [-FilestreamNonTransactedAccess <FilestreamNonTransactedAccessType>] [-MirroringSafetyLevel <MirroringSafetyLevel>] [-PageVerify <PageVerify>] [-RecoveryModel <RecoveryModel>] [-UserAccess <DatabaseUserAccess>] [-Force] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]'
387387
}
388388
) {
389389
$result = (Get-Command -Name 'Set-SqlDscDatabaseProperty').ParameterSets |

0 commit comments

Comments
 (0)