title: How to get workspace ID of Azure Log Analytics using az CLI?
body: <p>How to get workspace ID of Azure Log Analytics using <code>az</code> CLI ?</p>
  <p>I want to use this ID in a script when creating AKS</p>
  <pre class="lang-sh prettyprint-override"><code>az aks create --name myk8s --resource-group rg-myk8s \
    --workspace-resource-id XXX
  </code></pre>
  <p><a href="https://i.stack.imgur.com/WxWnv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WxWnv.png" alt="enter image description here" /></a></p>