Muokkaa

Jaa


Working with development sandboxes and entitlements

The experience that a user has in Dynamics 365 Business Central depends on the purchased subscription plan. In Dynamics 365 Business Central, there are two main plans; the Essential and the Premium plan, plus a few more. For more information, see Licensing in Dynamics 365 Business Central. For detailed information about the Essential and Premium plans, see Business Central on the Microsoft Dynamics 365 site.

When you develop in a Docker sandbox, the Essential experience is automatically assigned to you (you set the experience on the Company Information page), which makes it difficult to test how a user with the Premium plan assigned will experience what you have developed.

Note

There is no license check in a Docker Sandbox except for on Purchase and Sales documents. There is a different behavior in these documents as the TEAMMEMBER license has partial access. In particular Invoices, Orders, Quotes and Credit Memos share the same table and the TEAMMEMBER license has access only to Quotes.

Setup for users with different plans

To mimic users with a specific subscription plan assigned, you can set them up with the user groups as detailed in the table below. When you add user to the group, the permission sets defined for the group will apply to the user. For more information, see To group users in user groups.

Note

In the table below non-default means not assigned by default, but the plan allows this to be assigned to the user.

User Name
The type of subscription plan
assigned to the given user
User Groups
EXTERNALACCOUNTANT

Dynamics 365 Business Central External Accountant
D365 EXT. ACCOUNTANT
EXTEN. MGT. - ADMIN (non-default)
D365 TROUBLESHOOT (non-default)
D365 SECURITY (non-default)
PREMIUM

Dynamics 365 Business Central Premium
Dynamics 365 Business Central for IWs
D365 BUS PREMIUM
EXTEN. MGT. - ADMIN (non-default)
D365 TROUBLESHOOT (non-default)
D365 SECURITY (non-default)
ESSENTIAL

Dynamics 365 Business Central Essential
D365 BUS FULL ACCESS
EXTEN. MGT. - ADMIN (non-default)
D365 TROUBLESHOOT (non-default)
D365 SECURITY (non-default)
INTERNALADMIN

Internal Administrator
D365 INTERNAL ADMIN
D365 TROUBLESHOOT
D365 BACKUP/RESTORE
D365 SECURITY (non-default)
TEAMMEMBER

Dynamics 365 for Team Members
D365 TEAM MEMBER
D365 TROUBLESHOOT (non-default)
D365 SECURITY (non-default)
DEVICE

Dynamics 365 Business Central Device
D365 FULL ACCESS
EXTEN. MGT. - ADMIN (non-default)
D365 BUS PREMIUM (non-default)*
D365 TROUBLESHOOT (non-default)

D365 SECURITY (non-default)

*) Please note: usage need to be according to terms in Licensing Guide
DELEGATEDADMIN

Delegated Admin agent - Partner
Delegated Helpdesk agent - Partner
EXTEN. MGT. - ADMIN
D365 FULL ACCESS
D365 RAPIDSTART
D365 BACKUP/RESTORE
D365 TROUBLESHOOT
D365 SECURITY (non-default)

Tip

For more information about how to choose a user experience, see Changing Which Features are Displayed.

Assigning the Premium plan to test users

Depending on how you are running your Docker sandbox, you assign the experience in different ways.

Azure VMs

If you use https://aka.ms/bcsandbox to create your Dynamics 365 Business Central Sandbox Container Azure VM, the Azure Resource Manager template has two fields; Assign Premium Plan and Create Test Users, which by default are set to Yes.

Assign Premium Plan specifies whether or not your admin user should be assigned a Premium plan. Create Test Users specifies whether or not you want the setup to include test users.

BCContainerHelper

If you're using New-BCContainer to create your Dynamics 365 Business Central Sandbox container, you must make sure that you're using version 0.2.8.3 or later.

Use the switch assignPremiumPlan on New-BCContainer like this:

New-BCContainer -accept_eula -updateHosts -containerName test -artifactUrl (Get-BCArtifactUrl -country us) -assignPremiumPlan

This assigns the Premium plan to your default admin user. Internally this just adds a record to the User Plan table.

To create the test users, you must call the Setup-BCContainerTestUsers method:

Setup-BCContainerTestUsers containerName test -tenant default -password $securePassword

specifying the container and the password that you want to use for the new users.

Internally, the Setup-BCContainerTestUsers downloads an app that exposes an API, publishes and installs the app, and then invokes the CreateTestUsers API with the password needed. After this, the app is uninstalled and unpublished.

If you want to see code behind the app, it's available here.

Docker run

If you're using Docker run to run your containers, you have a little more work to do.

First of all, you must override the SetupNavUsers.ps1 by sharing a local folder to c:\run\my in the container and place a file called SetupNavUsers.ps1 in that folder with the following content:

# Invoke default behavior
. (Join-Path $runPath $MyInvocation.MyCommand.Name)
 
Get-NavServerUser -serverInstance $ServerInstance -tenant default |? LicenseType -eq "FullUser" | ForEach-Object {
    $UserId = $_.UserSecurityId
    Write-Host "Assign Premium plan for $($_.Username)"
    Invoke-Sqlcmd -ErrorAction Ignore -ServerInstance 'localhost\SQLEXPRESS' -Query "USE [$TenantId]
    INSERT INTO [dbo].[User Plan`$63ca2fa4-4f03-4f2b-a480-172fef340d3f] ([Plan ID],[User Security ID]) VALUES ('{8e9002c0-a1d8-4465-b952-817d2948e6e2}','$userId')"
}

This will assign the Premium plan to the admin user in the database.

Tip

To set up test users, you can clone the createtestusers repository and modify the code to create the users on the oninstall trigger with the password that you want.

See also

Programming in AL
Sandbox Environments for Dynamics 365 Business Central Development
Container Sandbox
Changing Which Features are Displayed
Production and Sandbox Environments