Esempio n. 1
0
 /**
  * Configure Client connection and anything else tha needs to be setup
  */
 protected function setUp()
 {
     $this->client = ServicesBuilder::getInstance()->createBlobService($this->getConfigs('access'));
 }
            }
            a{
                color:white;
                text-decoration: underline;
            }
        </style>
    </head>
    
 <?php 
require_once 'vendor\\autoload.php';
use WindowsAzure\Common\ServiceBuilder;
use WindowsAzure\Blob\Models\CreateContainerOptions;
use WindowsAzure\Blob\Models\PublicAccessType;
use WindowsAzure\Common\ServiceException;
$connectionString = "DefaultEndpointsProtocol=https;AccountName=smalltalkelc;AccountKey=9Dp8HQ0qsk3ZWW1fADulCa7KEMO3Py5gOeTadrcbSwPYl+O4se+b4hfCUhDbe7KoPz+4ioJj5YSyomNcIPnyUw==";
$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);
$createContainerOptions = new CreateContainerOptions();
$createContainerOptions->addMetaData("key1", "value1");
$createContainerOptions->addMetaDasta("key2", "value2");
echo $connectionString;
try {
    // Create Container.
    $blobRestProxy->createContainer("mycontainer", $createContainerOptions);
} catch (ServiceException $e) {
    //Handl exception based on error codes and messages.
    //Error codes and messages are here:
    // http://msdn.microsoft.com/library/azure/dd179437.aspx
    $code = $e->getCode();
    $error_message = $e->getMessage();
    echo $code . ": " . $error_message . "<br />";
}