Skip to main content

Create

Creates a new tenant and provisions the current user as admin.

Examples​

Basic usage:

octo-cli -c Create -tid "newtenant" -db "newtenant_db"

Default database name (tenant id, prefixed with the instance's tenant-database prefix):

octo-cli -c Create -tid "newtenant"

Scratch tenant for an agent (client-credentials login of the parent tenant):

octo-cli -c Create `
-tid "scratch1" `
-db "scratch1_db" `
-sc

Tenant with a catalog blueprint applied in the same call:

octo-cli -c Create -tid "newtenant" -b "MyBlueprint-1.0.0"

Options​

ShortLongRequiredDescription
-tid--tenantIdyesId of tenant
-db--databasenoName of database (optional: without it the service names the database after the tenant id, with the instance's tenant-database prefix when one is configured)
-np--no-provisionnoSkip admin provisioning of the current user
-sc--scratchnoCreate a scratch tenant: the client-credentials client that runs this command becomes administrator of the new tenant (no human login needed)
-b--blueprintnoCatalog blueprint to apply while creating the tenant (<Name>-<version>, e.g. MyBlueprint-1.0.0). Transactional: if the blueprint is unknown or fails to apply, the tenant is not created

Notes​

--scratch is for agents and automation that log in with a client (LogInClientCredentials): the tenant records the creating client, and that client's mirror in the new tenant becomes administrator (TenantOwners) of it. The agent then gets a token for the child (client_credentials, acr_values tenant:<child> - octo-cli does this for Delete --disable-features), works with the existing verbs, switches the capabilities off and deletes the tenant, without any human login. The grant survives an identity restart and is revoked by removing the client from TenantOwners (RemoveClientFromGroup).

Accepted only for a client-credentials token of the direct parent with the role TenantManagement (HTTP 403 for a user token or another tenant). The client has to be flagged AutoProvisionInChildTenants (AddClientCredentialsClient -apic) - otherwise it has no mirror in the child and gets nothing. --scratch skips the provisioning of the current user (a service token has no user). GetTenants shows isScratch, scratchCreatorClientId and scratchAccessRevoked.

Without --scratch nothing changes: the current user becomes administrator unless --no-provision is given.

--database is optional: without it the service names the database after the tenant id. An instance with a tenant-database prefix (System:TenantDatabasePrefix) prefixes that name and refuses an explicit name without the prefix (HTTP 409, 'Database name ... is not available'). Services in older versions require --database.

--blueprint applies a catalog blueprint (ListBlueprints shows the ids) while the tenant is created, in one transaction: when the blueprint is unknown or fails to apply, the service aborts, no tenant is left behind and the command ends with a non-zero exit code and the service's message ('Blueprint application failed: ...'). Combines with --database, --scratch and --no-provision; the current user is provisioned only after the tenant and its blueprint exist. Same result as Create followed by InstallBlueprint, without a half-set-up tenant in between.