How to get workspace ID of Azure Log Analytics using az CLI?

Viewed 2505

How to get workspace ID of Azure Log Analytics using az CLI ?

I want to use this ID in a script when creating AKS

az aks create --name myk8s --resource-group rg-myk8s \
  --workspace-resource-id XXX

enter image description here

1 Answers

You can run the following command to get the Workspace ID:

az monitor log-analytics workspace show --resource-group MyResourceGroup --workspace-name MyWorkspace --query customerId -o tsv

enter image description here

Related