We recommend using Azure Native.
Azure v6.25.0 published on Wednesday, Aug 13, 2025 by Pulumi
azure.loganalytics.getWorkspaceTable
Explore with Pulumi AI
Use this data source to access information about an existing Log Analytics Workspace Table.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.loganalytics.getWorkspaceTable({
name: "InsightsMetrics",
workspaceId: exampleAzurermLogAnalyticsWorkspace.id,
});
export const retentionInDays = example.then(example => example.retentionInDays);
import pulumi
import pulumi_azure as azure
example = azure.loganalytics.get_workspace_table(name="InsightsMetrics",
workspace_id=example_azurerm_log_analytics_workspace["id"])
pulumi.export("retentionInDays", example.retention_in_days)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/loganalytics"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := loganalytics.LookupWorkspaceTable(ctx, &loganalytics.LookupWorkspaceTableArgs{
Name: "InsightsMetrics",
WorkspaceId: exampleAzurermLogAnalyticsWorkspace.Id,
}, nil)
if err != nil {
return err
}
ctx.Export("retentionInDays", example.RetentionInDays)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.LogAnalytics.GetWorkspaceTable.Invoke(new()
{
Name = "InsightsMetrics",
WorkspaceId = exampleAzurermLogAnalyticsWorkspace.Id,
});
return new Dictionary<string, object?>
{
["retentionInDays"] = example.Apply(getWorkspaceTableResult => getWorkspaceTableResult.RetentionInDays),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.loganalytics.LoganalyticsFunctions;
import com.pulumi.azure.loganalytics.inputs.GetWorkspaceTableArgs;
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 = LoganalyticsFunctions.getWorkspaceTable(GetWorkspaceTableArgs.builder()
.name("InsightsMetrics")
.workspaceId(exampleAzurermLogAnalyticsWorkspace.id())
.build());
ctx.export("retentionInDays", example.retentionInDays());
}
}
variables:
example:
fn::invoke:
function: azure:loganalytics:getWorkspaceTable
arguments:
name: InsightsMetrics
workspaceId: ${exampleAzurermLogAnalyticsWorkspace.id}
outputs:
retentionInDays: ${example.retentionInDays}
API Providers
This data source uses the following Azure API Providers:
Microsoft.OperationalInsights
- 2022-10-01
Using getWorkspaceTable
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 getWorkspaceTable(args: GetWorkspaceTableArgs, opts?: InvokeOptions): Promise<GetWorkspaceTableResult>
function getWorkspaceTableOutput(args: GetWorkspaceTableOutputArgs, opts?: InvokeOptions): Output<GetWorkspaceTableResult>
def get_workspace_table(name: Optional[str] = None,
workspace_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetWorkspaceTableResult
def get_workspace_table_output(name: Optional[pulumi.Input[str]] = None,
workspace_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetWorkspaceTableResult]
func LookupWorkspaceTable(ctx *Context, args *LookupWorkspaceTableArgs, opts ...InvokeOption) (*LookupWorkspaceTableResult, error)
func LookupWorkspaceTableOutput(ctx *Context, args *LookupWorkspaceTableOutputArgs, opts ...InvokeOption) LookupWorkspaceTableResultOutput
> Note: This function is named LookupWorkspaceTable
in the Go SDK.
public static class GetWorkspaceTable
{
public static Task<GetWorkspaceTableResult> InvokeAsync(GetWorkspaceTableArgs args, InvokeOptions? opts = null)
public static Output<GetWorkspaceTableResult> Invoke(GetWorkspaceTableInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetWorkspaceTableResult> getWorkspaceTable(GetWorkspaceTableArgs args, InvokeOptions options)
public static Output<GetWorkspaceTableResult> getWorkspaceTable(GetWorkspaceTableArgs args, InvokeOptions options)
fn::invoke:
function: azure:loganalytics/getWorkspaceTable:getWorkspaceTable
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- The name of this Log Analytics Workspace Table.
- Workspace
Id string - The ID of the Log Analytics Workspace the table belongs to.
- Name string
- The name of this Log Analytics Workspace Table.
- Workspace
Id string - The ID of the Log Analytics Workspace the table belongs to.
- name String
- The name of this Log Analytics Workspace Table.
- workspace
Id String - The ID of the Log Analytics Workspace the table belongs to.
- name string
- The name of this Log Analytics Workspace Table.
- workspace
Id string - The ID of the Log Analytics Workspace the table belongs to.
- name str
- The name of this Log Analytics Workspace Table.
- workspace_
id str - The ID of the Log Analytics Workspace the table belongs to.
- name String
- The name of this Log Analytics Workspace Table.
- workspace
Id String - The ID of the Log Analytics Workspace the table belongs to.
getWorkspaceTable Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Plan string
- The billing plan information for the Log Analytics Workspace Table.
- Retention
In intDays - The table's data retention in days.
- Total
Retention intIn Days - The table's total data retention in days.
- Workspace
Id string
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Plan string
- The billing plan information for the Log Analytics Workspace Table.
- Retention
In intDays - The table's data retention in days.
- Total
Retention intIn Days - The table's total data retention in days.
- Workspace
Id string
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- plan String
- The billing plan information for the Log Analytics Workspace Table.
- retention
In IntegerDays - The table's data retention in days.
- total
Retention IntegerIn Days - The table's total data retention in days.
- workspace
Id String
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- plan string
- The billing plan information for the Log Analytics Workspace Table.
- retention
In numberDays - The table's data retention in days.
- total
Retention numberIn Days - The table's total data retention in days.
- workspace
Id string
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- plan str
- The billing plan information for the Log Analytics Workspace Table.
- retention_
in_ intdays - The table's data retention in days.
- total_
retention_ intin_ days - The table's total data retention in days.
- workspace_
id str
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- plan String
- The billing plan information for the Log Analytics Workspace Table.
- retention
In NumberDays - The table's data retention in days.
- total
Retention NumberIn Days - The table's total data retention in days.
- workspace
Id String
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.