I actually had to contact support and they also had some trouble figuring it out, the workspace-resource-id parameter for enabling the monitor addon needs to be in the format: The resourceid should be like this :
/subscriptions/[your sub]/resourcegroups/[your oms rg]/providers/Microsoft.OperationalInsights/workspaces/[your oms workspace name]
and not just the actual id, as the parameter name implies
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
How is that not the actual ID?
I think the confusion stems from the fact that inside the Azure Portal, the "Workspace Id" is given as a simple GUID. However, the az cli needs the "workspace-resource-id" which is more of a URL (like the one provided by mrdfuse).
I do not know if you can actually get it from the portal, I personally found it using the azure cli:
az resource list
Indeed, both me and Azure support thought we had to pass the GUID, as with many other commands in Azure CLI.
@mrdfuse @jemag thanks for the clarification.
@mboersma we've added some guidance for parameters that end with -id recently. https://github.com/Azure/azure-cli/blob/dev/doc/command_guidelines.md#argument-naming-conventions
Based on that, -id would imply a GUID is acceptable. When something is an ARM resource ID, we omit the -id in the name and call out in the help text. The main reason is that something which accepts an ARM resource ID should typically be following the "name or ID" convention in the CLI.
https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters
In this case, my recommendation would be to expose --workspace (name or ARM ID) and deprecate --workspace-resource-id.
Agreed. Please clarify this. I was also just confused by this.
I was unable to get the syntax right after struggling a while too. I'd found it documented two ways and neither worked for me. But I finally figured it out by manually enabling it in the Azure Portal and then noticed the "Workspace resource id" appears in the Properties tab of the ASK Cluster resource. It now works in my cluster creation script script.
@zqingqing1 @GaneshaThirumurthi @samkreter could someone on the AKS team please take a look?
This is a bit tricky
Workspace name is a field, but won't work here
Workspace ID (GUID) is a field but won't work here
The only thing that works here is workspace resource ID (which was taken from the API I believe)
Having this in mind, I think only workspace or workspace-resource might still be confusing.
Proposals:
1) Improve help text from
_The resource ID of an existing Log Analytics Workspace to use for storing monitoring data._
to
_The ARM resource ID (url) of an existing Log Analytics Workspace to use for storing monitoring data._
2) Rename to workspace-resource-url (and still change the help text)
I prefer 1) as resource-url is not really a term that is familar to Azure I think.
Yup, had trouble with this today. Found the solution not in the documentation, but here, as a documentation bug.
Most helpful comment
Agreed. Please clarify this. I was also just confused by this.