在Blob存储Azure中创建一个容器 - PHP [英] Creating a container in blob storage Azure - PHP
问题描述
我下面这个教程中,有关处理斑点:
I am following this tutorial, about manipulating blobs:
HTTP://www.windowsazure .COM / EN-US /开发/ PHP /如何对导游/一滴服务/
目前尚不清楚对下面的事情:
It isn't clear on the following things:
1)如何建立连接,在示例中使用该行code的:
1) How to set up a connection, in the example it uses this line of code:
For accessing a live service:
require_once 'vendor\autoload.php';
use WindowsAzure\Common\ServicesBuilder; use WindowsAzure\Blob\Models\CreateContainerOptions; use WindowsAzure\Blob\Models\PublicAccessType; use WindowsAzure\Common\ServiceException;
// Create blob REST proxy. $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString)
我如何设置连接字符串? - 我需要什么凭证来访问Blob存储
How do I set up the connection string? - what credentials will I need to access blob storage.
由于我有我的Microsoft帐户的详细信息了。
Given that I have my Microsoft account details too.
2)你会如何创建一个新的存储帐户
2) How would you create a new storage account
当您登录到门户网站,一键/帐户设置了您。如何创建通过PHP一个新的
When you log into your portal, a key/account is set up for you. How do you create a new one via php
感谢
推荐答案
在你引用的教程,连接字符串格式如图靠近文章的顶部:
In that tutorial you referenced, the connection string format is shown near the top of the article:
<$c$c>DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]$c$c>
现在,您需要在门户网站中创建一个存储帐户。每个存储账户都有一个名字( yourAccount
)和键( yourKey
)。一旦你通过门户网站创建一个存储帐户,你会看到它上市。例如,我创建 dmakhome
这个例子:
Now you need to create a storage account within the portal. Each storage account has a name (yourAccount
) and a key (yourKey
). Once you create a storage account via the portal, you'll see it listed. for instance, I created dmakhome
for this example:
点击其名称,这将打开仪表板视图为存储账户:
Click on its name, which opens the Dashboard view for that storage account:
在屏幕的最底部,在黑色的底边框,你会看到一个图标,管理密钥。单击,然后你会看到一两个主要和辅助键(你可以抓住任何一个):
At the very bottom of the screen, in the black bottom border, you'll see an icon, Manage Keys. Click that, and you'll then see both a primary and a secondary key (you can grab either one):
键复制到剪贴板,并创建上述格式的$的connectionString,替换您的存储帐户名和新复制的关键。
Copy the key to the clipboard, and create a $connectionString of the format above, substituting your storage account name and newly-copied key.
这篇关于在Blob存储Azure中创建一个容器 - PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!