简体   繁体   English

Azure:使用存储模拟器时,帐户名和访问密钥是什么?

[英]Azure: What are the Account Name and Access Key when using the Storage Emulator?

I'm following this guide: 我正在遵循此指南:

http://blogs.msdn.com/b/brian_swan/archive/2010/07/08/accessing-windows-azure-blob-storage-from-php.aspx http://blogs.msdn.com/b/brian_swan/archive/2010/07/08/accessing-windows-azure-blob-storage-from-php.aspx

but with the emulators, and not with an actual Azure account. 但要使用仿真器,而不要使用实际的Azure帐户。

What should I use in this line? 我应该在这行中使用什么?

$storageClient = new Microsoft_WindowsAzure_Storage_Blob('blob.core.windows.net', 
                                                         'Your_Storage_Account_Name', 
                                                         'Your_Primary_Access_Key');

For the emulator, the storage account name is devstoreaccount1 对于仿真器,存储帐户名称为devstoreaccount1

and the key is Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw== 并且密钥是Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==

This is independent of language, SDK, etc. and the SDKs typically have shortcuts for dev storage (at least the .NET SDK does). 这与语言,SDK等无关,并且SDK通常具有开发人员存储的快捷方式(至少.NET SDK如此)。 For instance, with .NET and C#, you don't need to know the details of the emulator account: 例如,使用.NET和C#,您不需要知道模拟器帐户的详细信息:

var storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
var blobClient = storageAccount.CreateCloudBlobClient();

$storageClient = new Microsoft_WindowsAzure_Storage_Blob(); $ storageClient = new Microsoft_WindowsAzure_Storage_Blob();

from Windows Azure SDK for PHP http://phpazure.codeplex.com/wikipage?title=Blob%20storage&referringTitle=Documentation 从Windows Azure SDK for PHP http://phpazure.codeplex.com/wikipage?title=Blob%20storage&referringTitle=Documentation

Inspecting the .NET storage client library Microsoft.WindowsAzure.StorageClient.dll you can actually find the built in constants that make up this "well known" account name and key: 检查.NET存储客户端库Microsoft.WindowsAzure.StorageClient.dll,您实际上可以找到组成此“知名”帐户名和密钥的内置常量:

private const string DevstoreAccountName = "devstoreaccount1"; 私有常量字符串DevstoreAccountName =“ devstoreaccount1”; private const string DevstoreAccountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="; 私有const字符串DevstoreAccountKey =“ Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq / K1SZFPTOtr / KBHBeksoGMGw ==”;

"Way back when", before CloudStorageAccount.DevelopmentStorageAccount, we used to enter this data our selves when connecting to development storage. 在CloudStorageAccount.DevelopmentStorageAccount之前,“何时返回”在连接到开发存储时,我们自己输入这些数据。 Now Microsoft, for our convenience, have hidden that connection string also as a constant inside of the .dll. 现在,为方便起见,Microsoft将连接字符串也隐藏为.dll中的常量。

private const string DevstoreCredentialInString = "AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="; 私有const字符串DevstoreCredentialInString =“ AccountName = devstoreaccount1; AccountKey = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq / K1SZFPTOtr / KBHBeksoGMGw ==”;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试在 Laravel 中使用 Azure 存储模拟器 - Trying to use Azure Storage Emulator in Laravel 如何使用带有 Azure 存储帐户的 Azure 文件中的 PHP 显示文本内容本身? - How can display text content itself using PHP from Azure File with Azure storage account? 使用Azure存储模拟器返回404 - Working with Azure Storage Emulator returns 404 Azure 存储帐户位置变量/常量在哪里 - Where is the Azure Storage Account Location Variable/Constant 使用Rest API和PHP在同一存储帐户中将Azure复制Blob从一个容器复制到另一个容器 - Azure Copy blobs from one container to another in same storage account using rest api and php 使用Rest API将Azure复制Blob从一个存储帐户复制到同一预订中的另一个存储帐户 - Azure copy blobs from one storage account to another in the same subscription using rest API 当键名有特殊字符时无法访问数组键 - Unable to access array key when key name have special character 什么是使用php上传蔚蓝文件存储(NO BLOB STORAGE)的正确方法 - what is the correct way of uploading in azure file storage (NOT BLOB STORAGE) using php Azure Stack API Rest 在 PHP 中使用 CURL 创建存储帐户 - Azure Stack API Rest create storage account with CURL in PHP 在php中的Azure存储中获取Blob目录名称 - Get Blob directory name in azure storage in php
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM