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/v4/go/azure/operationalinsights"
	"github.com/pulumi/pulumi/sdk/v3/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>
def get_analytics_workspace(name: Optional[str] = None,
                            resource_group_name: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetAnalyticsWorkspaceResult
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:

DailyQuotaGb double
The workspace daily quota for ingestion in GB.
Id string
The provider-assigned unique ID for this managed resource.
Location string
Name string
PortalUrl string

Deprecated: this property has been removed from the API and will be removed in version 3.0 of the provider

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.
DailyQuotaGb float64
The workspace daily quota for ingestion in GB.
Id string
The provider-assigned unique ID for this managed resource.
Location string
Name string
PortalUrl string

Deprecated: this property has been removed from the API and will be removed in version 3.0 of the provider

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.
dailyQuotaGb number
The workspace daily quota for ingestion in GB.
id string
The provider-assigned unique ID for this managed resource.
location string
name string
portalUrl string

Deprecated: this property has been removed from the API and will be removed in version 3.0 of the provider

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.
daily_quota_gb float
The workspace daily quota for ingestion in GB.
id str
The provider-assigned unique ID for this managed resource.
location str
name str
portal_url str

Deprecated: this property has been removed from the API and will be removed in version 3.0 of the provider

primary_shared_key str
The Primary shared key for the Log Analytics Workspace.
resource_group_name str
retention_in_days int
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 Mapping[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.