get Workspace
Use this data source to access information about an existing Databricks workspace.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.databricks.getWorkspace({
name: "example-workspace",
resourceGroupName: "example-rg",
});
export const databricksWorkspaceId = example.then(example => example.workspaceId);
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.databricks.get_workspace(name="example-workspace",
resource_group_name="example-rg")
pulumi.export("databricksWorkspaceId", example.workspace_id)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.DataBricks.GetWorkspace.Invoke(new()
{
Name = "example-workspace",
ResourceGroupName = "example-rg",
});
return new Dictionary<string, object?>
{
["databricksWorkspaceId"] = example.Apply(getWorkspaceResult => getWorkspaceResult.WorkspaceId),
};
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/databricks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := databricks.LookupWorkspace(ctx, &databricks.LookupWorkspaceArgs{
Name: "example-workspace",
ResourceGroupName: "example-rg",
}, nil)
if err != nil {
return err
}
ctx.Export("databricksWorkspaceId", example.WorkspaceId)
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.databricks.DatabricksFunctions;
import com.pulumi.azure.databricks.inputs.GetWorkspaceArgs;
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 = DatabricksFunctions.getWorkspace(GetWorkspaceArgs.builder()
.name("example-workspace")
.resourceGroupName("example-rg")
.build());
ctx.export("databricksWorkspaceId", example.workspaceId());
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: azure:databricks:getWorkspace
arguments:
name: example-workspace
resourceGroupName: example-rg
outputs:
databricksWorkspaceId: ${example.workspaceId}
Content copied to clipboard
API Providers
This data source uses the following Azure API Providers:
Microsoft.Databricks
: 2024-05-01
Return
A collection of values returned by getWorkspace.
Parameters
argument
A collection of arguments for invoking getWorkspace.
suspend fun getWorkspace(name: String, resourceGroupName: String, tags: Map<String, String>? = null): GetWorkspaceResult
Return
A collection of values returned by getWorkspace.
Parameters
name
The name of the Databricks Workspace.
resource Group Name
The Name of the Resource Group where the Databricks Workspace exists.
tags
A mapping of tags to assign to the Databricks Workspace.
See also
suspend fun getWorkspace(argument: suspend GetWorkspacePlainArgsBuilder.() -> Unit): GetWorkspaceResult
Return
A collection of values returned by getWorkspace.
Parameters
argument
Builder for com.pulumi.azure.databricks.kotlin.inputs.GetWorkspacePlainArgs.