title: Blob Storage - connection string not working php
body: <p>I wrote this:</p>
  
  <p><a href="https://stackoverflow.com/questions/15282789/creating-a-container-in-blob-storage-azure-php/15285803?noredirect=1#comment21569467_15285803">Creating a container in blob storage Azure - PHP</a></p>
  
  <p>The following is my connections sting format:</p>
  
  <p>It is complaining the container does not exist, my connection string is as follows: </p>
  
  <p><code>$connectionString = 'DefaultEndpointsProtocol=http;AccountName=&lt;name of container&gt;;AccountKey=&lt;primary access key&gt;'; –</code></p>
  
  <p>However when I connect like this, it keeps complaining that the container cannot be found, and pops a 404 error. When I stick the storage name in name of container and the primary key in key</p>
  
  <p>Any idea why?</p>
  
  <p>Thanks</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  
  
  require_once 'vendor\autoload.php';
  
  use WindowsAzure\Common\ServicesBuilder;
  use WindowsAzure\Common\ServiceException;
  
  $connectionString = 'DefaultEndpointsProtocol=http;AccountName=&lt;name of container&gt;;AccountKey=&lt;primary access key&gt;'; –`
  
  // Create blob REST proxy.
  $blobRestProxy = ServicesBuilder::getInstance()-&gt;createBlobService($connectionString);
  
  
  try {
      // List blobs.
      $blob_list = $blobRestProxy-&gt;listBlobs(&lt;container&gt;);
      $blobs = $blob_list-&gt;getBlobs();
  
      foreach($blobs as $blob)
      {
          echo $blob-&gt;getName().": ".$blob-&gt;getUrl()."&lt;br /&gt;";
      }
  }
  catch(ServiceException $e){
      // Handle exception based on error codes and messages.
      // Error codes and messages are here: 
      // http://msdn.microsoft.com/en-us/library/windowsazure/dd179439.aspx
      $code = $e-&gt;getCode();
      $error_message = $e-&gt;getMessage();
      echo $code.": ".$error_message."&lt;br /&gt;";
  }
  
  ?&gt;
  </code></pre>
  
  <p>error:</p>
  
  <p>404: Fail: Code: 404 Value: The specified container does not exist. details (if any): ï»¿ContainerNotFoundThe specified container does not exist. RequestId:44efdbaf-0a20-4b35-96bf-9dcc486ab9a1 Time:2013-03-08T15:00:36.7615754Z.</p>