-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
When using ALOpsExtensionAPI@1, ALOps checks if the extension is already installed by comparing the PackageId and Version properties. However, BC compares the AppId and Version. This means if an app has been recompiled with the same version number and is already in BC, Alops will try to install it but error.
- task: Hodor.hodor-alops.ALOpsExtensionAPI.ALOpsExtensionAPI@1
displayName: 'Publish Extensions'
inputs:
interaction: batch
api_endpoint: $(custenvironmentname)/api
authentication: Basic
username: '$(onprem-api-username)'
password: '$(onprem-api-password)'
artifact_path: '$(Pipeline.Workspace)'
artifact_filter: '*.app'
maxtries: 40The below example is publishing to an on prem envirenment, but we have the same issue with SaaS:
Error in Alops:
*** Selected Company: CRONUS UK Ltd. [4128f995-4793-ef11-8a6d-6045bde98dce]
Invoke-RestMethod -Method Get -Uri 'https://########:7048/bcwebservicestest/api/microsoft/automation/v1.0/companies(4128f995-4793-ef11-8a6d-6045bde98dce)/extensions'
*** Installed Extensions:
...
@odata.etag : W/"JzE5OzgzNjIwMDA0MjI4OTA2MjQzODIxOzAwOyc="
packageId : 54f1fa95-2c9d-4a27-95fc-93bf7ffcd88d
id : 94c83401-7a52-4b1c-905a-af2666fba998
displayName : Production BOM and Routing No. on Item Variant
publisher : Dynamics Consultants Ltd.
versionMajor : 19
versionMinor : 1
versionBuild : 3
versionRevision : 0
isInstalled : True
publishedAs : PTE
...
*** Publish App [C:\agents\_work\710\AL.ProdBOMRoutingOnItemVariant\DC Manufacturing\Dynamics Consultants Ltd._Production BOM and Routing No. on Item Variant_19.1.3.0_sandbox_27.1_gb.app]
*** Upload extension [C:\agents\_work\710\AL.ProdBOMRoutingOnItemVariant\DC Manufacturing\Dynamics Consultants Ltd._Production BOM and Routing No. on Item Variant_19.1.3.0_sandbox_27.1_gb.app]
*** Get App Info
* App.PackageID = 1cfdccae-38ec-4b17-81b3-b4af11265285
* App.ID = 94c83401-7a52-4b1c-905a-af2666fba998
* App.Name = Production BOM and Routing No. on Item Variant
* App.Publisher = Dynamics Consultants Ltd.
* App.Version = 19.1.3.0
*** Get Extension status
Invoke-RestMethod -Method Get -Uri 'https://######:7048/bcwebservicestest/api/microsoft/automation/v1.0/companies(4128f995-4793-ef11-8a6d-6045bde98dce)/extensions'
*** Update Extension
Invoke-RestMethod -Method Patch -Uri 'https://######:7048/bcwebservicestest/api/microsoft/automation/v1.0/companies(4128f995-4793-ef11-8a6d-6045bde98dce)/extensionUpload(0)/content'
*** Poll Deployment status
Invoke-RestMethod -Method Get -Uri 'https://######:7048/bcwebservicestest/api/microsoft/automation/v1.0/companies(4128f995-4793-ef11-8a6d-6045bde98dce)/extensionDeploymentStatus'
*** Deployment Status:
operationID : 31cb7657-f992-4140-86f1-d272e4953171
name : Production BOM and Routing No. on Item Variant
publisher : Dynamics Consultants Ltd.
appVersion : 19.1.3.0
status : Failed
startedOn : 2025-11-20T15:58:27.84Z
##[error]App publish failed. Check the 'Extension Deployment Status' page in the Business Central client.
##[error]App publish failed, aborting batch
Error in event viewer
Server instance: BCWebServicesTest
Category: Extensions
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 83064404-d4e1-4efd-99b5-1da556a03b8e
ServerActivityId: 81293025-2290-43ed-ac8a-ecaf64811f4a
EventTime: 11/20/2025 15:58:27
Message App 'Production BOM and Routing No. on Item Variant' (appId: '94c83401-7a52-4b1c-905a-af2666fba998') by 'Dynamics Consultants Ltd.' version '19.1.3.0' appears as already published. ErrorType: 'InvalidOperation'; ErrorMessage: 'This Extension cannot be published as it has the same App ID and Version as a previously published Extension.'.
ProcessId: 35208
Tag: 0000GQM
ThreadId: 14
ExecutionId: 2407
CounterInformation:
CustomParameters: {
}
GatewayCorrelationId:
Expected behavior
I would have expected ALOps to use the same logic as BC when checking if the extension is already installed. If the package ID needs to be checked this should be switchable with a parameter.