在Azure SDK for PHP中,有没有办法检查帐户中是否已存在容器?是否存在任何可能让我知道容器存在的函数或调用?
答案 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();
}