1. Packages
  2. Azure Classic
  3. API Docs
  4. monitoring
  5. getDiagnosticCategories

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.monitoring.getDiagnosticCategories

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.keyvault.getKeyVault({
    name: exampleAzurermKeyVault.name,
    resourceGroupName: exampleAzurermKeyVault.resourceGroupName,
});
const exampleGetDiagnosticCategories = example.then(example => azure.monitoring.getDiagnosticCategories({
    resourceId: example.id,
}));
Copy
import pulumi
import pulumi_azure as azure

example = azure.keyvault.get_key_vault(name=example_azurerm_key_vault["name"],
    resource_group_name=example_azurerm_key_vault["resourceGroupName"])
example_get_diagnostic_categories = azure.monitoring.get_diagnostic_categories(resource_id=example.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/keyvault"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/monitoring"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{
			Name:              exampleAzurermKeyVault.Name,
			ResourceGroupName: exampleAzurermKeyVault.ResourceGroupName,
		}, nil)
		if err != nil {
			return err
		}
		_, err = monitoring.GetDiagnosticCategories(ctx, &monitoring.GetDiagnosticCategoriesArgs{
			ResourceId: example.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.KeyVault.GetKeyVault.Invoke(new()
    {
        Name = exampleAzurermKeyVault.Name,
        ResourceGroupName = exampleAzurermKeyVault.ResourceGroupName,
    });

    var exampleGetDiagnosticCategories = Azure.Monitoring.GetDiagnosticCategories.Invoke(new()
    {
        ResourceId = example.Apply(getKeyVaultResult => getKeyVaultResult.Id),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.keyvault.KeyvaultFunctions;
import com.pulumi.azure.keyvault.inputs.GetKeyVaultArgs;
import com.pulumi.azure.monitoring.MonitoringFunctions;
import com.pulumi.azure.monitoring.inputs.GetDiagnosticCategoriesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = KeyvaultFunctions.getKeyVault(GetKeyVaultArgs.builder()
            .name(exampleAzurermKeyVault.name())
            .resourceGroupName(exampleAzurermKeyVault.resourceGroupName())
            .build());

        final var exampleGetDiagnosticCategories = MonitoringFunctions.getDiagnosticCategories(GetDiagnosticCategoriesArgs.builder()
            .resourceId(example.applyValue(getKeyVaultResult -> getKeyVaultResult.id()))
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:keyvault:getKeyVault
      arguments:
        name: ${exampleAzurermKeyVault.name}
        resourceGroupName: ${exampleAzurermKeyVault.resourceGroupName}
  exampleGetDiagnosticCategories:
    fn::invoke:
      function: azure:monitoring:getDiagnosticCategories
      arguments:
        resourceId: ${example.id}
Copy

Using getDiagnosticCategories

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getDiagnosticCategories(args: GetDiagnosticCategoriesArgs, opts?: InvokeOptions): Promise<GetDiagnosticCategoriesResult>
function getDiagnosticCategoriesOutput(args: GetDiagnosticCategoriesOutputArgs, opts?: InvokeOptions): Output<GetDiagnosticCategoriesResult>
Copy
def get_diagnostic_categories(resource_id: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetDiagnosticCategoriesResult
def get_diagnostic_categories_output(resource_id: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetDiagnosticCategoriesResult]
Copy
func GetDiagnosticCategories(ctx *Context, args *GetDiagnosticCategoriesArgs, opts ...InvokeOption) (*GetDiagnosticCategoriesResult, error)
func GetDiagnosticCategoriesOutput(ctx *Context, args *GetDiagnosticCategoriesOutputArgs, opts ...InvokeOption) GetDiagnosticCategoriesResultOutput
Copy

> Note: This function is named GetDiagnosticCategories in the Go SDK.

public static class GetDiagnosticCategories 
{
    public static Task<GetDiagnosticCategoriesResult> InvokeAsync(GetDiagnosticCategoriesArgs args, InvokeOptions? opts = null)
    public static Output<GetDiagnosticCategoriesResult> Invoke(GetDiagnosticCategoriesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDiagnosticCategoriesResult> getDiagnosticCategories(GetDiagnosticCategoriesArgs args, InvokeOptions options)
public static Output<GetDiagnosticCategoriesResult> getDiagnosticCategories(GetDiagnosticCategoriesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:monitoring/getDiagnosticCategories:getDiagnosticCategories
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ResourceId This property is required. string
The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
ResourceId This property is required. string
The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
resourceId This property is required. String
The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
resourceId This property is required. string
The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
resource_id This property is required. str
The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
resourceId This property is required. String
The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.

getDiagnosticCategories Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
LogCategoryGroups List<string>
A list of the supported log category groups of this resource to send to the destination.
LogCategoryTypes List<string>
A list of the supported log category types of this resource to send to the destination.
Metrics List<string>
A list of the Metric Categories supported for this Resource.
ResourceId string
Id string
The provider-assigned unique ID for this managed resource.
LogCategoryGroups []string
A list of the supported log category groups of this resource to send to the destination.
LogCategoryTypes []string
A list of the supported log category types of this resource to send to the destination.
Metrics []string
A list of the Metric Categories supported for this Resource.
ResourceId string
id String
The provider-assigned unique ID for this managed resource.
logCategoryGroups List<String>
A list of the supported log category groups of this resource to send to the destination.
logCategoryTypes List<String>
A list of the supported log category types of this resource to send to the destination.
metrics List<String>
A list of the Metric Categories supported for this Resource.
resourceId String
id string
The provider-assigned unique ID for this managed resource.
logCategoryGroups string[]
A list of the supported log category groups of this resource to send to the destination.
logCategoryTypes string[]
A list of the supported log category types of this resource to send to the destination.
metrics string[]
A list of the Metric Categories supported for this Resource.
resourceId string
id str
The provider-assigned unique ID for this managed resource.
log_category_groups Sequence[str]
A list of the supported log category groups of this resource to send to the destination.
log_category_types Sequence[str]
A list of the supported log category types of this resource to send to the destination.
metrics Sequence[str]
A list of the Metric Categories supported for this Resource.
resource_id str
id String
The provider-assigned unique ID for this managed resource.
logCategoryGroups List<String>
A list of the supported log category groups of this resource to send to the destination.
logCategoryTypes List<String>
A list of the supported log category types of this resource to send to the destination.
metrics List<String>
A list of the Metric Categories supported for this Resource.
resourceId String

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi