I am trying to do the following:
- Capture the original Edition and RequestedServiceObjectiveName of an Azure sql database using the following PS script:
$OriginalScale= Get-AzSqlDatabase `
-ResourceGroupName "POC_Scale" `
-ServerName "scaledb" `
-DatabaseName "scaleME"
2.Scale up this database to a particular edition and tier using:
Set-AzSqlDatabase `
-ResourceGroupName "POC_Scale" `
-ServerName "scaledb" `
-DatabaseName "scaleME" `
-Edition "Standard" `
-RequestedServiceObjectiveName "S3" `
3.After deployment, scale it back to the original scale that I had captured prior to step 2 using:
Set-AzSqlDatabase `
-ResourceGroupName "POC_Scale" `
-ServerName "scaledb" `
-DatabaseName "scaleME" `
-Edition "$OriginalScale.Edition" `
-RequestedServiceObjectiveName "$OriginalScale.RequestedServiceObjectiveName" `
I get the following error:
I have tried the following:
Tried to use single quotes around the -Edition and -RequestedServiceObjectName being passed in but I get the same error.
Checked that the $OriginalScale.Edition does indeed return "Standard". Also checked docs and found that .Edition is actually a string which should theoretically work.
Can someone please guide me on what I'm doing wrong here. Seems simple but not sure what I'm doing wrong.
