请注意,您没有以正确的方式使用cpprest sdk,因为您在上面的代码中所做的是试图直接(错误地)调用Azure Storage REST API,而根本没有通过cpprest sdk。
实际上,Azure Storage REST API合约HTTP标头中的帐户密钥不是纯文本。相反,它是通过中提到的复杂步骤计算的
Authentication for the Azure Storage Services
出于一系列安全考虑。幸运的是,所有这些逻辑都已由cpprest sdk包装,您无需了解其内部工作原理:
// Define the connection-string with your values.
const utility::string_t storage_connection_string(U("DefaultEndpointsProtocol=https;AccountName=your_storage_account;AccountKey=your_storage_account_key"));
// Create the blob client.
azure::storage::cloud_blob_client blob_client = storage_account.create_cloud_blob_client();
我建议你阅读
How to use Blob Storage from C++
首先,在使用cpprest sdk之前。