title: Export SQL Azure db to blob - Start-AzureSqlDatabaseExport : Cannot convert AzureStorageContainer to AzureStorageContainer
body: <p>I am using <a href="https://stackoverflow.com/questions/36261258/start-azuresqldatabaseexport-object-reference-not-set-to-an-instance-of-an-obje">this code found</a> on stack , and all connections are correct.</p>
  
  <pre><code>Import-Module Azure 
  Import-Module Azure.Storage
  
  Get-AzureRmSubscription –SubscriptionName “Production” | Select-AzureRmSubscription
  
  # Username for Azure SQL Database server
  $ServerLogin = "username"
  
  # Password for Azure SQL Database server
  $serverPassword = ConvertTo-SecureString "abcd" -AsPlainText -Force
  
  
  # Establish credentials for Azure SQL Database Server 
  $ServerCredential = new-object System.Management.Automation.PSCredential($ServerLogin, $serverPassword) 
  
  # Create connection context for Azure SQL Database server
  $SqlContext = New-AzureSqlDatabaseServerContext -FullyQualifiedServerName “myspecialsqlserver.database.windows.net” -Credential $ServerCredential
  
  $StorageContext = New-AzureStorageContext -StorageAccountName 'prodwad' -StorageAccountKey 'xxxxx'
  $Container = Get-AzureStorageContainer -Name 'automateddbbackups' -Context $StorageContext
  
  $exportRequest = Start-AzureSqlDatabaseExport -SqlConnectionContext $SqlContext -StorageContainer $Container -DatabaseName 'Users' -BlobName 'autobackupotest.bacpac' -Verbose -Debug
  </code></pre>
  
  <p>I am getting this error. I have spent hours on this.</p>
  
  <pre><code>Start-AzureSqlDatabaseExport : Cannot bind parameter 'StorageContainer'. Cannot convert the 
  "Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel.AzureStorageContainer" value of type 
  "Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel.AzureStorageContainer" to type 
  "Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel.AzureStorageContainer".
  At line:31 char:99
  + ... SqlConnectionContext $SqlContext -StorageContainer $Container -Databa ...
  +                                                        ~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (:) [Start-AzureSqlDatabaseExport], ParameterBindingException
      + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.StartAzureSqlDatabaseExport
  </code></pre>
  
  <p>I am using AzureRM 3.8.0</p>