Skip to content

SQL v12 Preview - Start-AzureSqlDatabaseExport doesn't like the connection context #136

Closed
@ntwest

Description

@ntwest

Using the sample "Example 1" in the documentation (https://msdn.microsoft.com/en-us/library/azure/dn546720.aspx), against a v12 preview SQL Azure database server, I am getting this error:

Start-AzureSqlDatabaseExport : Cannot bind parameter 'SqlConnectionContext'. Cannot convert the 
"Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.TSqlConnectionContext" value of type 
"Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.TSqlConnectionContext" to type 
"Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.ServerDataServiceSqlAuth".
At line:10 char:69
+ $exportRequest = Start-AzureSqlDatabaseExport -SqlConnectionContext $SqlCtx -Sto ...
+                                                                     ~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Start-AzureSqlDatabaseExport], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.StartAzureSqlDatabaseExport

Here's the code (keys & server names scrubbed):

$StorageName = "SCRUBBED"
$StorageKey = "SCRUBBED"
$BlobName = "SCRUBBED"
$ServerName = "SCRUBBED"
$DatabaseName = "SCRUBBED"
$credential = Get-Credential


$SqlCtx = New-AzureSqlDatabaseServerContext -ServerName $ServerName -Credential $credential
$StorageCtx = New-AzureStorageContext -StorageAccountName $StorageName -StorageAccountKey $StorageKey
$Container = Get-AzureStorageContainer -Name $ContainerName -Context $StorageCtx
$exportRequest = Start-AzureSqlDatabaseExport -SqlConnectionContext $SqlCtx -StorageContainer $Container -DatabaseName $DatabaseName -BlobName $BlobName

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQLService AttentionThis issue is responsible by Azure service team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions