2
votes

New-AzureSqlDatabase command on execution suddently started failing with parameter not found message. MSDN link mentions the parameter as supported. https://msdn.microsoft.com/en-us/library/dn546722.aspx

Command : New-AzureSqlDatabase

Input

PS C:\scripts>$database1 = New-AzureSqlDatabase -ServerName "lpqd0zbrseg" -DatabaseName "Database1" -Edition "Business" -MaxSizeGB 50 -Collation "SQL_Latin1_General_CP1_CI_AS"

Output Error

New-AzureSqlDatabase : A parameter cannot be found that matches parameter name 'MaxSizeGB'. At line:1 char:103 + ... dition "Basic" -MaxSizeGB 1 -Collation "SQL_Latin1_General_CP1_CI_AS" + ~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-AzureSqlDatabase], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands.Sql.Database.Cmdlet.NewAzureSqlDatabas

What would be the reason that MaxSizeGB parameter got not found on execution. Thanks in advance

With Regards,

H Bala

1
For some reason your output error shows "Edition" as Basic and "MaxSizeGB" as 1. Why is that?Gaurav Mantri
The Input version was from the examples in the shared msdn link which I referred here. I have used the -Edition as "Web" with MaxSizeGB set to 1 or 5 initially. The debugger mentioned to use one of the enumerated values : Free, Basic, Standard and Premium. So, I changed -Edition to Basic and used the default 1GB. Now, this was showing the parameter not found. Quite strange, as I was able to create database till a day ago.H Bala

1 Answers

3
votes

Business and Wed editions are a deprecated service level. Now, the service levels are Free, Basic, Standard & Premium as the error shows.

About the parameter, are you using the Azure PowerShell module configured as "Resource Manager" or "Service Management"? The first one hasn't that value but the second one have it.

You can change it with "Switch-AzureMode". You can find the explanation in the second section of the page.