microsoft / AL-Go

The plug-and-play DevOps solution for Business Central app development on GitHub
MIT License
293 stars 124 forks source link

You cannot sign in due to a technical issue. Contact your system administrator. #622

Closed TheDoubleH closed 1 year ago

TheDoubleH commented 1 year ago

I am doing my first AL-Go project, and I am running into an issue.

Running the .\AL-Go\LocalDevEnv.ps1 succeed, but when I try and log in, I get the error:

You cannot sign in due to a technical issue. Contact your system administrator.

image

I get the error, using all of the default values when I run the script

When creating a Container using this script, the container and login successfully creates:

$containerName = 'bcserver'
$password = 'InsertPasswordHere'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'Henrik', $securePassword
$auth = 'UserPassword'
$artifactUrl = Get-BcArtifactUrl -type 'Sandbox' -country 'us' -select 'Latest'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -multitenant:$false `
    -dns '8.8.8.8' `
    -updateHosts `
    -isolation HyperV

Here is the full output using AL-Go:

  _                     _   _____             ______
 | |                   | | |  __ \           |  ____|
 | |     ___   ___ __ _| | | |  | | _____   __ |__   _ ____   __
 | |    / _ \ / __/ _` | | | |  | |/ _ \ \ / /  __| | '_ \ \ / /
 | |____ (_) | (__ (_| | | | |__| |  __/\ V /| |____| | | \ V / 
 |______\___/ \___\__,_|_| |_____/ \___| \_/ |______|_| |_|\_/  

This script will create a docker based local development environment for your project.

NOTE: You need to have Docker installed, configured and be able to create Business Central containers for this to work.
If this fails, you can setup a cloud based development environment by running cloudDevEnv.ps1

All apps and test apps will be compiled and published to the environment in the development scope.
The script will also modify launch.json to have a Local Sandbox configuration point to your environment.

Applying settings from C:\Repos\<Client>\SalesOrderImport\.github\AL-Go-Settings.json
Applying settings from C:\Repos\<Client>\SalesOrderImport\.AL-Go\settings.json
Checking System Requirements

Container name
--------------
Please enter the name of the container to create (default bcserver)
bcserver selected

Authentication mechanism for container
--------------------------------------
a Windows Authentication
b Username/Password authentication

Select authentication mechanism for container (default b) 
Username/Password authentication selected

PowerShell credential request
Please enter username and password for your container
Password for user admin: *************

LicenseFileUrl
--------------
When developing PTEs, you can optionally specify a developer licensefile with permissions to object IDs of your dependant apps

Local path or a secure download URL to license file  (default none)
none selected

Downloading BcContainerHelper latest version from CDN
Using 7zip
BcContainerHelper version 5.0.4
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Running on PowerShell 7
Applying settings from C:\Repos\<Client>\SalesOrderImport\.github\AL-Go-Settings.json
Applying settings from C:\Repos\<Client>\SalesOrderImport\.AL-Go\settings.json
Checking type
Checking appFolders, testFolders and bcptTestFolders
Application Dependency 22.0.0.0
Checking artifact setting for project
Downloading artifacts from https://bcartifacts.azureedge.net/sandbox/22.3.58346.58976/us
Updating app- and test Dependencies
Analyzing Test App Dependencies
Checking project dependencies
Checking appDependencyProbingPaths
WARNING: No performance test apps found in bcptTestFolders in .AL-Go\settings.json
WARNING: No test apps found in testFolders in .AL-Go\settings.json
  _____                               _
 |  __ \                             | |
 | |__) |_ _ _ __ __ _ _ __ ___   ___| |_ ___ _ __ ___
 |  ___/ _` | '__/ _` | '_ ` _ \ / _ \ __/ _ \ '__/ __|
 | |  | (_| | | | (_| | | | | | |  __/ |_  __/ |  \__ \
 |_|   \__,_|_|  \__,_|_| |_| |_|\___|\__\___|_|  |___/

Pipeline name                   localDevEnv
Container name                  bcserver
Image name
ArtifactUrl                     https://bcartifacts.azureedge.net/sandbox/22.3.58346.58976/us
SasToken                        Not Specified
BcAuthContext                   Not Specified
Environment
ReUseContainer                  False
KeepContainer                   True
useCompilerFolder               False
artifactCachePath
useDevEndpoint                  True
Auth                            UserPassword
Credential                      Specified
CompanyName
MemoryLimit                     8G
FailOn                          error
TreatTestFailuresAsWarnings     False
Enable Task Scheduler           False
Assign Premium Plan             False
Install Test Runner             False
Install Test Framework          False
Install Test Libraries          False
Install Perf. Toolkit           False
InstallOnlyReferencedApps       True
generateDependencyArtifact      False
CopySymbolsFromContainer        False
enableCodeCop                   False
enableAppSourceCop              False
enableUICop                     False
enablePerTenantExtensionCop     True
doNotPerformUpgrade             False
doNotPublishApps                False
uninstallRemovedApps            False
escapeFromCops                  False
doNotBuildTests                 False
doNotRunTests                   True
doNotRunBcptTests               True
useDefaultAppSourceRuleSet      False
rulesetFile
azureDevOps                     False
gitLab                          False
gitHubActions                   False
vsixFile
License file                    Not specified
CodeSignCertPfxFile             Not specified
CodeSignCertPfxPassword         Not specified
CodeSignCertIsSelfSigned        False
KeyVaultCertPfxFile             Not specified
KeyVaultCertPfxPassword         Not specified
KeyVaultClientId
BuildOutputFile
ContainerEventLogFile
TestResultsFile                 C:\Repos\<Client>\SalesOrderImport\TestResults.xml
BcptTestResultsFile             C:\Repos\<Client>\SalesOrderImport\bcptTestResults.json
TestResultsFormat               JUnit
AdditionalCountries
PackagesFolder                  .packages
OutputFolder
BuildArtifactFolder
CreateRuntimePackages           False
AppVersion
AppBuild                        0
AppRevision                     0
SourceRepositoryUrl
SourceCommit
BuildBy                         BcContainerHelper,5.0.4
BuildUrl
Install Apps
- None
Install Test Apps
- None
Previous Apps
- None
Application folders
- C:\Repos\<Client>\SalesOrderImport\App
Test application folders
- None
BCPT Test application folders
- None
BCPT Test suites
- None
Custom CodeCops
- None

  _____       _ _ _                                          _        _
 |  __ \     | | (_)                                        (_)      (_)
 | |__) |   _| | |_ _ __   __ _    __ _  ___ _ __   ___ _ __ _  ___   _ _ __ ___   __ _  __ _  ___
 |  ___/ | | | | | | '_ \ / _` |  / _` |/ _ \ '_ \ / _ \ '__| |/ __| | | '_ ` _ \ / _` |/ _` |/ _ \
 | |   | |_| | | | | | | | (_| | | (_| |  __/ | | |  __/ |  | | (__  | | | | | | | (_| | (_| |  __/
 |_|    \__,_|_|_|_|_| |_|\__, |  \__, |\___|_| |_|\___|_|  |_|\___| |_|_| |_| |_|\__,_|\__, |\___|
                           __/ |   __/ |                                                 __/ |
                          |___/   |___/                                                 |___/

Pulling mcr.microsoft.com/businesscentral:10.0.20348.1850

What's Next?
  View summary of image vulnerabilities and recommendations → docker scout quickview mcr.microsoft.com/businesscentral:10.0.20348.1850

Pulling generic image took 7 seconds

   _____                _   _                               _        _
  / ____|              | | (_)                             | |      (_)
 | |     _ __ ___  __ _| |_ _ _ __   __ _    ___ ___  _ __ | |_ __ _ _ _ __   ___ _ __
 | |    | '__/ _ \/ _` | __| | '_ \ / _` |  / __/ _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
 | |____| | |  __/ (_| | |_| | | | | (_| | | (__ (_) | | | | |_ (_| | | | | |  __/ |
  \_____|_|  \___|\__,_|\__|_|_| |_|\__, |  \___\___/|_| |_|\__\__,_|_|_| |_|\___|_|
                                     __/ |
                                    |___/

Creaing docker container
BcContainerHelper is version 5.0.4
BcContainerHelper is running as administrator
HyperV is Enabled
UsePsSession is True
Host is Microsoft Windows 11 Pro - 10.0.22621.1992
Docker Client Version is 24.0.2
Docker Server Version is 24.0.2
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
Using image mcr.microsoft.com/businesscentral:10.0.20348.1850
Creating Container bcserver
Style: sandbox
Multitenant: Yes
Version: 22.3.58346.58976
Platform: 22.0.58954.0
Generic Tag: 1.0.2.14
Container OS Version: 10.0.20348.1850 (ltsc2022)
Host OS Version: 10.0.22621.1992 (22H2)
Using process isolation
Using locale en-US
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Additional Parameters:
--volume "C:\Repos\<Client>\SalesOrderImport:c:\sources"
--volume "C:/Repos/<Client>/SalesOrderImport:c:\shared"
--env customNavSettings=EnableTaskScheduler=False
Files in C:\ProgramData\BcContainerHelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcserver from image mcr.microsoft.com/businesscentral:10.0.20348.1850
d90e56b9a574e00d1d006e36592ec49ce6e786d59bcaed2a433507fbf1a394ce
Waiting for container bcserver to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/22.3.58346.58976/us
Using installer from C:\Run\210-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\sandbox\22.3.58346.58976\platform\ServiceTier\Program Files
c:\dl\sandbox\22.3.58346.58976\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\22.3.58346.58976\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\22.3.58346.58976\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\sandbox\22.3.58346.58976\platform\WebClient\Microsoft Dynamics NAV
Copying ModernDev Files
c:\dl\sandbox\22.3.58346.58976\platform
c:\dl\sandbox\22.3.58346.58976\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\sandbox\22.3.58346.58976\us\ConfigurationPackages
Copying Test Assemblies
C:\dl\sandbox\22.3.58346.58976\platform\Test Assemblies
Copying Extensions
C:\dl\sandbox\22.3.58346.58976\us\Extensions
Copying Applications
C:\dl\sandbox\22.3.58346.58976\platform\Applications
Copying Applications.US
C:\dl\sandbox\22.3.58346.58976\us\Applications.US
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Restoring CRONUS Demo Database
Setting CompatibilityLevel for tenant on localhost\SQLEXPRESS
Exporting Application to CRONUS
Removing Application from tenant
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Starting Business Central Service Tier
Importing license file
Copying Database on localhost\SQLEXPRESS from tenant to default
Taking database tenant offline
Copying database files
Attaching files as new Database default
Putting database tenant back online
Mounting tenant database
Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
Sync'ing Tenant
Tenant is Operational
Stopping Business Central Service Tier
Installation took 343 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.2.183 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.2.183 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.29.0.1 in container hosts file
Starting Container
Hostname is bcserver
PublicDnsName is bcserver
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 17333CA530131B52472533E558ED5AEF9C8CCBD9
DNS identity bcserver
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to False
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Using application pool name: BC
Using default container name: NavWebApplicationContainer
Copy files to WWW root C:\inetpub\wwwroot\BC
Create the application pool BC
Create website: NavWebApplicationContainer without SSL
Update configuration: navsettings.json
Done Configuring Web Client
Enabling Financials User Experience
Dismounting Tenant
Mounting Tenant
Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
Sync'ing Tenant
Tenant is Operational
Creating http download site
Setting SA Password and enabling SA
Creating admin as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 172.29.7.11
Container Hostname  : bcserver
Container Dns Name  : bcserver
Web Client          : http://bcserver/BC/?tenant=default
Dev. Server         : http://bcserver
Dev. ServerInstance : BC
Dev. Server Tenant  : default
Setting bcserver to 172.29.7.11 in host hosts file
Setting bcserver-default to 172.29.7.11 in host hosts file
Setting bcserver-default to 172.29.7.11 in container hosts file

Files:
http://bcserver:8080/ALLanguage.vsix

Container Total Physical Memory is 31.8Gb
Container Free Physical Memory is 10.1Gb

Initialization took 43 seconds
Ready for connections!
Reading CustomSettings.config from bcserver
Creating Desktop Shortcuts for bcserver
Cleanup old dotnet core assemblies
Container bcserver successfully created

Use:
Get-BcContainerEventLog -containerName bcserver to retrieve a snapshot of the event log from the container
Get-BcContainerDebugInfo -containerName bcserver to get debug information about the container
Enter-BcContainer -containerName bcserver to open a PowerShell prompt inside the container
Remove-BcContainer -containerName bcserver to remove the container again
docker logs bcserver to retrieve information about URL's again

Creating container took 406 seconds

 _____                _       _                   _                           _                 _
|  __ \              | |     (_)                 | |                         | |               (_)
| |__) |___ ___  ___ | |_   ___ _ __   __ _    __| | ___ _ __   ___ _ __   __| | ___ _ __   ___ _  ___ ___
|  _  // _ \ __|/ _ \| \ \ / / | '_ \ / _` |  / _` |/ _ \ '_ \ / _ \ '_ \ / _` |/ _ \ '_ \ / __| |/ _ \ __|
| | \ \  __\__ \ (_) | |\ V /| | | | | (_| | | (_| |  __/ |_) |  __/ | | | (_| |  __/ | | | (__| |  __\__ \
|_|  \_\___|___/\___/|_| \_/ |_|_| |_|\__, |  \__,_|\___| .__/ \___|_| |_|\__,_|\___|_| |_|\___|_|\___|___/
                                       __/ |            | |
                                      |___/             |_|

Sorted App folders
- C:\Repos\<Client>\SalesOrderImport\App
External dependencies
- 437dbf0e-84ff-417a-965d-ed2bb9650972:Microsoft_Base Application_22.0.0.0.app
- 63ca2fa4-4f03-4f2b-a480-172fef340d3f:Microsoft_System Application_22.0.0.0.app
Sorted TestApp folders
- None

   _____                      _ _ _
  / ____|                    (_) (_)
 | |     ___  _ __ ___  _ __  _| |_ _ __   __ _    __ _ _ __  _ __  ___
 | |    / _ \| '_ ` _ \| '_ \| | | | '_ \ / _` |  / _` | '_ \| '_ \/ __|
 | |____ (_) | | | | | | |_) | | | | | | | (_| | | (_| | |_) | |_) \__ \
  \_____\___/|_| |_| |_| .__/|_|_|_|_| |_|\__, |  \__,_| .__/| .__/|___/
                       | |                 __/ |       | |   | |
                       |_|                |___/        |_|   |_|

Compiling C:\Repos\<Client>\SalesOrderImport\App
Copying DLLs from C:\Program Files\Microsoft Dynamics NAV\220\Service to assemblyProbingPath
Removing dotnet Framework Assemblies
Using Symbols Folder: C:\Repos\<Client>\SalesOrderImport\App\.alPackages
Processing dependency Microsoft_Application_22.0.0.0 ()
Downloading symbols: Microsoft_Application_22.3.58346.58976.app
Url : http://172.29.7.11:7049/BC/dev/packages?publisher=Microsoft&appName=Application&versionText=22.0.0.0&tenant=default 
Downloading using HttpClient
Adding dependency to System Application from Microsoft
Adding dependency to Base Application from Microsoft
Processing dependency Microsoft_System_1.0.0.0 ()
Downloading symbols: Microsoft_System_22.0.58954.0.app
Url : http://172.29.7.11:7049/BC/dev/packages?publisher=Microsoft&appName=System&versionText=1.0.0.0&tenant=default       
Downloading using HttpClient
Processing dependency Microsoft_System Application_22.3.0.0 (63ca2fa4-4f03-4f2b-a480-172fef340d3f)
Downloading symbols: Microsoft_System Application_22.3.58346.58976.app
Url : http://172.29.7.11:7049/BC/dev/packages?appId=63ca2fa4-4f03-4f2b-a480-172fef340d3f&versionText=22.3.0.0&tenant=default
Downloading using HttpClient
Processing dependency Microsoft_Base Application_22.3.0.0 (437dbf0e-84ff-417a-965d-ed2bb9650972)
Downloading symbols: Microsoft_Base Application_22.3.58346.58976.app
Url : http://172.29.7.11:7049/BC/dev/packages?appId=437dbf0e-84ff-417a-965d-ed2bb9650972&versionText=22.3.0.0&tenant=default
Downloading using HttpClient
Compiling...
.\alc.exe /project:"c:\sources\App" /packagecachepath:"c:\sources\App\.alPackages" /out:"c:\sources\App\Helgesen Consulting, Inc._Sales Order Import (<Client>)_1.2.210504.0.app" /analyzer:C:\build\vsix\extension\bin\Analyzers\Microsoft.Dynamics.Nav.PerTenantExtensionCop.dll /assemblyprobingpaths:"C:\Program Files\dotnet\shared","C:\ProgramData\BcContainerHelper\Extensions\bcserver\.netPackages\Service"
Microsoft (R) AL Compiler version 11.5.12.49234
Copyright (C) Microsoft Corporation. All rights reserved

Compilation started for project 'Sales Order Import (<Client>)' containing '13' files at '19:54:57.582'.

Compilation ended at '19:55:09.239'.

C:\Repos\<Client>\SalesOrderImport\App\Helgesen Consulting, Inc._Sales Order Import (<Client>)_1.2.210504.0.app successfully created in 157 seconds
Publishing Helgesen Consulting, Inc._Sales Order Import (<Client>)_1.2.210504.0.app to http://172.29.7.11:7049/BC/dev/apps?SchemaUpdateMode=synchronize&tenant=default
App Helgesen Consulting, Inc._Sales Order Import (<Client>)_1.2.210504.0.app successfully published
Modifying C:\Repos\<Client>\SalesOrderImport\App\.vscode\launch.json
{
  "type": "al",
  "request": "launch",
  "name": "Local Sandbox (bcserver)",
  "server": "http://bcserver",
  "serverInstance": "BC",
  "port": 7049,
  "tenant": "default",
  "authentication": "UserPassword"
}

Compiling apps took 214 seconds

AL Pipeline finished in 628 seconds
Removing BcContainerHelper
freddydk commented 1 year ago

The container created by LocalDevEnv is multitenant. The container you create with your own script has -multitenant:$false - i.e. single tenant.

You probably need to add ?tenant=default to your login URL

TheDoubleH commented 1 year ago

<Insert .gif with Homer Simpson exclaiming "DOH!">