HodorNV / ALOps

ALOps
56 stars 24 forks source link

ALOps Extension API uses wrong bcartifactsCacheFolder setting #779

Closed CarloAxians closed 3 weeks ago

CarloAxians commented 1 month ago

Describe the bug We configured on our build servers that the bcartifactsCacheFolder is on the e-drive. When we compile our apps, the artifacts are stored on the e-drive as expected. But when we publish our apps on the server with the ALOps Extension API the artifacts are stored on the c-drive.

the used yaml please provide the yaml that you used. It helps you put the yaml like this:

steps:
- task: Hodor.hodor-alops.ALOpsExtensionAPI.ALOpsExtensionAPI@1
  displayName: 'Publish App'
  inputs:
    interaction: publish
    api_endpoint: 'https://api.businesscentral.dynamics.com/v2.0/$(azure_tenant_id)/$(DevEnvironment)/api'
    dev_endpoint: 'https://api.businesscentral.dynamics.com/v2.0/$(azure_tenant_id)/$(DevEnvironment)/dev'
    dev_schemeupdatemode: forcesync
    azure_tenant_id: '$(CustomerTenantId)'
    azure_app_client_id: '$(appautomation.clientid)'
    azure_app_client_secret: '$(appautomation.clientsecret)'
    artifact_filter: '$(appfilter)'
    checksecondsdelay: 60
    replacepackageid: true
  timeoutInMinutes: 15

the output Also the complete output is necessary for us to see what is going on. Also use backtics:

2024-08-02T06:51:36.2495681Z *** Published Extensions (not installed):
2024-08-02T06:51:36.2631846Z 
2024-08-02T06:51:36.2833509Z *** Import NAV/BC Management DLL's [False]
2024-08-02T06:51:36.2888788Z *** ServiceTier not specified, loading default assemblies.
2024-08-02T06:51:36.2965736Z *** Default Assemblies not found. Load via BC-Artifacts
2024-08-02T06:51:36.3056718Z *** Install/Update BCContainerHelper [https://github.com/microsoft/navcontainerhelper]
2024-08-02T06:51:36.3092467Z *** Check BcContainerHelper
2024-08-02T06:51:36.3947473Z *** Load BcContainerHelper
2024-08-02T06:51:36.7227144Z BcContainerHelper version 6.0.15
2024-08-02T06:51:38.1215558Z Setting bcartifactsCacheFolder = e:\BcContainerHelper\bcartifacts.cache
2024-08-02T06:51:38.1425157Z BC.HelperFunctions emits usage statistics telemetry to Microsoft
2024-08-02T06:51:38.8726770Z Running on Windows, PowerShell 5.1.17763.5202
2024-08-02T06:51:51.8940824Z 
2024-08-02T06:51:51.8941811Z ModuleType Version    Name                                ExportedCommands                                             
2024-08-02T06:51:51.8942134Z ---------- -------    ----                                ----------------                                             
2024-08-02T06:51:51.8943225Z Script     6.0.15     BcContainerHelper                   {Add-FontsToBcContainer, Add-GitToAlProjectFolder, AddTele...
2024-08-02T06:51:51.8943352Z 
2024-08-02T06:51:51.8943393Z 
2024-08-02T06:51:51.8943429Z 
2024-08-02T06:51:51.8953066Z 
2024-08-02T06:51:51.9018047Z ##[command]"Get-BCArtifactUrl" 
2024-08-02T06:51:51.9018392Z Name                           Value                                                                                   
2024-08-02T06:51:51.9018797Z ----                           -----                                                                                   
2024-08-02T06:51:51.9019026Z select                         Weekly                                                                                  
2024-08-02T06:51:51.9019704Z type                           Sandbox                                                                                 
2024-08-02T06:51:51.9020090Z country                        W1                                                                                      
2024-08-02T06:51:51.9020191Z 
2024-08-02T06:51:51.9020241Z 
2024-08-02T06:51:51.9020802Z  -select: Weekly -type: Sandbox -country: W1
2024-08-02T06:52:25.9345478Z *** Platform: C:\bcartifacts.cache\sandbox\24.3.21374.22309\platform
2024-08-02T06:52:25.9680886Z *** Localisation: C:\bcartifacts.cache\sandbox\24.3.21374.22309\w1
2024-08-02T06:52:26.2555963Z *** BC Management DLL: C:\bcartifacts.cache\sandbox\24.3.21374.22309\platform\ServiceTier\program files\Microsoft Dynamics NAV\240\Service\Management\Microsoft.Dynamics.Nav.Management.dll
2024-08-02T06:52:26.2702836Z *** Selected module: [C:\bcartifacts.cache\sandbox\24.3.21374.22309\platform\ServiceTier\program files\Microsoft Dynamics NAV\240\Service\Management\Microsoft.Dynamics.Nav.Management.dll]
2024-08-02T06:52:26.2717393Z *** Loading module: [C:\bcartifacts.cache\sandbox\24.3.21374.22309\platform\ServiceTier\program files\Microsoft Dynamics NAV\240\Service\Management\Microsoft.Dynamics.Nav.Management.dll]
2024-08-02T06:52:26.4642021Z *** BC Management DLL: C:\bcartifacts.cache\sandbox\24.3.21374.22309\platform\ServiceTier\program files\Microsoft Dynamics NAV\240\Service\Management\Microsoft.Dynamics.Nav.Management.dll
2024-08-02T06:52:26.4664049Z *** Selected module: [C:\bcartifacts.cache\sandbox\24.3.21374.22309\platform\ServiceTier\program files\Microsoft Dynamics NAV\240\Service\Management\Microsoft.Dynamics.Nav.Management.dll]
2024-08-02T06:52:26.4672163Z *** Loading module: [C:\bcartifacts.cache\sandbox\24.3.21374.22309\platform\ServiceTier\program files\Microsoft Dynamics NAV\240\Service\Management\Microsoft.Dynamics.Nav.Management.dll]

Expected behavior In the logging the setting is correctly retrieved: Setting bcartifactsCacheFolder = e:\BcContainerHelper\bcartifacts.cache , but it is not correctly used: Platform: C:\bcartifacts.cache\sandbox\24.3.21374.22309\platform. This should have been e:\BcContainerHelper\bcartifacts.cache\sandbox\24.3.21374.22309\platform

waldo1001 commented 3 weeks ago

We can't have too much dependencies on BCCH.

In the past, we have solved this with a symbolic link. In your case:

mklink /d "c:\bc.artifactscache" "e:\BcContainerHelper\bcartifacts.cache"

It will permanently create the link, and all will work like default.

waldo1001 commented 3 weeks ago

Added to "Troubleshooting" documentation on docs. Will be available soon.