azurenamespacesazure-aksazure-resource-graph

Listing all namespaces belonging to specific AKS clusters using Azure Resource Graph


I have 3 AKS Clusters in my Azure, and I need to list all namespaces belonging to each specific AKS cluster using a resource graph query. Is it possible? If so, could you please support me to write this query since I couldn't find a way on the web to be able to retrieve this output using resource graph.

Any feedback, help is greatly appreciated.

Have a nice day.


Solution

  • Listing all namespaces belonging to specific AKS clusters using Log Analytics workspace.

    To list all namespaces belonging to each specific AKS cluster using the Log Analytics workspace, follow the steps below.

    1. Create a Log Analytics workspace

    enter image description here

    1. Link your AKS clusters to the Log Analytics workspace by following the steps below.

    Go to AKS Cluster > Diagnostic settings > Add diagnostic setting > Save

    enter image description here

    1. Go to the Log Analytics workspace, select logs, and then run the below KQL query

    enter image description here