Reputation: 477
Cannot find any references for creating a Standard or Premium database in SQL Azure with PowerShell. The preview feature is enabled for the account.
Update
Error message when trying to create a Standard database:
"Invalid value provided for parameter EDITION. Please provide a value that is valid on server version 1.0."
Upvotes: 0
Views: 1723
Reputation: 477
It seems 2 key pieces were missing. The Service Objective and specifying the version on SQL server creation. The server version defaults to 1.0 (only for Web and Business) while 2.0 is required (for Standard or Premium). And a separate Service Objective object needs to be created for Standard or Premium.
$newSqlServer = New-AzureSqlDatabaseServer -Location $location -AdministratorLogin $login -AdministratorLoginPassword $password -Version "2.0"
$sqlContext = New-AzureSqlDatabaseServerContext -ServerName $newSqlServer.ServerName -Credential $credential
$S2 = Get-AzureSqlDatabaseServiceObjective $sqlContext -ServiceObjectiveName "S2"
New-AzureSqlDatabase -ServerName $newSqlServer.ServerName -DatabaseName $databaseName -Edition "Standard" -MaxSizeGB 10 -Collation "SQL_Latin1_General_CP1_CI_AS" -ServiceObjective $S2
Upvotes: 1
Reputation: 484
Currently, we support following API for creating database with service tier/performance level:
The level of support however differs between these APIs.
T-SQL 1. Supports specifying edition/service level only 2. Performance level will default to the lowest one for the service tier
PS cmdlet/REST API 1. Supports all options - service tiers & performance levels
Also, in current preview we support the new service tiers only on newly created servers. This means if you have existing server they will not have the ability to create new service tiers like Basic/Standard.
We are looking at relaxing these restrictions in the future. Link below has details:
http://msdn.microsoft.com/library/azure/dn369872.aspx
Upvotes: 0
Reputation: 54821
A simple google search gives you New-AzureSqlDatabase. Also found a sample here: How to create Windows Azure SQL Database - MSDN Blogs. Modified sample:
#Guessing you already have a db server
$cred = Get-Credential
$ctx = New-AzureSqlDatabaseServerContext -ServerName "<servername>" -Credential $cred
New-AzureSqlDatabase $ctx -DatabaseName "<dbname>" -MaxSizeGB 1 -Edition Standard
-Collation "SQL_Latin1_General_CP1_CI_AS"
Update: The help documentation on TechNet for New-AzureSqlDatabase says Standard and Premium are available too.
-Edition
The edition for the SQL Database. Acceptable values are Web, Business, Basic, Standard, and Premium. The default value is Web.
Upvotes: 0