Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Sign InSign Up

Softans

Softans Logo Softans Logo
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
Home/ Questions/Q 1214
In Process
Anonymous
Anonymous
Asked: January 24, 20222022-01-24T07:32:22+00:00 2022-01-24T07:32:22+00:00

How to set Azure SQL database instance with Min 0,5 vCores with Terraform?

I have Terraform and setting up Azure SQL database.

Currently Compute Hardware are defined as in Terraform:

requested_service_objective_name = “GP_S_Gen5_4”

This will configure Compute Hardware for Max vCores 4 and Min vCores 1.

I have need to configure min vCores as 0,5. If I set up 0.5 and then deploy Terraform with “GP_S_Gen5_4”, I get automatically upgraded to Min vCores 1.

Is there anything I can do to configure size as 0,5 or is 1 actual min when deployed by Terraform?

enter image description here

azure-sql-databaseset azure sql databaseterraform-provider-azurevcores with terraform
  • 0
  • 1 1 Answer
  • 23 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

1 Answer

  • Voted
  • Oldest
  • Recent
  1. Ghulam Nabi
    2022-01-24T07:36:37+00:00Added an answer on January 24, 2022 at 7:36 am

    Set-AzSqlDatabase

    Module:
    Az.Sql

    Sets properties for a database, or moves an existing database into an elastic pool.

    Syntax

    Set-AzSqlDatabase
       [-DatabaseName] <String>
       [-MaxSizeBytes <Int64>]
       [-Edition <String>]
       [-RequestedServiceObjectiveName <String>]
       [-ElasticPoolName <String>]
       [-ReadScale <DatabaseReadScale>]
       [-Tags <Hashtable>]
       [-ZoneRedundant]
       [-AsJob]
       [-LicenseType <String>]
       [-ComputeModel <String>]
       [-AutoPauseDelayInMinutes <Int32>]
       [-MinimumCapacity <Double>]
       [-HighAvailabilityReplicaCount <Int32>]
       [-BackupStorageRedundancy <String>]
       [-SecondaryType <String>]
       [-MaintenanceConfigurationId <String>]
       [-ServerName] <String>
       [-ResourceGroupName] <String>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

    PowerShell

    Set-AzSqlDatabase
       [-DatabaseName] <String>
       [-MaxSizeBytes <Int64>]
       [-Edition <String>]
       [-ReadScale <DatabaseReadScale>]
       [-Tags <Hashtable>]
       [-ZoneRedundant]
       [-AsJob]
       [-VCore <Int32>]
       [-ComputeGeneration <String>]
       [-LicenseType <String>]
       [-ComputeModel <String>]
       [-AutoPauseDelayInMinutes <Int32>]
       [-MinimumCapacity <Double>]
       [-HighAvailabilityReplicaCount <Int32>]
       [-BackupStorageRedundancy <String>]
       [-SecondaryType <String>]
       [-MaintenanceConfigurationId <String>]
       [-ServerName] <String>
       [-ResourceGroupName] <String>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

    PowerShell

    Set-AzSqlDatabase
       [-DatabaseName] <String>
       -NewName <String>
       [-AsJob]
       [-BackupStorageRedundancy <String>]
       [-SecondaryType <String>]
       [-MaintenanceConfigurationId <String>]
       [-ServerName] <String>
       [-ResourceGroupName] <String>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

    Description

    The Set-AzSqlDatabase cmdlet sets properties for a database in Azure SQL Database. This cmdlet can modify the service tier (Edition), performance level (RequestedServiceObjectiveName), and storage max size (MaxSizeBytes) for the database. In addition, you can specify the ElasticPoolName parameter to move a database into an elastic pool. If a database is already in an elastic pool, you can use the RequestedServiceObjectiveName parameter to move the database out of an elastic pool and into a performance level for single databases.

    Examples

    Example 1: Update a database to a Standard S0 database

    PowerShell

    PS C:\>Set-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -Edition "Standard" -RequestedServiceObjectiveName "S0"
    ResourceGroupName             : ResourceGroup01
    ServerName                    : Server01
    DatabaseName                  : Database01
    Location                      : Central US
    DatabaseId                    : a1e6bd1a-735a-4d48-8b98-afead5ef1218
    Edition                       : Standard
    CollationName                 : SQL_Latin1_General_CP1_CI_AS
    CatalogCollation              :
    MaxSizeBytes                  : 268435456000
    Status                        : Online
    CreationDate                  : 7/3/2015 7:33:37 AM
    CurrentServiceObjectiveId     : 455330e1-00cd-488b-b5fa-177c226f28b7
    CurrentServiceObjectiveName   : S0
    RequestedServiceObjectiveId   : 455330e1-00cd-488b-b5fa-177c226f28b7
    RequestedServiceObjectiveName :
    ElasticPoolName               :
    EarliestRestoreDate           :
    Tags                          :

    This command updates a database named Database01 to a Standard S0 database on a server named Server01.

    Example 2: Add a database to an elastic pool

    PowerShell

    PS C:\>Set-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -ElasticPoolName "ElasticPool01"
    ResourceGroupName             : ResourceGroup01
    ServerName                    : Server01
    DatabaseName                  : Database01
    Location                      : Central US
    DatabaseId                    : a1e6bd1a-735a-4d48-8b98-afead5ef1218
    Edition                       : Standard
    CollationName                 : SQL_Latin1_General_CP1_CI_AS
    CatalogCollation              :
    MaxSizeBytes                  : 268435456000
    Status                        : Online
    CreationDate                  : 7/3/2015 7:33:37 AM
    CurrentServiceObjectiveId     : d1737d22-a8ea-4de7-9bd0-33395d2a7419
    CurrentServiceObjectiveName   : ElasticPool
    RequestedServiceObjectiveId   : d1737d22-a8ea-4de7-9bd0-33395d2a7419
    RequestedServiceObjectiveName :
    ElasticPoolName               : elasticpool01
    EarliestRestoreDate           :
    Tags                          :

    This command adds a database named Database01 to the elastic pool named ElasticPool01 hosted on the server named Server01.

    Example 3: Modify the storage max size of a database

    PS C:\>Set-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -MaxSizeBytes 1099511627776
    ResourceGroupName             : ResourceGroup01
    ServerName                    : Server01
    DatabaseName                  : Database01
    Location                      : Central US
    DatabaseId                    : a1e6bd1a-735a-4d48-8b98-afead5ef1218
    Edition                       : Standard
    CollationName                 : SQL_Latin1_General_CP1_CI_AS
    CatalogCollation              :
    MaxSizeBytes                  : 1099511627776
    Status                        : Online
    CreationDate                  : 8/24/2017 9:00:37 AM
    CurrentServiceObjectiveId     : 789681b8-ca10-4eb0-bdf2-e0b050601b40
    CurrentServiceObjectiveName   : S3
    RequestedServiceObjectiveId   : 789681b8-ca10-4eb0-bdf2-e0b050601b40
    RequestedServiceObjectiveName :
    ElasticPoolName               :
    EarliestRestoreDate           :
    Tags                          :

    This command updates a database named Database01 to set its max size to 1 TB.

    Example 4: Update a existing General Purpose database to Hyperscale service tier

    PS C:\>Set-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -Edition "Hyperscale" -RequestedServiceObjectiveName "HS_Gen5_2"
    ResourceGroupName             : ResourceGroup01
    ServerName                    : Server01
    DatabaseName                  : Database01
    Location                      : Central US
    DatabaseId                    : 56246136-839f-4171-80af-4c28142463b1
    Edition                       : Hyperscale
    CollationName                 : SQL_Latin1_General_CP1_CI_AS
    CatalogCollation              :
    MaxSizeBytes                  : -1
    Status                        : Online
    CreationDate                  : 12/6/2020 5:34:16 PM
    CurrentServiceObjectiveId     : 00000000-0000-0000-0000-000000000000
    CurrentServiceObjectiveName   : HS_Gen5_2
    RequestedServiceObjectiveName : HS_Gen5_2
    RequestedServiceObjectiveId   :
    ElasticPoolName               :
    EarliestRestoreDate           : 12/6/2020 5:34:16 PM
    Tags                          : {}
    ResourceId                    : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/servers/Server01/databases/Database01
    CreateMode                    :
    ReadScale                     : Enabled
    ZoneRedundant                 :
    Capacity                      : 2
    Family                        : Gen5
    SkuName                       : HS_Gen5
    LicenseType                   : LicenseIncluded
    AutoPauseDelayInMinutes       :
    MinimumCapacity               :
    ReadReplicaCount              : 1
    BackupStorageRedundancy       : Geo

    This command updates a database named Database01 from General Purpose to Hyperscale service tier.

    Parameters

    -AsJob

    Run cmdlet in the background

    TABLE 1

    Type: SwitchParameter
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -AutoPauseDelayInMinutes

    The auto pause delay in minutes for database (serverless only), -1 to opt out

    TABLE 2

    Type: Int32
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -BackupStorageRedundancy

    The Backup storage redundancy used to store backups for the SQL Database. Options are: Local, Zone and Geo.

    TABLE 3

    Type: String
    Accepted values: Local, Zone, Geo
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -ComputeGeneration

    The compute generation to assign.

    TABLE 4

    Type: String
    Aliases: Family
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -ComputeModel

    Computed model of Azure Sql database. Serverless or Provisioned

    TABLE 5

    Type: String
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -Confirm

    Prompts you for confirmation before running the cmdlet.

    TABLE 6

    Type: SwitchParameter
    Aliases: cf
    Position: Named
    Default value: False
    Accept pipeline input: False
    Accept wildcard characters: False

    -DatabaseName

    Specifies the name of the database.

    TABLE 7

    Type: String
    Aliases: Name
    Position: 2
    Default value: None
    Accept pipeline input: True
    Accept wildcard characters: False

    -DefaultProfile

    The credentials, account, tenant, and subscription used for communication with azure

    TABLE 8

    Type: IAzureContextContainer
    Aliases: AzContext, AzureRmContext, AzureCredential
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -Edition

    Specifies the edition for the database. The acceptable values for this parameter are:

    • None
    • Basic
    • Standard
    • Premium
    • DataWarehouse
    • Free
    • Stretch
    • GeneralPurpose
    • Hyperscale
    • BusinessCritical
    TABLE 9

    Type: String
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -ElasticPoolName

    Specifies name of the elastic pool in which to move the database.

    TABLE 10

    Type: String
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -HighAvailabilityReplicaCount

    The number of readonly secondary replicas associated with the database. For Hyperscale edition only.

    TABLE 11

    Type: Int32
    Aliases: ReadReplicaCount
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -LicenseType

    The license type for the Azure Sql database. Possible values are:

    • BasePrice – Azure Hybrid Benefit (AHB) discounted pricing for existing SQL Server license owners is applied. Database price will be discounted for existing SQL Server license owners.
    • LicenseIncluded – Azure Hybrid Benefit (AHB) discount pricing for existing SQL Server license owners is not applied. Database price will include a new SQL Server license costs.
    TABLE 12

    Type: String
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -MaintenanceConfigurationId

    The Maintenance configuration id for the SQL Database.

    TABLE 13

    Type: String
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -MaxSizeBytes

    The maximum size of the Azure SQL Database in bytes.

    TABLE 14

    Type: Int64
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -MinimumCapacity

    The Minimal capacity that database will always have allocated, if not paused. For serverless Azure Sql databases only.

    TABLE 15

    Type: Double
    Aliases: MinVCore, MinCapacity
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -NewName

    The new name to rename the database to.

    TABLE 16

    Type: String
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -ReadScale

    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.

    TABLE 17

    Type: DatabaseReadScale
    Accepted values: Disabled, Enabled
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -RequestedServiceObjectiveName

    Specifies the name of the service objective to assign to the database. For information about service objectives, see Azure SQL Database Service Tiers and Performance Levels in the Microsoft Developer Network Library.

    TABLE 18

    Type: String
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -ResourceGroupName

    Specifies the name of resource group to which the server is assigned.

    TABLE 19

    Type: String
    Position: 0
    Default value: None
    Accept pipeline input: True
    Accept wildcard characters: False

    -SecondaryType

    The secondary type of the database if it is a secondary. Valid values are Geo and Named.

    TABLE 20

    Type: String
    Accepted values: Named, Geo
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -ServerName

    Specifies the name of the server that hosts the database.

    Type: String
    Position: 1
    Default value: None
    Accept pipeline input: True
    Accept wildcard characters: False

    -Tags

    Key-value pairs in the form of a hash table. For example: @{key0=”value0″;key1=$null;key2=”value2″}

    Type: Hashtable
    Aliases: Tag
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -VCore

    The Vcore number for the Azure Sql database

    Type: Int32
    Aliases: Capacity, MaxVCore, MaxCapacity
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    -WhatIf

    Shows what would happen if the cmdlet runs. The cmdlet is not run.

    Type: SwitchParameter
    Aliases: wi
    Position: Named
    Default value: False
    Accept pipeline input: False
    Accept wildcard characters: False

    -ZoneRedundant

    The zone redundancy to associate with the Azure Sql Database

    Type: SwitchParameter
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False

    Inputs

    String

    Outputs

    AzureSqlDatabaseModel

    Related Links

    • Get-AzSqlDatabase
    • New-AzSqlDatabase
    • Remove-AzSqlDatabase
    • Resume-AzSqlDatabase
    • Suspend-AzSqlDatabase
    • SQL Database Documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • Popular
  • Answers
  • Ghulam Nabi

    Why are the British confused about us calling bread rolls ...

    • 5 Answers
  • Ghulam Nabi

    Is this statement, “i see him last night” can be ...

    • 4 Answers
  • Alex

    application has failed to start because no appropriate graphics hardware ...

    • 4 Answers
  • Ghulam Nabi
    Ghulam Nabi added an answer To resolve the NullPointerException, you need to identify the variable… March 15, 2023 at 8:25 am
  • Ghulam Nabi
    Ghulam Nabi added an answer You can replace the PnP code in your Azure Function… February 13, 2023 at 7:11 am
  • Ghulam Nabi
    Ghulam Nabi added an answer You can use the $match stage in the aggregate pipeline… February 10, 2023 at 6:20 am

Trending Tags

android c++ cypress flutter java javascript python selenium testng webdriver

Top Members

Robert

Robert

  • 3 Questions
  • 1k Points
Luci

Luci

  • 5 Questions
  • 1k Points
Kevin O Brien

Kevin O Brien

  • 2 Questions
  • 1k Points

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Softans

Softans is a social questions & Answers Engine which will help you establish your community and connect with other people.

About Us

  • Blog
  • Jobs
  • About Us
  • Meet The Team
  • Contact Us

Legal Stuff

Help

Follow

© 2021 Softans. All Rights Reserved
With Love by Softans.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.