title: Import a database using AzureRM Powershell
body: <p>There is a document named <a href="https://azure.microsoft.com/en-gb/documentation/articles/sql-database-import-powershell/" rel="nofollow">Import a BACPAC file to create a new Azure SQL database using PowerShell</a> that covers how to import a bacpac file into SQL server under ASM. </p>
  
  <p>Is there a way to import a bacpac file into an Azure SQL Server using Azure Resource Management cmdlets. </p>
  
  <p>Following on from @juvchan answer I have been trying to get the following to work. </p>
  
  <pre><code>$update = @{
              "operationMode" = "Import"
              "storageKey"= "Key"
              "storageKeyType" = "Primary"
              "administratorLogin"= "adminlogin"
              "administratorLoginPassword"= "adminpassword"
              "storageUri"= "https://example.blob.core.windows.net/sql/exampleIOSQL-2016-1-23-12-26.bacpac"
              }
  New-AzureRmResource -ResourceGroupName "resourcegroupname" `
                  -ResourceType "Microsoft.Sql/servers" `
                  -Name "sqldbsvr" `
                  -PropertyObject $update `
                  -ApiVersion 2015-08-01 `
                  -Force -Location "westeurope" 
  </code></pre>
  
  <p>Unfortunately I can't get anything but this very helpful error message -</p>
  
  <blockquote>
    <p>New-AzureRmResource : {"code":"","message":"An error occurred while processing this request.","target":null,"details":[],"innererror":[]}</p>
  </blockquote>