title: Azure Function v3 unable to bind blob to CloudBlockBlob
body: <p>Azure function v3 runtime on VS19 (.Net SDK) with azure-functions-core-tools@3 6.14.4.</p>
  
  <p>I'm using a <strong>Time trigger</strong> and executing <strong>read/write on a blob</strong>.
  But the binding is failing.
  I've followed all instructions on the docs and tried other solutions from StackOverflow for Azure functions v2 but I'm unable to fix the binding.
  I've even created the bindings through the portal's integration feature and then used that function.json but the same error is popping up.</p>
  
  <p>I need to solve 2 problems:</p>
  
  <ol>
  <li><p><strong>Fixing the binding error as mentioned below.</strong></p></li>
  <li><p>[From a different azure function] After publishing of application to Azure, function.json is being overwritten by the server resulting in loss of bindings so retention of bindings in function.json is also required (though it is claimed in the docs that it is managed by serve and editing is not recommended).</p></li>
  </ol>
  
  <p><strong>Info from the 1st problem:</strong></p>
  
  <p>Here's what the run function looks like:</p>
  
  <pre><code>public static async Task Run([TimerTrigger("0 */10 * * * *")]TimerInfo myTimer, ILogger log, 
  [Blob("container/blob.json", FileAccess.ReadWrite, Connection = "AzureWebJobsStorage")] CloudBlockBlob stateStore)
  </code></pre>
  
  <p>Function.json :</p>
  
  <pre><code>{
    "bindings": [
      {
        "name": "myTimer",
        "direction": "in",
        "type": "timerTrigger",
        "schedule": "0 */10 * * * *"
      },
      {
        "name": "stateStore",
        "direction": "inout",
        "type": "blob",
        "path": "container/blob.json",
        "connection": "AzureWebJobsStorage"
      }
    ]
  }
  </code></pre>
  
  <p>host.json</p>
  
  <pre><code>{
    "version": "2.0",
    "extensionBundle": {
      "id": "Microsoft.Azure.Functions.ExtensionBundle",
      "version": "[1.*, 2.0.0)"
    },
    "logging": {
      "applicationInsights": {
        "samplingExcludedTypes": "Request",
        "samplingSettings": {
          "isEnabled": true
        }
      }
    }
  }
  </code></pre>
  
  <p>Csproj:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk"&gt;
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
      &lt;AzureFunctionsVersion&gt;v3&lt;/AzureFunctionsVersion&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="Azure.Storage.Blobs" Version="12.4.2" /&gt;
      &lt;PackageReference Include="Azure.Storage.Files.Shares" Version="12.2.1" /&gt;
      &lt;PackageReference Include="Azure.Storage.Queues" Version="12.3.0" /&gt;
      &lt;PackageReference Include="Microsoft.ApplicationInsights" Version="2.14.0" /&gt;
      &lt;PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" /&gt;
      &lt;PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" /&gt;
      &lt;PackageReference Include="Microsoft.Azure.Services.AppAuthentication" Version="1.4.0" /&gt;
      &lt;PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.1.1" /&gt;
      &lt;PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.11" /&gt;
      &lt;PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.1.8" /&gt;
      &lt;PackageReference Include="Microsoft.Extensions.Azure" Version="1.0.0" /&gt;
      &lt;PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.1.4" /&gt;
      &lt;PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.7" /&gt;
      &lt;PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.153.0" /&gt;
      &lt;PackageReference Include="WindowsAzure.Storage" Version="9.3.3" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;None Update="host.json"&gt;
        &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;/None&gt;
      &lt;None Update="local.settings.json"&gt;
        &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
        &lt;CopyToPublishDirectory&gt;Never&lt;/CopyToPublishDirectory&gt;
      &lt;/None&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;WCFMetadata Include="Connected Services" /&gt;
    &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>Error on executing:</p>
  
  <pre><code> 1 functions loaded
  [14-05-2020 10:17:11] Generating 1 job function(s)
  [14-05-2020 10:17:11] Microsoft.Azure.WebJobs.Host: Error indexing method 'FunctionAppName'. 
  Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'stateStore' to type CloudBlockBlob. 
  Make sure the parameter Type is supported by the binding. 
  If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) 
  make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
  </code></pre>