azuread.getDomains
Explore with Pulumi AI
Use this data source to access information about existing Domains within Azure Active Directory.
API Permissions
The following API permissions are required in order to use this data source.
When authenticated with a service principal, this data source requires one of the following application roles: Domain.Read.All
or Directory.Read.All
When authenticated with a user principal, this data source does not require any additional roles.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";
const aadDomains = azuread.getDomains({});
export const domainNames = aadDomains.then(aadDomains => aadDomains.domains.map(__item => __item.domainName));
import pulumi
import pulumi_azuread as azuread
aad_domains = azuread.get_domains()
pulumi.export("domainNames", [__item.domain_name for __item in aad_domains.domains])
package main
import (
"github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
aadDomains, err := azuread.GetDomains(ctx, nil, nil);
if err != nil {
return err
}
ctx.Export("domainNames", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:3,11-43)))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() =>
{
var aadDomains = AzureAD.GetDomains.Invoke();
return new Dictionary<string, object?>
{
["domainNames"] = aadDomains.Apply(getDomainsResult => getDomainsResult.Domains).Select(__item => __item.DomainName).ToList(),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.AzureadFunctions;
import com.pulumi.azuread.inputs.GetDomainsArgs;
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 aadDomains = AzureadFunctions.getDomains();
ctx.export("domainNames", aadDomains.applyValue(getDomainsResult -> getDomainsResult.domains()).stream().map(element -> element.domainName()).collect(toList()));
}
}
Coming soon!
Using getDomains
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 getDomains(args: GetDomainsArgs, opts?: InvokeOptions): Promise<GetDomainsResult>
function getDomainsOutput(args: GetDomainsOutputArgs, opts?: InvokeOptions): Output<GetDomainsResult>
def get_domains(admin_managed: Optional[bool] = None,
include_unverified: Optional[bool] = None,
only_default: Optional[bool] = None,
only_initial: Optional[bool] = None,
only_root: Optional[bool] = None,
supports_services: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetDomainsResult
def get_domains_output(admin_managed: Optional[pulumi.Input[bool]] = None,
include_unverified: Optional[pulumi.Input[bool]] = None,
only_default: Optional[pulumi.Input[bool]] = None,
only_initial: Optional[pulumi.Input[bool]] = None,
only_root: Optional[pulumi.Input[bool]] = None,
supports_services: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDomainsResult]
func GetDomains(ctx *Context, args *GetDomainsArgs, opts ...InvokeOption) (*GetDomainsResult, error)
func GetDomainsOutput(ctx *Context, args *GetDomainsOutputArgs, opts ...InvokeOption) GetDomainsResultOutput
> Note: This function is named GetDomains
in the Go SDK.
public static class GetDomains
{
public static Task<GetDomainsResult> InvokeAsync(GetDomainsArgs args, InvokeOptions? opts = null)
public static Output<GetDomainsResult> Invoke(GetDomainsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azuread:index/getDomains:getDomains
arguments:
# arguments dictionary
The following arguments are supported:
- Admin
Managed bool - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - Include
Unverified bool - Set to
true
if unverified Azure AD domains should be included. Defaults tofalse
. - Only
Default bool - Set to
true
to only return the default domain. - Only
Initial bool - Set to
true
to only return the initial domain, which is your primary Azure Active Directory tenant domain. Defaults tofalse
. - Only
Root bool - Set to
true
to only return verified root domains. Excludes subdomains and unverified domains. - Supports
Services List<string> A list of supported services that must be supported by a domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
.Note on filters If
include_unverified
is set totrue
, you cannot specifyonly_default
oronly_initial
. Additionally, you cannot combineonly_default
withonly_initial
.
- Admin
Managed bool - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - Include
Unverified bool - Set to
true
if unverified Azure AD domains should be included. Defaults tofalse
. - Only
Default bool - Set to
true
to only return the default domain. - Only
Initial bool - Set to
true
to only return the initial domain, which is your primary Azure Active Directory tenant domain. Defaults tofalse
. - Only
Root bool - Set to
true
to only return verified root domains. Excludes subdomains and unverified domains. - Supports
Services []string A list of supported services that must be supported by a domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
.Note on filters If
include_unverified
is set totrue
, you cannot specifyonly_default
oronly_initial
. Additionally, you cannot combineonly_default
withonly_initial
.
- admin
Managed Boolean - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - include
Unverified Boolean - Set to
true
if unverified Azure AD domains should be included. Defaults tofalse
. - only
Default Boolean - Set to
true
to only return the default domain. - only
Initial Boolean - Set to
true
to only return the initial domain, which is your primary Azure Active Directory tenant domain. Defaults tofalse
. - only
Root Boolean - Set to
true
to only return verified root domains. Excludes subdomains and unverified domains. - supports
Services List<String> A list of supported services that must be supported by a domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
.Note on filters If
include_unverified
is set totrue
, you cannot specifyonly_default
oronly_initial
. Additionally, you cannot combineonly_default
withonly_initial
.
- admin
Managed boolean - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - include
Unverified boolean - Set to
true
if unverified Azure AD domains should be included. Defaults tofalse
. - only
Default boolean - Set to
true
to only return the default domain. - only
Initial boolean - Set to
true
to only return the initial domain, which is your primary Azure Active Directory tenant domain. Defaults tofalse
. - only
Root boolean - Set to
true
to only return verified root domains. Excludes subdomains and unverified domains. - supports
Services string[] A list of supported services that must be supported by a domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
.Note on filters If
include_unverified
is set totrue
, you cannot specifyonly_default
oronly_initial
. Additionally, you cannot combineonly_default
withonly_initial
.
- admin_
managed bool - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - include_
unverified bool - Set to
true
if unverified Azure AD domains should be included. Defaults tofalse
. - only_
default bool - Set to
true
to only return the default domain. - only_
initial bool - Set to
true
to only return the initial domain, which is your primary Azure Active Directory tenant domain. Defaults tofalse
. - only_
root bool - Set to
true
to only return verified root domains. Excludes subdomains and unverified domains. - supports_
services Sequence[str] A list of supported services that must be supported by a domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
.Note on filters If
include_unverified
is set totrue
, you cannot specifyonly_default
oronly_initial
. Additionally, you cannot combineonly_default
withonly_initial
.
- admin
Managed Boolean - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - include
Unverified Boolean - Set to
true
if unverified Azure AD domains should be included. Defaults tofalse
. - only
Default Boolean - Set to
true
to only return the default domain. - only
Initial Boolean - Set to
true
to only return the initial domain, which is your primary Azure Active Directory tenant domain. Defaults tofalse
. - only
Root Boolean - Set to
true
to only return verified root domains. Excludes subdomains and unverified domains. - supports
Services List<String> A list of supported services that must be supported by a domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
.Note on filters If
include_unverified
is set totrue
, you cannot specifyonly_default
oronly_initial
. Additionally, you cannot combineonly_default
withonly_initial
.
getDomains Result
The following output properties are available:
- Domains
List<Pulumi.
Azure AD. Outputs. Get Domains Domain> - A list of tenant domains. Each
domain
object provides the attributes documented below. - Id string
- The provider-assigned unique ID for this managed resource.
- Admin
Managed bool - Whether the DNS for the domain is managed by Microsoft 365.
- Include
Unverified bool - Only
Default bool - Only
Initial bool - Only
Root bool - Supports
Services List<string>
- Domains
[]Get
Domains Domain - A list of tenant domains. Each
domain
object provides the attributes documented below. - Id string
- The provider-assigned unique ID for this managed resource.
- Admin
Managed bool - Whether the DNS for the domain is managed by Microsoft 365.
- Include
Unverified bool - Only
Default bool - Only
Initial bool - Only
Root bool - Supports
Services []string
- domains
List<Get
Domains Domain> - A list of tenant domains. Each
domain
object provides the attributes documented below. - id String
- The provider-assigned unique ID for this managed resource.
- admin
Managed Boolean - Whether the DNS for the domain is managed by Microsoft 365.
- include
Unverified Boolean - only
Default Boolean - only
Initial Boolean - only
Root Boolean - supports
Services List<String>
- domains
Get
Domains Domain[] - A list of tenant domains. Each
domain
object provides the attributes documented below. - id string
- The provider-assigned unique ID for this managed resource.
- admin
Managed boolean - Whether the DNS for the domain is managed by Microsoft 365.
- include
Unverified boolean - only
Default boolean - only
Initial boolean - only
Root boolean - supports
Services string[]
- domains
Sequence[Get
Domains Domain] - A list of tenant domains. Each
domain
object provides the attributes documented below. - id str
- The provider-assigned unique ID for this managed resource.
- admin_
managed bool - Whether the DNS for the domain is managed by Microsoft 365.
- include_
unverified bool - only_
default bool - only_
initial bool - only_
root bool - supports_
services Sequence[str]
- domains List<Property Map>
- A list of tenant domains. Each
domain
object provides the attributes documented below. - id String
- The provider-assigned unique ID for this managed resource.
- admin
Managed Boolean - Whether the DNS for the domain is managed by Microsoft 365.
- include
Unverified Boolean - only
Default Boolean - only
Initial Boolean - only
Root Boolean - supports
Services List<String>
Supporting Types
GetDomainsDomain
- Admin
Managed bool - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - Authentication
Type string - The authentication type of the domain. Possible values include
Managed
orFederated
. - Default bool
- Whether this is the default domain that is used for user creation.
- Domain
Name string - The name of the domain.
- Initial bool
- Whether this is the initial domain created by Azure Active Directory.
- Root bool
- Whether the domain is a verified root domain (not a subdomain).
- Supported
Services List<string> - A list of capabilities / services supported by the domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
. - Verified bool
- Whether the domain has completed domain ownership verification.
- Admin
Managed bool - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - Authentication
Type string - The authentication type of the domain. Possible values include
Managed
orFederated
. - Default bool
- Whether this is the default domain that is used for user creation.
- Domain
Name string - The name of the domain.
- Initial bool
- Whether this is the initial domain created by Azure Active Directory.
- Root bool
- Whether the domain is a verified root domain (not a subdomain).
- Supported
Services []string - A list of capabilities / services supported by the domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
. - Verified bool
- Whether the domain has completed domain ownership verification.
- admin
Managed Boolean - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - authentication
Type String - The authentication type of the domain. Possible values include
Managed
orFederated
. - default_ Boolean
- Whether this is the default domain that is used for user creation.
- domain
Name String - The name of the domain.
- initial Boolean
- Whether this is the initial domain created by Azure Active Directory.
- root Boolean
- Whether the domain is a verified root domain (not a subdomain).
- supported
Services List<String> - A list of capabilities / services supported by the domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
. - verified Boolean
- Whether the domain has completed domain ownership verification.
- admin
Managed boolean - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - authentication
Type string - The authentication type of the domain. Possible values include
Managed
orFederated
. - default boolean
- Whether this is the default domain that is used for user creation.
- domain
Name string - The name of the domain.
- initial boolean
- Whether this is the initial domain created by Azure Active Directory.
- root boolean
- Whether the domain is a verified root domain (not a subdomain).
- supported
Services string[] - A list of capabilities / services supported by the domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
. - verified boolean
- Whether the domain has completed domain ownership verification.
- admin_
managed bool - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - authentication_
type str - The authentication type of the domain. Possible values include
Managed
orFederated
. - default bool
- Whether this is the default domain that is used for user creation.
- domain_
name str - The name of the domain.
- initial bool
- Whether this is the initial domain created by Azure Active Directory.
- root bool
- Whether the domain is a verified root domain (not a subdomain).
- supported_
services Sequence[str] - A list of capabilities / services supported by the domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
. - verified bool
- Whether the domain has completed domain ownership verification.
- admin
Managed Boolean - Set to
true
to only return domains whose DNS is managed by Microsoft 365. Defaults tofalse
. - authentication
Type String - The authentication type of the domain. Possible values include
Managed
orFederated
. - default Boolean
- Whether this is the default domain that is used for user creation.
- domain
Name String - The name of the domain.
- initial Boolean
- Whether this is the initial domain created by Azure Active Directory.
- root Boolean
- Whether the domain is a verified root domain (not a subdomain).
- supported
Services List<String> - A list of capabilities / services supported by the domain. Possible values include
Email
,Sharepoint
,EmailInternalRelayOnly
,OfficeCommunicationsOnline
,SharePointDefaultDomain
,FullRedelegation
,SharePointPublic
,OrgIdAuthentication
,Yammer
andIntune
. - verified Boolean
- Whether the domain has completed domain ownership verification.
Package Details
- Repository
- Azure Active Directory (Azure AD) pulumi/pulumi-azuread
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuread
Terraform Provider.