GetAnalyticsWorkspace

Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.OperationalInsights.GetAnalyticsWorkspace.InvokeAsync(new Azure.OperationalInsights.GetAnalyticsWorkspaceArgs
        {
            Name = "acctest-01",
            ResourceGroupName = "acctest",
        }));
        this.LogAnalyticsWorkspaceId = example.Apply(example => example.WorkspaceId);
    }

    [Output("logAnalyticsWorkspaceId")]
    public Output<string> LogAnalyticsWorkspaceId { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/operationalinsights"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        example, err := operationalinsights.LookupAnalyticsWorkspace(ctx, &operationalinsights.LookupAnalyticsWorkspaceArgs{
            Name:              "acctest-01",
            ResourceGroupName: "acctest",
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("logAnalyticsWorkspaceId", example.WorkspaceId)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example = azure.operationalinsights.get_analytics_workspace(name="acctest-01",
    resource_group_name="acctest")
pulumi.export("logAnalyticsWorkspaceId", example.workspace_id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.operationalinsights.getAnalyticsWorkspace({
    name: "acctest-01",
    resourceGroupName: "acctest",
});
export const logAnalyticsWorkspaceId = example.then(example => example.workspaceId);

Using GetAnalyticsWorkspace

function getAnalyticsWorkspace(args: GetAnalyticsWorkspaceArgs, opts?: InvokeOptions): Promise<GetAnalyticsWorkspaceResult>
function  get_analytics_workspace(name=None, resource_group_name=None, opts=None)
func LookupAnalyticsWorkspace(ctx *Context, args *LookupAnalyticsWorkspaceArgs, opts ...InvokeOption) (*LookupAnalyticsWorkspaceResult, error)

Note: This function is named LookupAnalyticsWorkspace in the Go SDK.

public static class GetAnalyticsWorkspace {
    public static Task<GetAnalyticsWorkspaceResult> InvokeAsync(GetAnalyticsWorkspaceArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

Specifies the name of the Log Analytics Workspace.

ResourceGroupName string

The name of the resource group in which the Log Analytics workspace is located in.

Name string

Specifies the name of the Log Analytics Workspace.

ResourceGroupName string

The name of the resource group in which the Log Analytics workspace is located in.

name string

Specifies the name of the Log Analytics Workspace.

resourceGroupName string

The name of the resource group in which the Log Analytics workspace is located in.

name str

Specifies the name of the Log Analytics Workspace.

resource_group_name str

The name of the resource group in which the Log Analytics workspace is located in.

GetAnalyticsWorkspace Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Location string
Name string
PortalUrl string

The Portal URL for the Log Analytics Workspace.

PrimarySharedKey string

The Primary shared key for the Log Analytics Workspace.

ResourceGroupName string
RetentionInDays int

The workspace data retention in days.

SecondarySharedKey string

The Secondary shared key for the Log Analytics Workspace.

Sku string

The Sku of the Log Analytics Workspace.

Tags Dictionary<string, string>

A mapping of tags assigned to the resource.

WorkspaceId string

The Workspace (or Customer) ID for the Log Analytics Workspace.

Id string

The provider-assigned unique ID for this managed resource.

Location string
Name string
PortalUrl string

The Portal URL for the Log Analytics Workspace.

PrimarySharedKey string

The Primary shared key for the Log Analytics Workspace.

ResourceGroupName string
RetentionInDays int

The workspace data retention in days.

SecondarySharedKey string

The Secondary shared key for the Log Analytics Workspace.

Sku string

The Sku of the Log Analytics Workspace.

Tags map[string]string

A mapping of tags assigned to the resource.

WorkspaceId string

The Workspace (or Customer) ID for the Log Analytics Workspace.

id string

The provider-assigned unique ID for this managed resource.

location string
name string
portalUrl string

The Portal URL for the Log Analytics Workspace.

primarySharedKey string

The Primary shared key for the Log Analytics Workspace.

resourceGroupName string
retentionInDays number

The workspace data retention in days.

secondarySharedKey string

The Secondary shared key for the Log Analytics Workspace.

sku string

The Sku of the Log Analytics Workspace.

tags {[key: string]: string}

A mapping of tags assigned to the resource.

workspaceId string

The Workspace (or Customer) ID for the Log Analytics Workspace.

id str

The provider-assigned unique ID for this managed resource.

location str
name str
portal_url str

The Portal URL for the Log Analytics Workspace.

primary_shared_key str

The Primary shared key for the Log Analytics Workspace.

resource_group_name str
retention_in_days float

The workspace data retention in days.

secondary_shared_key str

The Secondary shared key for the Log Analytics Workspace.

sku str

The Sku of the Log Analytics Workspace.

tags Dict[str, str]

A mapping of tags assigned to the resource.

workspace_id str

The Workspace (or Customer) ID for the Log Analytics Workspace.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.