Cannot make import/export to work for the Import Export Service Client v1.2

Sep 12, 2011 at 10:46 AM

Hi,

I know there's a thread with almost the same name and I've read it through but I cannot solve my problem. I cannot successfully run import or export of an SQL Azure Database, even though I can successfully retrieve the status of import / export operations. I have successfully performed import and export using the interface in the Management Portal, so as to verify there is no problem with access, storage, etc.

The problem is that the .exe does not give me *ANY* hint of what the problem is! It simply displays the basic text. So when executing the following command:

DacIESvcCli.exe -s XXXXXXXXXX.database.windows.net -d XXX.XXX.XXXXXXXX -u XXXXXXXXX -p XXXXXXXXX –bloburl "http://XXXXXXXXX.blob.core.windows.net/db-backup/bacpacFilename.bacpac" -blobaccesskey "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==" -accesskeytype storage –x

I simply get:

Microsoft (R) SQL DAC Import Export Service Sample version 1.2.0.0
Copyright (C) Microsoft Corporation. All rights reserved.

Arguments validation completed.
Command Line Parameters:
-H[elp] | -?                       Show this help text
-X[export]                         Perform an export action(*4)
-I[mport]                          Perform an import action
-D[atabase] <database>             Target database name
-S[erver] <servername>             SQL Azure Server Name
-U[ser]                            Database user name
-P[assword]                        Database user password
-EDITION <business|web>            SQL Azure edition (*2)
-SIZE <1>                          Max SQL Azure database size in GB(*2)
-BLOB[URL] <url>                   Azure Blob URL (*6)
-BLOBACCESS[K]EY <key>             Azure Blob Access Key (*6)
-ACCESSKEY[T]YPE <shared|storage>  Blob Access Key Type (*6)
-STATUS                            Status of operations (*5)
-R[equestId] <requestId>           Request Id of an operation, used for status (
*5)


Usage:
Export a database to a bacpac in Azure Blob Storage:
   DacIESvcCli -S myserver  -U azureuser -P azurepwd -D northwind -X -BLOBACCESS
KEY sharedkey -BLOBURL http://myurl/container/newfile.bacpac -ACCESSKEYTYPE shar
ed

Import a bacpac to SQL Azure from Azure Blob Storage:
   DacIESvcCli -S myazure -U azureuser -P azurepwd -D nw_restored -I -EDITION we
b -SIZE 5 -BLOBACCESSKEY key -BLOBURL http://myurl/container/file.bacpac -ACCESS
KEYTYPE storage

Find the status of the requests (requires server and a username / password) :
   DacIESvcCli -STATUS -S myazure -U myuser -P p@ssword [-R myreqId]

*Notes and caveats:
1. On import the database must not exist.  A new database is
   always created. SQL Azure uses system edition defaults if not set.
2. Choose the SQL Azure options desired, this may impact billing.
   (Only valid against SQL Azure)
3. See SQL Server Books Online Topic:
   Understanding Data-tier Applications
   for more information about DAC.
4. Blob will be overwritten if it exists.
5. Status is for all recent submissions on a server level.
   A valid username and password for this server must be supplied.
   To see status for a single requestid it must be provided.
6. The Azure Storage may be used in storage or shared access modes.
   To generate a shared access key see the FAQ.

 

Any idea about what I'm doing wrong? I've tried writing from scratch the command line a zillion times, using or not quotes, using or not capitals but nothing...

Thanx in advance,

Kostas

Sep 12, 2011 at 4:36 PM

Sorry you are having problems.  Please remember this is a sample code project, meaning you should download the code and step through it if you have a problem.  It is not really "end user friendly" in the regard of having the best error messages, etc.  It gives basic error handling only.

DacIESvcCli.exe -s XXXXXXXXXX.database.windows.net -d XXX.XXX.XXXXXXXX -u XXXXXXXXX -p XXXXXXXXX –bloburl "http://XXXXXXXXX.blob.core.windows.net/db-backup/bacpacFilename.bacpac" -blobaccesskey "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==" -accesskeytype storage –x

Let's walk through your command line to see if anything jumps out.

You are using the service CLI tool, so verify you have a config file in the same directory as the EXE and that both of them have been unblocked since you downloaded the binaries.

Make sure you want to communicate to the service, that tool will not work against an on premise server.

-d you put .'s in the name.  Does your database have .'s in the name?  If your Sql Azure server is abc123.database.azure.com, and a database named test123 is on that server, you would only put test123 as the database name. 

-s would be the server name abc123.database.azure.com.  I don't see where you specified a server name in your example command line.

-u this would be the username on the database

-p the password for that user.  If the password cannot work on a normal command line application (it has a *,%, etc) then you should put "s around it.

-bloburl the full URL to the blob

-blobaccess key with a setting of storage means you are giving the primary access key from the Azure portal.

-x is for export

 

That is all I see.  Looks like you never specified a server.

Usually when the tool outputs the help it means that something it needed was not present.

 

Sep 12, 2011 at 5:26 PM

Hi Jason:

Thanx for the help, I realize this is a sample code project and yes my next option will be to download the source and debug. But before getting to that I answer to your indications in blue:

JasonShort wrote:

Sorry you are having problems.  Please remember this is a sample code project, meaning you should download the code and step through it if you have a problem.  It is not really "end user friendly" in the regard of having the best error messages, etc.  It gives basic error handling only.

DacIESvcCli.exe -s XXXXXXXXXX.database.windows.net -d XXX.XXX.XXXXXXXX -u XXXXXXXXX -p XXXXXXXXX –bloburl "http://XXXXXXXXX.blob.core.windows.net/db-backup/bacpacFilename.bacpac" -blobaccesskey "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==" -accesskeytype storage –x

Let's walk through your command line to see if anything jumps out.

You are using the service CLI tool, so verify you have a config file in the same directory as the EXE and that both of them have been unblocked since you downloaded the binaries.

I didn't need to unblock it even though I read this was a problem for some users. My guess is that as I run as administrator there was no such need. Anyway, I don't get the same error the other users were getting so I that shouldn't be the problem.

Make sure you want to communicate to the service, that tool will not work against an on premise server. True, that is what I want.

-d you put .'s in the name.  Does your database have .'s in the name?  If your Sql Azure server is abc123.database.azure.com, and a database named test123 is on that server, you would only put test123 as the database name. 

Yeap, my database does have .'s in the name. I tried putting the database name inside quotes but no luck.

-s would be the server name abc123.database.azure.com.  I don't see where you specified a server name in your example command line.

It's the first parameter in the command line I wrote, -s XXXXXXXXXX.database.windows.net. Also tried to put the server name in quotes but nothing...

-u this would be the username on the database

-p the password for that user.  If the password cannot work on a normal command line application (it has a *,%, etc) then you should put "s around it. Checked, problem is not this one.

-bloburl the full URL to the blob It's ok, in fact I used the exact same in the Azure Portal and the import was successfull. I also tried with quotes...

-blobaccess key with a setting of storage means you are giving the primary access key from the Azure portal. True, that is what I give.

-x is for export

 

That is all I see.  Looks like you never specified a server.

Usually when the tool outputs the help it means that something it needed was not present.

I hope to have some time tomorrow to debug and see what's going on.

Thanx again,

Kostas

Sep 12, 2011 at 5:32 PM

Sorry, missed the -S at the start.

The server name should always have dot's in it.  So that should not be a problem.

The database name having dots or special characters is the one case I can think of that would be a problem.

What I usually do is try to change one of the command lines at a time and see what I get (or just leave it off).  Make sure I am getting some sort of message that way, and then work from there.

I will loop this to another dev who is active on the project.

 

Sep 12, 2011 at 6:09 PM

Ok, found the problem in a terrible "aha" moment. I opened the file where I had all the commands with Notepad++ and saw some characters that were not supposed to be there. Then I went to the page "DAC Import/Export Hosted as a Service" (Documentation --> Import Export Service Client) and realized my mistake. If you notice the command line examples for import and export in that page you'll see that some of the dashes are different:

DacIESvcCli.exe -s serverName.database.windows.net -d AdventureWorkse -u MyAdminLogin -p MyPassword –bloburl http://blobAccountName.blob.core.windows.net/blobContainerName/bacpacFilename.bacpac -blobaccesskey MyKey -accesskeytype storage –x

Having copied this text from that page it so happened that the dash before bloburl and x was incorrect.

Please correct this so that other users that are as clumsy as I am will not run into the same problem :)

Thanx for the help, it really helped me reach the solution! Keep up the good work!

Kostas

DacIESvcCli.exe -s serverName.database.windows.net -d AdventureWorkse -u MyAdminLogin -p MyPassword –bloburl http://blobAccountName.blob.core.windows.net/blobContainerName/bacpacFilename.bacpac -blobaccesskey MyKey -accesskeytype storage –x
Sep 12, 2011 at 6:38 PM

Hi Kostas,

Thanks for getting to the bottom of this and notifying us. I updated the documentation to contain correct and consistent dashes.