B2C Tenants - Create

Initiates an async request to create both the Azure AD B2C tenant and the corresponding Azure resource linked to a subscription.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureActiveDirectory/b2cDirectories/{resourceName}?api-version=2021-04-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group.

resourceName
path True

string

The initial domain name of the Azure AD B2C tenant.

subscriptionId
path True

string

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Version of the API to be used with the client request.

Request Body

Name Required Type Description
location True

string

The location in which the resource is hosted and data resides. Can be one of 'United States', 'Europe', 'Asia Pacific', or 'Australia'. Refer to this documentation for more information.

sku True

B2CResourceSKU

SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at aka.ms/b2cBilling.

properties.createTenantProperties.countryCode

string

Country code of Azure tenant (e.g. 'US'). Refer to aka.ms/B2CDataResidency to see valid country codes and corresponding data residency locations. If you do not see a country code in an valid data residency location, choose one from the list.

properties.createTenantProperties.displayName

string

The display name of the Azure AD B2C tenant.

tags

object

Resource Tags

Responses

Name Type Description
200 OK

B2CTenantResource

OK - Response of the URL in Location header if the async operation is successful. Resource will be created.

202 Accepted

Azure AD B2C tenant create request accepted. The Location header indicates the URL/location in which to check to get the async status of the operation.

Headers

  • Location: string
  • Retry-After: string
Other Status Codes

CloudError

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create tenant

Sample request

PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/contosoResourceGroup/providers/Microsoft.AzureActiveDirectory/b2cDirectories/contoso.onmicrosoft.com?api-version=2021-04-01

{
  "location": "United States",
  "sku": {
    "name": "Standard",
    "tier": "A0"
  },
  "properties": {
    "createTenantProperties": {
      "displayName": "Contoso",
      "countryCode": "US"
    }
  }
}

Sample response

{
  "type": "Microsoft.AzureActiveDirectory/b2cDirectories",
  "sku": {
    "name": "Standard",
    "tier": "A0"
  },
  "properties": {
    "billingConfig": {
      "billingType": "MAU",
      "effectiveStartDateUtc": "1/1/0001 12:00:00 AM"
    },
    "tenantId": "00000000-0000-0000-0000-000000000000"
  },
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/contosoResourceGroup/providers/Microsoft.AzureActiveDirectory/b2cDirectories/contoso.onmicrosoft.com",
  "name": "contoso.onmicrosoft.com",
  "location": "United States",
  "tags": null
}
Location: https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.AzureActiveDirectory/operations/99999999-9999-9999-9999-999999999999
Retry-After: 60

Definitions

Name Description
B2CResourceSKU

SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at aka.ms/b2cBilling.

B2CResourceSKUName

The name of the SKU for the tenant.

B2CResourceSKUTier

The tier of the tenant.

B2CTenantResource
BillingConfig

The billing configuration for the tenant.

BillingType

The type of billing. Will be MAU for all new customers. If 'Auths', it can be updated to 'MAU'. Cannot be changed if value is 'MAU'. Learn more about Azure AD B2C billing at aka.ms/b2cBilling.

CloudError

An error response for a resource management request.

createdByType

The type of identity that created the resource.

CreateTenantRequestBody

The information needed to create the Azure AD B2C tenant and corresponding Azure resource, which is used for billing purposes.

ErrorAdditionalInfo

The resource management error additional info.

ErrorResponse

Error Response

systemData

Metadata pertaining to creation and last modification of the resource.

TypeValue

The type of the B2C tenant resource.

B2CResourceSKU

SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at aka.ms/b2cBilling.

Name Type Description
name

B2CResourceSKUName

The name of the SKU for the tenant.

tier

B2CResourceSKUTier

The tier of the tenant.

B2CResourceSKUName

The name of the SKU for the tenant.

Name Type Description
PremiumP1

string

Azure AD B2C usage is billed to a linked Azure subscription and uses number of authentications based billing.

PremiumP2

string

Azure AD B2C usage is billed to a linked Azure subscription and uses number of authentications based billing.

Standard

string

Azure AD B2C usage is billed to a linked Azure subscription and uses a monthly active users (MAU) billing model.

B2CResourceSKUTier

The tier of the tenant.

Name Type Description
A0

string

The SKU tier used for all Azure AD B2C tenants.

B2CTenantResource

Name Type Description
id

string

An identifier that represents the Azure AD B2C tenant resource.

location

string

The location in which the resource is hosted and data resides. Can be one of 'United States', 'Europe', 'Asia Pacific', or 'Australia'. Refer to this documentation for more information.

name

string

The name of the Azure AD B2C tenant resource.

properties.billingConfig

BillingConfig

The billing configuration for the tenant.

properties.tenantId

string

An identifier of the Azure AD B2C tenant.

sku

B2CResourceSKU

SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at aka.ms/b2cBilling.

systemData

systemData

Metadata pertaining to creation and last modification of the resource.

tags

object

Resource Tags

type

TypeValue

The type of the B2C tenant resource.

BillingConfig

The billing configuration for the tenant.

Name Type Description
billingType

BillingType

The type of billing. Will be MAU for all new customers. If 'Auths', it can be updated to 'MAU'. Cannot be changed if value is 'MAU'. Learn more about Azure AD B2C billing at aka.ms/b2cBilling.

effectiveStartDateUtc

string

The data from which the billing type took effect

BillingType

The type of billing. Will be MAU for all new customers. If 'Auths', it can be updated to 'MAU'. Cannot be changed if value is 'MAU'. Learn more about Azure AD B2C billing at aka.ms/b2cBilling.

Name Type Description
Auths

string

Azure AD B2C usage is billed to a linked Azure subscription and uses number of authentications based billing.

MAU

string

Azure AD B2C usage is billed to a linked Azure subscription and uses a monthly active users (MAU) billing model.

CloudError

An error response for a resource management request.

Name Type Description
error

ErrorResponse

Error Response
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

CreateTenantRequestBody

The information needed to create the Azure AD B2C tenant and corresponding Azure resource, which is used for billing purposes.

Name Type Description
location

string

The location in which the resource is hosted and data resides. Can be one of 'United States', 'Europe', 'Asia Pacific', or 'Australia'. Refer to this documentation for more information.

properties.createTenantProperties.countryCode

string

Country code of Azure tenant (e.g. 'US'). Refer to aka.ms/B2CDataResidency to see valid country codes and corresponding data residency locations. If you do not see a country code in an valid data residency location, choose one from the list.

properties.createTenantProperties.displayName

string

The display name of the Azure AD B2C tenant.

sku

B2CResourceSKU

SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at aka.ms/b2cBilling.

tags

object

Resource Tags

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorResponse

Error Response

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorResponse[]

The error details.

message

string

The error message.

target

string

The error target.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

TypeValue

The type of the B2C tenant resource.

Name Type Description
Microsoft.AzureActiveDirectory/b2cDirectories

string

The resource type for Azure AD B2C tenant resource.