microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
385 stars 246 forks source link

License error when publishing extension to sandbox container #2162

Closed etolman-experlogix closed 3 years ago

etolman-experlogix commented 3 years ago

We have a Business Central AL extension but have difficulties developing against a sandbox container. We encounter errors such as "Your program license does not allow you to publish..." (more details below). We are a certified ISV with a reserved object ID range. We have dev licenses for NAV 2013-2018, but we don't know how to obtain one for BC (or do they even exist for BC?). Microsoft personnel suggested posting an issue in here, so here we are. Any help would be appreciated.

Here are repro steps for one of those difficulties:

  1. Create a container with the command: New-BCContainer -accept_eula -accept_outdated -containerName bc16 -artifactUrl (Get-BcArtifactUrl -type Sandbox -version 16 -country w1 -select Latest) -assignPremiumPlan -doNotExportObjectsToText -shortcuts None -updateHosts
  2. Open the AL extension code in Visual Studio Code. In case it matters, here are the launch.json contents:
    {
    "version": "0.2.0",
    "configurations": [
      {
         "name": "Local BC v16 container",
         "type": "al",
         "request": "launch",
         "server": "http://bc16",
         "serverInstance": "BC",
         "authentication": "Windows",
         "startupObjectId": 22,
         "startupObjectType": "Page",
         "breakOnError": true,
         "launchBrowser": true,
         "enableLongRunningSqlStatements": true,
         "enableSqlInformationDebugger": true,
         "tenant": "default"
      }
    ]
    }
  3. Press Ctrl+F5 to publish and run.

It fails with an error message "Could not publish the package to the server. See Visual Studio Code debug console for more details.". The Debug Console shows the following (scroll to the right for the relevant parts on the last line):

[2021-10-28 23:40:37.86] Publishing AL application using launch configuration 'Local BC v16 container'.
[2021-10-28 23:40:38.01] Targeting server 'http://bc16', server instance 'BC' and tenant 'default'.
[2021-10-28 23:40:38.01] Using Windows authentication.
[2021-10-28 23:40:38.01] Sending request to http://bc16:7049/BC/dev/metadata?tenant=default
[2021-10-28 23:40:38.46] Publishing package to tenant 'default'
[2021-10-28 23:40:38.46] Sending request to http://bc16:7049/BC/dev/apps?tenant=default&SchemaUpdateMode=synchronize&DependencyPublishingOption=default
[2021-10-28 23:40:43.40] The request for path /BC/dev/apps?tenant=default&SchemaUpdateMode=synchronize&DependencyPublishingOption=default failed with code UnprocessableEntity. Reason: Your program license does not allow you to publish 'Experlogix Setting'.
TrippyZ commented 3 years ago

I suggest you try installing your app using bccontainerhelper rather than from VScode.

christianbraeunlich commented 3 years ago

Try this:

  1. http://businesscenter.mbs.microsoft.com
  2. Developer tools
  3. License Key Configuration
  4. Configure and download the .flf license
  5. Add the license file to your script, e.g.:
New-BcContainer `
-licenseFile 'C:\temp\License.flf' `
-accept_eula `
-accept_outdated `
-containerName bc16 `
-artifactUrl (Get-BcArtifactUrl -type Sandbox -version 16 -country w1 -select Latest) `
-assignPremiumPlan `
-doNotExportObjectsToText `
-shortcuts None `
-updateHosts
etolman-experlogix commented 3 years ago

@TrippyZ, I should have mentioned this before: I've tried publishing the extension using bccontainerhelper, but that produces exactly the same license error.

etolman-experlogix commented 3 years ago

@christianbraeunlich, thank you for the advice. Unfortunately the only licenses available for us to download are NAV licenses (version 2018 and earlier); there are no Business Central licenses. Microsoft's PartnerSource support has informed us that BC on-premise is not an available option there.

freddydk commented 3 years ago

Sorry, I have no insight in how partners are getting their licenses, but every partner developing an AppSource App using docker will have to have a developer license with their objects to develop. If you post the question on Yammer (maybe the AppSource group) then other partners should be able to tell you how they get their licenses.

freddydk commented 3 years ago

There is nothing you can do to get around this problem without the license.

etolman-experlogix commented 3 years ago

Thank you, @freddydk. I may still have access to the Yammer channel; I'll give that a shot.

etolman-experlogix commented 3 years ago

We found and fixed the issue on our end. Our IT just needed to update some permissions in PartnerSource to enable the license key configuration option there. Now we can generate all the Business Central On-Prem developer license files we need. Thank you to all who helped out!