Azure容器已经存在?

时间:2012-11-30 04:23:16

标签: azure

在Azure SDK for PHP中,有没有办法检查帐户中是否已存在容器?是否存在任何可能让我知道容器存在的函数或调用?

1 个答案:

答案 0 :(得分:1)

您可以尝试这样的事情:

$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);

try {
    $blobRestProxy->getContainerProperties("mycontainer");
    // The container exists.
}
catch(ServiceException $e){
    // Code ContainerNotFound (404) means the container does not exist.
    $code = $e->getCode();
}