title: How to make a route parameter optional in Azure Function
body: <p>How to make a route parameter optional in Azure Function </p>
  
  <pre><code>public static async Task&lt;HttpResponseMessage&gt; Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = "ResolveKey/{key}/{resolver}")]HttpRequestMessage req, TraceWriter log, string key,string resolver= "default")
  </code></pre>
  
  <p>In the above code I tried to make resolver parameter optional by setting a default value  <code>string resolver= "default"</code> . The code compiles and runs fine, but the URL always wants resolver parameter to be present, otherwise I get 404.</p>
  
  <p>I want to make the resolver parameter optional in the above code. Is there any way?</p>