title: How to select a log analytics workspace in azure monitor notebook using a parameter?
body: <p>I would like to have the user select the log analytics workspace as a parameter in an Azure Monitor notebook to perform a query, similar to what is explained in the <a href="https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Documentation/Parameters/Resources.md" rel="nofollow noreferrer">parameter documentation</a>. However, I can't resolve the log analytics workspace using a variable.</p>
  <p>What I would like to do is something like:</p>
  <pre><code>let event_table = workspace({parameter}).Event;
  event_table
  | take 5
  </code></pre>
  <p>The following query using a string literal is successful in both an azure monitor notebook and in a log query:</p>
  <pre><code>let event_table = workspace(&quot;name_of_work_space&quot;).Event;
  event_table
  | take 5
  </code></pre>
  <p>The following fails with the error <code>&quot;Unknown function 'workspace'.</code> in both an azure monitor notebook and a log query:</p>
  <pre><code>let logAnalyticsWorkspaceName = &quot;name_of_work_space&quot;;
  let event_table = workspace(logAnalyticsWorkspaceName).Event;
  event_table
  | take 5
  </code></pre>
  <p>It seems that only string literals are allowed as arguments to the <code>workspace()</code> function.</p>
  <p>Additionally, <code>iff()</code> and <code>case()</code> functions only return scalars so I cannot use <code>iff()</code> and <code>case()</code> to conditionally return a table or workspace based on a Azure Notebook parameter.</p>
  <p>How do I supply a parameter to an Azure Monitor Notebook to query against a particular log analytics workspace?</p>