locked
Azure SQL Auto Scale UP/Down using automation RRS feed

  • Question

  • I used below code to scale up the server; My pool has 2 DB's And i tried with 1 db got below error;

    How to make sure that 2 Database use same pool which i scale up?

    $connectionName = "AzureRunAsConnection"

    try
    {
        # Get the connection "AzureRunAsConnection "
        $servicePrincipalConnection = Get-AutomationConnection -Name $connectionName      
        "Logging in to Azure..."
        $account = Add-AzureRmAccount `
            -ServicePrincipal `
            -TenantId $servicePrincipalConnection.TenantId `
            -ApplicationId $servicePrincipalConnection.ApplicationId `
            -CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint 
    }
    catch {
        if (!$servicePrincipalConnection)
        {
            $ErrorMessage = "Connection $connectionName not found."
            throw $ErrorMessage
        } else{
            Write-Error -Message $_.Exception
            throw $_.Exception
        }

    #Scale UP:

    Set-AzureRmSqlDatabase -ResourceGroupName "ResourceGRoupName"  -ServerName "ServerName"

    -DatabaseName "DBNAME"  -Edition "GeneralPurpose"  -VCore 16   -ComputeGeneration "Gen5"

     -LicenseType LicenseIncluded 

     
    -ElasticPoolName "PoolName"

    Set-AzureRmSqlDatabase : Parameter set cannot be resolved using the specified named parameters.
    At line:23 char:1
    + Set-AzureRmSqlDatabase -ResourceGroupName "rgname"  -Elasti ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Set-AzureRmSqlDatabase], ParameterBindingException
        + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.Sql.Database.Cmdlet.SetAzureSqlDatabase


    Navin.D http://dnavin.wordpress.com



    • Edited by Navind Friday, May 22, 2020 2:51 AM
    Friday, May 22, 2020 2:23 AM

Answers

  • need to use 

    Scale Up

    Set-AzureRmSqlElasticPool -ResourceGroupName ""  -ServerName "withoutdatabase.windows.net" -ElasticPoolName ""  -Edition ""  -VCore 4  -ComputeGeneration "Gen5" -LicenseType LicenseIncluded 

    Scale Down

    Set-AzureRmSqlElasticPool -ResourceGroupName ""  -ServerName "" -ElasticPoolName ""  -Edition "Basic"     -LicenseType LicenseIncluded -Dtu 50


    Navin.D http://dnavin.wordpress.com

    • Marked as answer by Navind Friday, May 22, 2020 5:56 PM
    Friday, May 22, 2020 5:56 PM