We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.aadb2c.getDirectory
Start a Neo task
Explain and create an azure.aadb2c.getDirectory resource
Use this data source to access information about an existing AAD B2C Directory.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.aadb2c.getDirectory({
resourceGroupName: "example-rg",
domainName: "exampleb2ctenant.onmicrosoft.com",
});
export const tenantId = example.then(example => example.tenantId);
import pulumi
import pulumi_azure as azure
example = azure.aadb2c.get_directory(resource_group_name="example-rg",
domain_name="exampleb2ctenant.onmicrosoft.com")
pulumi.export("tenantId", example.tenant_id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/aadb2c"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := aadb2c.LookupDirectory(ctx, &aadb2c.LookupDirectoryArgs{
ResourceGroupName: "example-rg",
DomainName: "exampleb2ctenant.onmicrosoft.com",
}, nil)
if err != nil {
return err
}
ctx.Export("tenantId", example.TenantId)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.AadB2C.GetDirectory.Invoke(new()
{
ResourceGroupName = "example-rg",
DomainName = "exampleb2ctenant.onmicrosoft.com",
});
return new Dictionary<string, object?>
{
["tenantId"] = example.Apply(getDirectoryResult => getDirectoryResult.TenantId),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.aadb2c.Aadb2cFunctions;
import com.pulumi.azure.aadb2c.inputs.GetDirectoryArgs;
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 = Aadb2cFunctions.getDirectory(GetDirectoryArgs.builder()
.resourceGroupName("example-rg")
.domainName("exampleb2ctenant.onmicrosoft.com")
.build());
ctx.export("tenantId", example.tenantId());
}
}
variables:
example:
fn::invoke:
function: azure:aadb2c:getDirectory
arguments:
resourceGroupName: example-rg
domainName: exampleb2ctenant.onmicrosoft.com
outputs:
tenantId: ${example.tenantId}
API Providers
This data source uses the following Azure API Providers:
Microsoft.AzureActiveDirectory- 2021-04-01-preview
Using getDirectory
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 getDirectory(args: GetDirectoryArgs, opts?: InvokeOptions): Promise<GetDirectoryResult>
function getDirectoryOutput(args: GetDirectoryOutputArgs, opts?: InvokeOptions): Output<GetDirectoryResult>def get_directory(domain_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDirectoryResult
def get_directory_output(domain_name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDirectoryResult]func LookupDirectory(ctx *Context, args *LookupDirectoryArgs, opts ...InvokeOption) (*LookupDirectoryResult, error)
func LookupDirectoryOutput(ctx *Context, args *LookupDirectoryOutputArgs, opts ...InvokeOption) LookupDirectoryResultOutput> Note: This function is named LookupDirectory in the Go SDK.
public static class GetDirectory
{
public static Task<GetDirectoryResult> InvokeAsync(GetDirectoryArgs args, InvokeOptions? opts = null)
public static Output<GetDirectoryResult> Invoke(GetDirectoryInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDirectoryResult> getDirectory(GetDirectoryArgs args, InvokeOptions options)
public static Output<GetDirectoryResult> getDirectory(GetDirectoryArgs args, InvokeOptions options)
fn::invoke:
function: azure:aadb2c/getDirectory:getDirectory
arguments:
# arguments dictionaryThe following arguments are supported:
- Domain
Name string - Domain name of the B2C tenant, including the
.onmicrosoft.comsuffix. - Resource
Group stringName - The name of the Resource Group where the AAD B2C Directory exists.
- Domain
Name string - Domain name of the B2C tenant, including the
.onmicrosoft.comsuffix. - Resource
Group stringName - The name of the Resource Group where the AAD B2C Directory exists.
- domain
Name String - Domain name of the B2C tenant, including the
.onmicrosoft.comsuffix. - resource
Group StringName - The name of the Resource Group where the AAD B2C Directory exists.
- domain
Name string - Domain name of the B2C tenant, including the
.onmicrosoft.comsuffix. - resource
Group stringName - The name of the Resource Group where the AAD B2C Directory exists.
- domain_
name str - Domain name of the B2C tenant, including the
.onmicrosoft.comsuffix. - resource_
group_ strname - The name of the Resource Group where the AAD B2C Directory exists.
- domain
Name String - Domain name of the B2C tenant, including the
.onmicrosoft.comsuffix. - resource
Group StringName - The name of the Resource Group where the AAD B2C Directory exists.
getDirectory Result
The following output properties are available:
- Billing
Type string - The type of billing for the AAD B2C tenant. Possible values include:
MAUorAuths. - Data
Residency stringLocation - Location in which the B2C tenant is hosted and data resides. See official docs for more information.
- Domain
Name string - Effective
Start stringDate - The date from which the billing type took effect. May not be populated until after the first billing cycle.
- Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Group stringName - Sku
Name string - Billing SKU for the B2C tenant. See official docs for more information.
- Dictionary<string, string>
- A mapping of tags assigned to the AAD B2C Directory.
- Tenant
Id string - The Tenant ID for the AAD B2C tenant.
- Billing
Type string - The type of billing for the AAD B2C tenant. Possible values include:
MAUorAuths. - Data
Residency stringLocation - Location in which the B2C tenant is hosted and data resides. See official docs for more information.
- Domain
Name string - Effective
Start stringDate - The date from which the billing type took effect. May not be populated until after the first billing cycle.
- Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Group stringName - Sku
Name string - Billing SKU for the B2C tenant. See official docs for more information.
- map[string]string
- A mapping of tags assigned to the AAD B2C Directory.
- Tenant
Id string - The Tenant ID for the AAD B2C tenant.
- billing
Type String - The type of billing for the AAD B2C tenant. Possible values include:
MAUorAuths. - data
Residency StringLocation - Location in which the B2C tenant is hosted and data resides. See official docs for more information.
- domain
Name String - effective
Start StringDate - The date from which the billing type took effect. May not be populated until after the first billing cycle.
- id String
- The provider-assigned unique ID for this managed resource.
- resource
Group StringName - sku
Name String - Billing SKU for the B2C tenant. See official docs for more information.
- Map<String,String>
- A mapping of tags assigned to the AAD B2C Directory.
- tenant
Id String - The Tenant ID for the AAD B2C tenant.
- billing
Type string - The type of billing for the AAD B2C tenant. Possible values include:
MAUorAuths. - data
Residency stringLocation - Location in which the B2C tenant is hosted and data resides. See official docs for more information.
- domain
Name string - effective
Start stringDate - The date from which the billing type took effect. May not be populated until after the first billing cycle.
- id string
- The provider-assigned unique ID for this managed resource.
- resource
Group stringName - sku
Name string - Billing SKU for the B2C tenant. See official docs for more information.
- {[key: string]: string}
- A mapping of tags assigned to the AAD B2C Directory.
- tenant
Id string - The Tenant ID for the AAD B2C tenant.
- billing_
type str - The type of billing for the AAD B2C tenant. Possible values include:
MAUorAuths. - data_
residency_ strlocation - Location in which the B2C tenant is hosted and data resides. See official docs for more information.
- domain_
name str - effective_
start_ strdate - The date from which the billing type took effect. May not be populated until after the first billing cycle.
- id str
- The provider-assigned unique ID for this managed resource.
- resource_
group_ strname - sku_
name str - Billing SKU for the B2C tenant. See official docs for more information.
- Mapping[str, str]
- A mapping of tags assigned to the AAD B2C Directory.
- tenant_
id str - The Tenant ID for the AAD B2C tenant.
- billing
Type String - The type of billing for the AAD B2C tenant. Possible values include:
MAUorAuths. - data
Residency StringLocation - Location in which the B2C tenant is hosted and data resides. See official docs for more information.
- domain
Name String - effective
Start StringDate - The date from which the billing type took effect. May not be populated until after the first billing cycle.
- id String
- The provider-assigned unique ID for this managed resource.
- resource
Group StringName - sku
Name String - Billing SKU for the B2C tenant. See official docs for more information.
- Map<String>
- A mapping of tags assigned to the AAD B2C Directory.
- tenant
Id String - The Tenant ID for the AAD B2C tenant.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
