title: Error connecting to Azure Blob Storage Service with Java (Status code 405, UnsupportedHttpVerb)
body: <p>I'm trying to connect to Azure Blob Storage Service from an Azure Function but everything that it returns is a <code>BlobStorageException</code></p>
  <p>I used this example: <a href="https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/storage/azure-storage-blob#create-a-blobserviceclient" rel="nofollow noreferrer">Azure Storage Blob client library for Java (Create a BlobServiceClient)</a></p>
  <p>Here is my code:</p>
  <pre class="lang-java prettyprint-override"><code>String MY_BLOB_ENDPOINT = &quot;https://mystorageaccount.z13.web.core.windows.net/&quot;
  
  String MY_BLOB_SAS_TOKEN = &quot;?sv=2017-07-29&amp;ss=b&amp;srt=s&amp;sp=rwdc&amp;se=2022-06-10T00:00:00Z&amp;st=2021-06-10T00:00:00Z&amp;spr=https&amp;sig=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;
  
  String MY_DEFAULT_CONTAINER_NAME = &quot;test&quot;
  
  BlobServiceClient serviceClient = new BlobServiceClientBuilder()
      .endpoint(MY_BLOB_ENDPOINT)
      .sasToken(MY_BLOB_SAS_TOKEN)
      .buildClient();
  
  this.containerClient = serviceClient.
      getBlobContainerClient(MY_DEFAULT_CONTAINER_NAME);
  
  if (!this.containerClient.exists()) {
      this.containerClient.create();
  }
  </code></pre>
  <p>Here are the logs:</p>
  <pre><code>... (omitted logs)
  [2021-06-26T03:36:28.671Z] Executed 'Functions.upload' (Failed, Id=ffdff367-242e-494a-8303-e9ceeee6a2d7, Duration=5919ms)
  [2021-06-26T03:36:28.671Z] System.Private.CoreLib: Exception while executing function: Functions.upload. System.Private.CoreLib: Result: Failure
  [2021-06-26T03:36:28.671Z] Exception: BlobStorageException: Status code 405,
                             &quot;&lt;!DOCTYPE html&gt;
                              &lt;html&gt;
                                &lt;head&gt;
                                  &lt;title&gt;UnsupportedHttpVerb&lt;/title&gt;
                                &lt;/head&gt;
                                &lt;body&gt;
                                  &lt;h1&gt;The resource doesn't support specified Http Verb.&lt;/h1&gt;
                                  &lt;p&gt;
                                    &lt;ul&gt;
                                      &lt;li&gt;HttpStatusCode: 405&lt;/li&gt;
                                      &lt;li&gt;ErrorCode: UnsupportedHttpVerb&lt;/li&gt;
                                      &lt;li&gt;RequestId : 05ac7acf-701e-0026-213c-6adf7e000000&lt;/li&gt;&lt;li&gt;TimeStamp : 2021-06-26T03:36:28.4852611Z&lt;/li&gt;
                                    &lt;/ul&gt;
                                  &lt;/p&gt;
                                &lt;/body&gt;
                              &lt;/html&gt;&quot;
  [2021-06-26T03:36:28.671Z] Stack: java.lang.IllegalStateException: Failed to initialize
  [2021-06-26T03:36:28.671Z]      at org.springframework.cloud.function.adapter.azure.FunctionInvoker.&lt;init&gt;(FunctionInvoker.java:90)
  [2021-06-26T03:36:28.671Z]      at org.springframework.cloud.function.adapter.azure.FunctionInvoker.&lt;init&gt;(FunctionInvoker.java:95)
  ... (omitted logs)
  </code></pre>
  <p>Blob Storage Dependency</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
      &lt;groupId&gt;com.azure&lt;/groupId&gt;
      &lt;artifactId&gt;azure-storage-blob&lt;/artifactId&gt;
      &lt;version&gt;12.11.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>I don't know why it is not working. Is there some additional settings that I need to configure?.</p>