This commit is contained in:
Jinming Hu 2019-09-17 13:49:02 +08:00 коммит произвёл Vincent Jiang (LEI)
Родитель 132989cfe0
Коммит 289d9f4716
7 изменённых файлов: 73 добавлений и 159 удалений

Просмотреть файл

@ -1,6 +1,15 @@
Azure Storage Client Library for C++
History of Breaking Changes
Breaking Changes in v7.0:
- Default Rest API version is 2019-02-02.
- Upgraded Casablanca dependency to 2.10.14.
- Raised minumim required GCC version to 5.1.
- SAS returned by calling `azure::storage::cloud_blob::get_shared_access_signature` on a snapshot object only has access to the snapshot, not the entire blob including every snapshots as before.
- Fix a typo in API `azure::storage::cloud_file_share::download_share_usage_async`.
- Fix a typo in API `azure::storage::cloud_queue_message::next_visible_time`.
- `azure::storage::get_wastorage_ambient_scheduler` always returns by value.
Breaking Changes in v6.0:
- `azure::storage::blob_request_options` now accept max_execution_time as `std::chrono::milliseconds`. However, previous `std::chrono::seconds` can automatically converted to `std::chrono::milliseconds`. There can be behavioral change since the precision has changed.
- Resolved an issue where the first forward slash in the front of the blob name will always be trimmed. This would cause blobs with name trimmed prior to this release no longer reachable with the same input.

Просмотреть файл

@ -1,6 +1,17 @@
Azure Storage Client Library for C++
History of Changes
Changes in v7.0.0
- Default REST API version is 2019-02-02.
- Upgraded CPPRest to latest version 2.10.14.
- Raised minimum required GCC version to 5.1.
- Added new API `azure::storage::cloud_file_share::download_share_usage_in_bytes`.
- SAS returned by calling `azure::storage::cloud_blob::get_shared_access_signature` on a snapshot object only has access to the snapshot, not the entire blob including every snapshots as before.
- Added support for AAD based OAuth bearer token authentication.
- Added support for CRCC64 transactional data integrity machanism as an alternative to MD5.
- Added new API `azure::storage::cloud_file_share::upload_file_permission`, `azure::storage::cloud_file_share::download_file_permission` to support to create/retrieve a security descriptor at the Azure File share level,
- Added support for a set of new headers on Azure File APIs.
Changes in v6.1.0
- Default REST API version is 2018-03-28.
- Upgraded CPPRest to latest version: 2.10.13.

Просмотреть файл

@ -38,7 +38,7 @@ PROJECT_NAME = "Microsoft Azure Storage Client Library for C++"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 6.1.0
PROJECT_NUMBER = 7.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

Просмотреть файл

@ -149,8 +149,8 @@ set(AZURESTORAGE_LIBRARY azurestorage)
set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARY} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${UUID_LIBRARIES} ${LibXML2_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
# Set version numbers centralized
set (AZURESTORAGE_VERSION_MAJOR 6)
set (AZURESTORAGE_VERSION_MINOR 1)
set (AZURESTORAGE_VERSION_MAJOR 7)
set (AZURESTORAGE_VERSION_MINOR 0)
set (AZURESTORAGE_VERSION_REVISION 0)
# Set output directories.

Просмотреть файл

@ -380,21 +380,21 @@ DAT(xml_access_tier_change_time, _XPLATSTR("AccessTierChangeTime"))
DAT(json_file_permission, _XPLATSTR("permission"))
#define STR(x) #x
#define VER(x) _XPLATSTR("Azure-Storage/6.1.0 (Native; Windows; MSC_VER " STR(x) ")")
#define VER(x) _XPLATSTR("Azure-Storage/7.0.0 (Native; Windows; MSC_VER " STR(x) ")")
#if defined(_WIN32)
#if defined(_MSC_VER)
#if _MSC_VER >= 1900
DAT(header_value_user_agent, VER(_MSC_VER))
#elif _MSC_VER >= 1800
DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/6.1.0 (Native; Windows; MSC_VER 18XX)"))
DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/7.0.0 (Native; Windows; MSC_VER 18XX)"))
#else
DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/6.1.0 (Native; Windows; MSC_VER < 1800)"))
DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/7.0.0 (Native; Windows; MSC_VER < 1800)"))
#endif
#else
DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/6.1.0 (Native; Windows)"))
DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/7.0.0 (Native; Windows)"))
#endif
#else
DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/6.1.0 (Native)"))
DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/7.0.0 (Native)"))
#endif
#endif // _CONSTANTS

Двоичные данные
Microsoft.WindowsAzure.Storage/version.rc

Двоичный файл не отображается.

196
README.md
Просмотреть файл

@ -1,4 +1,4 @@
# Azure Storage Client Library for C++ (6.1.0)
# Azure Storage Client Library for C++ (7.0.0)
The Azure Storage Client Library for C++ allows you to build applications against Microsoft Azure Storage. For an overview of Azure Storage, see [Introduction to Microsoft Azure Storage](http://azure.microsoft.com/en-us/documentation/articles/storage-introduction/).
@ -55,29 +55,37 @@ cd azure-storage-cpp
To build with source code, there are three ways:
**Via Vcpkg**
You can manage the dependencies with Vcpkg, and use Visual Studio 2015 update 3 or Visual Studio 2017 for development environment. Simply install Casablanca via Vcpkg will setup everything needed.
```
C:\src\vcpkg> .\vcpkg install cpprestsdk
```
- Via Vcpkg
**Via NuGet**
Because Casablanca does not release NuGet packages anywhere anymore, Starting from 5.1.0, this repository cannot be built with pre-built Casablanca NuGet packages. However, you can export your own version of Casablanca NuGet packages to install dependencies of this project:
```
C:\src\vcpkg> .\vcpkg install cpprestsdk
C:\src\vcpkg> .\vcpkg export --nuget cpprestsdk --nuget-id=Casablanca --nuget-version=2.10.13
```
You can manage the dependencies with Vcpkg, and use Visual Studio 2015 update 3 or Visual Studio 2017 for development environment. Simply install Casablanca via Vcpkg will setup everything needed.
```BatchFile
C:\src\vcpkg> .\vcpkg install cpprestsdk
```
**Manage dependencies by yourself**
It is not recommended to manage dependencies by yourself. However, you can still build Casablanca by yourself and specify the include directories and link binaries.
- Via NuGet
Because Casablanca does not release NuGet packages anywhere anymore, Starting from 5.1.0, this repository cannot be built with pre-built Casablanca NuGet packages. However, you can export your own version of Casablanca NuGet packages to install dependencies of this project:
```BatchFile
C:\src\vcpkg> .\vcpkg install cpprestsdk
C:\src\vcpkg> .\vcpkg export --nuget cpprestsdk --nuget-id=Casablanca --nuget-version=2.10.14
```
- Manage dependencies by yourself
It is not recommended to manage dependencies by yourself. However, you can still build Casablanca by yourself and specify the include directories and link binaries.
If you want to build and run test code, you can install UnitTest++ via vcpkg:
```BatchFile
C:\src\vcpkg> .\vcpkg install unittest-cpp
```
### Via NuGet
To install the binaries for the Azure Storage Client Library for C++, you can export a NuGet package with Vcpkg and put it into your local NuGet feed. For more information about how to export a NuGet package, please see [Binary Export](https://github.com/Microsoft/vcpkg/blob/master/docs/specifications/export-command.md).
Normally, exporting NuGet package is done with the following command:
```
C:\src\vcpkg> .\vcpkg export --nuget azure-storage-cpp --nuget-id=Microsoft.Azure.Storage.CPP --nuget-version=6.0.0
```BatchFile
C:\src\vcpkg> .\vcpkg export --nuget azure-storage-cpp --nuget-id=Microsoft.Azure.Storage.CPP --nuget-version=7.0.0
```
### Via Vcpkg
@ -85,7 +93,7 @@ C:\src\vcpkg> .\vcpkg export --nuget azure-storage-cpp --nuget-id=Microsoft.Azur
To install the Azure Storage Client Library for C++ through Vcpkg, you need Vcpkg installed first. Please follow the instructions(https://github.com/Microsoft/vcpkg#quick-start) to install Vcpkg.
install package with:
```
```BatchFile
C:\src\vcpkg> .\vcpkg install azure-storage-cpp
```
@ -114,6 +122,7 @@ The validated Casablanca version for each major or recent release on different p
| 5.2.0 | 2.10.6 | 2.10.3 |
| 6.0.0 | 2.10.10 | 2.10.10 |
| 6.1.0 | 2.10.13 | 2.10.13 |
| 7.0.0 | 2.10.14 | 2.10.14 |
## Code Samples
@ -209,7 +218,7 @@ git clone https://github.com/Microsoft/cpprestsdk.git
- Checkout the version on which Azure Storage Client Library for C++ depends:
```bash
git checkout tags/v2.10.13 -b v2.10.13
git checkout tags/v2.10.14 -b v2.10.14
```
- Build the project in Release mode
@ -284,21 +293,21 @@ vi ../../samples/SamplesCommon/samples_common.h # modify connection string to in
./samplesqueues # run the queues sample
```
### Getting Started on RHEL 7
### Getting Started on CentOS 6/7
*Please note the following build script is only tested on RHEL 7.5. The script may need to be updated accordingly for other distributions.*
*Please note the following build script is only tested on CentOS 6.10 and 7.6. The script may need to be updated accordingly for other distributions.*
Before building the Azure Storage Client Library on C++, some prerequisites need to be installed first:
- Install prerequisites:
```bash
sudo yum install git gcc-c++ openssl-devel libxml2-devel libuuid-devel
sudo yum install epel-release centos-release-scl
sudo yum install git cmake3 make openssl-devel libxml2-devel libuuid-devel
```
- Download and install cmake3:
- Install and enable to use gcc-c++. Note that `devtoolset-4` may be not available on some platforms, you can choose to install whichever newer than that, like `devtoolset-8`.
```bash
wget -O cmakeinstall.sh https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.sh
chmod a+x cmakeinstall.sh
sudo ./cmakeinstall.sh --prefix=/usr
sudo yum install devtoolset-4-gcc-c++
scl enable devtoolset-4 bash
```
- Download and install boost
@ -319,16 +328,16 @@ git clone https://github.com/Microsoft/cpprestsdk.git
- Checkout the version on which Azure Storage Client Library for C++ depends:
```bash
git checkout tags/v2.10.13 -b v2.10.13
cd cpprestsdk
git checkout tags/v2.10.14 -b v2.10.14
```
- Build the project in Release mode
```bash
cd cpprestsdk/Release
git submodule update --init
mkdir build.release
cd build.release
cmake .. -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF
mkdir Release/build.release
cd Release/build.release
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF
sudo make install
```
@ -345,7 +354,7 @@ The project is cloned to a folder called `azure-storage-cpp`. Always use the mas
cd azure-storage-cpp/Microsoft.WindowsAzure.Storage
mkdir build.release
cd build.release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake3 .. -DCMAKE_BUILD_TYPE=Release
make
```
@ -362,14 +371,14 @@ git clone https://github.com/unittest-cpp/unittest-cpp.git
- Build and install the project:
```bash
cd unittest-cpp/builds/
cmake ..
cmake3 ..
sudo make install
```
Build and run unit test against Azure Storage Client Library for C++:
- Build the test code:
```bash
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
make
```
- Run unit tests
@ -379,128 +388,13 @@ vi test_configurations.json # modify test config file to include your storage ac
./azurestoragetest
```
To build sample code:
- To build sample code:
```bash
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON
make
```
To run the samples:
```bash
cd Binaries
vi ../../samples/SamplesCommon/samples_common.h # modify connection string to include your storage account credentials
./samplesblobs # run the blobs sample
./samplesjson # run the tables sample with JSON payload
./samplestables # run the tables sample
./samplesqueues # run the queues sample
```
### Getting Started on RHEL 6
*Please note the following build script is only tested on RHEL 6.9. The script may need to be updated accordingly for other distributions.*
Before building the Azure Storage Client Library on C++, some prerequisites need to be installed first:
- Install prerequisites:
```bash
sudo yum install git openssl-devel libxml2-devel libuuid-devel
```
- Install and enable to use gcc-c++
```bash
sudo yum install devtoolset-3-gcc-c++.x86_64
scl enable devtoolset-3 bash
```
- Download and install cmake3:
```bash
wget -O cmakeinstall.sh https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.sh
chmod a+x cmakeinstall.sh
sudo ./cmakeinstall.sh --prefix=/usr
```
- Download and install boost
```bash
wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
tar xvf boost_1_68_0.tar.gz
cd boost_1_68_0
./bootstrap.sh
sudo ./b2 install
```
The Azure Storage Client Library for C++ depends on Casablanca, following are instructions to build and install Casablanca:
- Clone the project using git:
```bash
git clone https://github.com/Microsoft/cpprestsdk.git
```
- Checkout the version on which Azure Storage Client Library for C++ depends:
```bash
git checkout tags/v2.10.13 -b v2.10.13
```
- Build the project in Release mode
```bash
cd cpprestsdk/Release
git submodule update --init
mkdir build.release
cd build.release
cmake .. -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
sudo make install
```
To build the Azure Storage Client Library for C++ project:
- Clone the project using git:
```bash
git clone https://github.com/Azure/azure-storage-cpp.git
```
The project is cloned to a folder called `azure-storage-cpp`. Always use the master branch, which contains the latest release.
- Build the SDK in Release mode:
```bash
cd azure-storage-cpp/Microsoft.WindowsAzure.Storage
mkdir build.release
cd build.release
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON
make
```
The library is generated under `azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release/Binaries/`.
The Azure Storage Client Library for C++ project depends on Unitest++ for unit test:
To build and install Unitest++:
- Clone the project using git:
```bash
git clone https://github.com/unittest-cpp/unittest-cpp.git
```
- Build and install the project:
```bash
cd unittest-cpp/builds/
cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
sudo make install
```
Build and run unit test against Azure Storage Client Library for C++:
- Build the test code:
```bash
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
make
```
- Run unit tests
```bash
cd Binaries
vi test_configurations.json # modify test config file to include your storage account credentials
./azurestoragetest
```
To build sample code:
```bash
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
make
```
To run the samples:
- To run the samples:
```bash
cd Binaries
vi ../../samples/SamplesCommon/samples_common.h # modify connection string to include your storage account credentials