Before you install and use Windows Azure ImportExportSample Sample you must:
- Review the Windows Azure ImportExportBlob Sample license terms by clicking the Custom link above.
- Print and retain a copy of the license terms for your records.
By downloading and using the Windows Azure ImportExportBlob Sample, you agree to such license terms. If you do not accept them, do not use the software.
Introduction
The Windows Azure ImportExportBlob Sample
is a command-line tool that exports the contents of a directory to blobs within a container in a storage account, and imports a container of blobs from the storage account to a directory. The storage account used is configurable with the application configuration
file.
Prerequisites
- Storage account– The sample is configured for using the Windows Azure Compute Emulator
and the blobs with the context imported from a directory are collected in a local storage account. If you want to use this
sample with a subscription in Windows Azure, you must create a storage account in Windows Azure and provide the account information in the service configuration for the sample.
- Windows Azure SDK–
provides tools and files that are needed to complete the development process of an application for Windows Azure.
- Visual
Studio 2010 – the sample provides a Visual Studio 2010 project that you can use to deploy the sample.
Building and Running the Sample
To run the sample from Visual Studio 2010
- Open Visual Studio 2010 as an administrator.
- Browse to the folder where you extracted the sample and open ImportExportBlobConsole.sln.
- Press F6 to build the solution.
- Open a Command Prompt windowand then enter the ImportExportBlob
command with the needed options. For more information about the available options, see
ImportExportBlob Options.
ImportExportBlob
options
Syntax
ImportExportBlob
[-o command -d local-directory-path [-c container-name]] | [-h]
Options
-h
Display
help information for the ImportExportBlob application.
-o
export –d local-directory-path
Export
the contents of a directory to a blob container in the storage account.
-o
import -d local-directory-path -c container-name
Import
the contents of a blob container in the storage account to a directory.
Configuring
the storage connection string
By
default, the Windows Azure ImportExportBlob Sample is configured to
use development storage to store and retrieve the blobs that contain the contents of the directory. If you choose to deploy the ImportExportBlob application to Windows Azure, you must change the configuration string in the service model to specify a storage
account in Windows Azure.
To
change the connection string in Visual Studio
- In
Solution Explorer, expand ImportExportBlobConsole,
and then double click App.Config to edit the file.
- In
the appSettings section within the configuration section, locate the following setting for the storage account connection string:
<add key="StorageAccountConnectionString"
value="useDevelopmentStorage=true" />.
- Change
the value to use a connection string for Windows Azure storage. The connection
string must be in the following format: DefaultEndpointsProtocol=[http|https];AccountName=<account-name>;AccountKey=<account-key>