HodorNV / ALOps

ALOps
58 stars 24 forks source link

[ALOpsExtensionAPI] Deployment gets PTE object id range error [50000..99999] #594

Closed PeterConijn closed 1 year ago

PeterConijn commented 1 year ago

Describe the bug After not being able to resolve the issues on #592 we decided to push for cloud environments. We have now two Acceptance environments on 21.2 and have been able to publish our apps from VSCode (Dev) into both databases.

Next step was to repoint DevOps releases to the new environments. We have had some hurdles (authentication, url configuration), but now we are running into an error we cannot quite figure out.

We are using the ALOpsExtensionAPI module, which results in the following error:

[error]App publish failed. Check the 'Extension Deployment Status' page in the Business Central client.

Being good little debuggers, we checked the extension deployment status and it revealed the following issue:

Package validation failed due to the following error(s): SRC/Codeunits/CDU.11021503.DSYLicenseManagement.al (4,19) - Error PTE0001: Codeunit 'DSY License Management' has an ID of [11021503]. It must be within the range '[50000..99999]'. The app ID range set in the app.json is entirely different, but does not seem to be respected.

This seems to be because ALOpsExtensionAPI is publishing it as a PTE, but should it not take the ISV app ranges as defined in the app.json into account?

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: 'ALOps Extension API'
  inputs:
    interaction: batch
    api_endpoint: 'https://api.businesscentral.dynamics.com/v2.0/$(azure_tenant_id)/DyselNL-Acceptance/api'
    azure_tenant_id: '$(W1ACC_TenantID)'
    azure_app_client_id: '$(ClientId)'
    azure_app_client_secret: '$(ClientSecret)'
    username: '$(UserName)'
    password: '$(UserPassword)'
    showdeploymentstatus: false

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

2022-12-19T11:56:27.9847237Z ##[section]Starting: ALOps Extension API
2022-12-19T11:56:27.9946455Z ==============================================================================
2022-12-19T11:56:27.9946818Z Task         : ALOps Extension API
2022-12-19T11:56:27.9947129Z Description  : Get/Publish extensions with the Business Central API
2022-12-19T11:56:27.9947414Z Version      : 1.454.3383
2022-12-19T11:56:27.9947608Z Author       : Hodor
2022-12-19T11:56:27.9947890Z Help         : Get/Publish extensions with the Business Central API.
2022-12-19T11:56:27.9948240Z ==============================================================================
2022-12-19T11:56:29.6499712Z *** Validate configuration
2022-12-19T11:56:29.9985696Z *** Task Inputs:
2022-12-19T11:56:30.0047400Z 
2022-12-19T11:56:30.0174709Z name                                                                                                              value
2022-12-19T11:56:30.0175784Z ----                                                                                                              -----
2022-12-19T11:56:30.0177301Z usedocker                                                                                                         False
2022-12-19T11:56:30.0178042Z fixed_tag                                                                                                              
2022-12-19T11:56:30.0178676Z interaction                                                                                                       batch
2022-12-19T11:56:30.0198514Z api_endpoint                          ...pi.businesscentral.dynamics.com/v2.0/$(azure_tenant_id)/DyselNL-Acceptance/api
2022-12-19T11:56:30.0199166Z dev_endpoint                                                                                                           
2022-12-19T11:56:30.0200037Z dev_schemeupdatemode                                                                                        synchronize
2022-12-19T11:56:30.0200933Z apiversion                                                                                                         v1.0
2022-12-19T11:56:30.0201958Z authentication                                                                                                    oauth
2022-12-19T11:56:30.0203693Z azure_tenant_id                                                                    ***
2022-12-19T11:56:30.0204485Z azure_app_client_id                                                                ***
2022-12-19T11:56:30.0206466Z azure_app_client_secret                                                        ***
2022-12-19T11:56:30.0207155Z azure_app_client_certificate                                                                                           
2022-12-19T11:56:30.0207607Z azure_app_client_certificate_password                                                                                  
2022-12-19T11:56:30.0208567Z username                                                                                                     ***
2022-12-19T11:56:30.0210010Z password                                                                                                     ***
2022-12-19T11:56:30.0210478Z bccompany                                                                                                              
2022-12-19T11:56:30.0353785Z artifact_path                                                                          C:\ADO_agents\agent1\_work\r28\a
2022-12-19T11:56:30.0354805Z artifact_filter                                                                                                   *.app
2022-12-19T11:56:30.0356115Z showdeploymentstatus                                                                                              False
2022-12-19T11:56:30.0356638Z checksecondsdelay                                                                                                    30
2022-12-19T11:56:30.0357127Z maxtries                                                                                                             20
2022-12-19T11:56:30.0359508Z replacepackageid                                                                                                  False
2022-12-19T11:56:30.0360071Z blocksymbolsonly                                                                                                  False
2022-12-19T11:56:30.0365771Z 
2022-12-19T11:56:30.0366208Z 
2022-12-19T11:56:30.0366413Z 
2022-12-19T11:56:30.0449814Z *** For documentation, please visit   : https://www.alops.be/documentation
2022-12-19T11:56:30.0453112Z 
2022-12-19T11:56:30.3526165Z *** ALOps License:
2022-12-19T11:56:30.3546371Z   * Licensed To: Computervak BV (RepositoryPer5 License)
2022-12-19T11:56:30.3549747Z 
2022-12-19T11:56:31.6723355Z *** Imported required PS-Functions
2022-12-19T11:56:31.6736244Z *** Parse Task Parameters
2022-12-19T11:56:31.7374567Z *** Replace TenantID variable $(azure_tenant_id) in API Endpoint [https://api.businesscentral.dynamics.com/v2.0/$(azure_tenant_id)/DyselNL-Acceptance/api]
2022-12-19T11:56:31.7391323Z *** Creating API Connector with endpoint [https://api.businesscentral.dynamics.com/v2.0/***/DyselNL-Acceptance/api]
2022-12-19T11:56:31.7774509Z *** API Version: v1.0
2022-12-19T11:56:31.7795752Z *** Interaction Mode: batch
2022-12-19T11:56:31.7825710Z *** API Authentication: Using Azure OAuth Authentication [7b0d4b84-bead-4212-9f64-97798970cea5]
2022-12-19T11:56:31.7850918Z *** Get OAuth token for tenant [***]
2022-12-19T11:56:31.8079981Z *** Communication: Impersonating User
2022-12-19T11:56:31.8085733Z   * HINT: Switching to Service-2-Service Authentication
2022-12-19T11:56:31.8091443Z   * Setup Azure following Kauffman's guide:
2022-12-19T11:56:31.8097229Z     https://www.kauffmann.nl/2020/09/14/service-to-service-authentication-for-automation-apis-in-business-central/
2022-12-19T11:56:31.8104091Z   * Remove the 'username' and 'password' parameters from the ALOps Task
2022-12-19T11:56:31.8107105Z 
2022-12-19T11:56:31.8142869Z ##[command]Invoke-RestMethod -Method Post -Uri "https://login.microsoftonline.com/***/oauth2/token"
2022-12-19T11:56:32.0819017Z *** List Companies
2022-12-19T11:56:32.0906178Z ##[command]Invoke-RestMethod -Method Get -Uri 'https://api.businesscentral.dynamics.com/v2.0/***/dyselnl-acceptance/api/microsoft/automation/v1.0/companies'
2022-12-19T11:56:33.7106390Z 
2022-12-19T11:56:33.7111100Z 
2022-12-19T11:56:33.7115715Z id                : 3cece12d-337d-ed11-9989-6045bd9248ba
2022-12-19T11:56:33.7116115Z systemVersion     : 21.2.49946.49990
2022-12-19T11:56:33.7116461Z timestamp         : 196634
2022-12-19T11:56:33.7116921Z name              : Master
2022-12-19T11:56:33.7117964Z displayName       : Master
2022-12-19T11:56:33.7118744Z businessProfileId : 
2022-12-19T11:56:33.7119291Z systemCreatedAt   : 2022-12-16T11:17:11.36Z
2022-12-19T11:56:33.7119728Z systemCreatedBy   : cd2aafaf-be63-46ba-98a2-9dbb5ad2dcce
2022-12-19T11:56:33.7120241Z systemModifiedAt  : 2022-12-16T11:17:11.36Z
2022-12-19T11:56:33.7120749Z systemModifiedBy  : cd2aafaf-be63-46ba-98a2-9dbb5ad2dcce
2022-12-19T11:56:33.7121054Z 
2022-12-19T11:56:33.7150787Z id                : 9f124856-337d-ed11-9989-6045bd9248ba
2022-12-19T11:56:33.7151244Z systemVersion     : 21.2.49946.49990
2022-12-19T11:56:33.7151561Z timestamp         : 198424
2022-12-19T11:56:33.7151866Z name              : TestcompanyDyselApp
2022-12-19T11:56:33.7152184Z displayName       : TestcompanyDyselApp
2022-12-19T11:56:33.7152493Z businessProfileId : 
2022-12-19T11:56:33.7152844Z systemCreatedAt   : 2022-12-16T11:18:17.677Z
2022-12-19T11:56:33.7153242Z systemCreatedBy   : cd2aafaf-be63-46ba-98a2-9dbb5ad2dcce
2022-12-19T11:56:33.7153655Z systemModifiedAt  : 2022-12-16T11:18:17.677Z
2022-12-19T11:56:33.7154068Z systemModifiedBy  : cd2aafaf-be63-46ba-98a2-9dbb5ad2dcce
2022-12-19T11:56:33.7154265Z 
2022-12-19T11:56:33.7154354Z 
2022-12-19T11:56:33.7154442Z 
2022-12-19T11:56:33.7171280Z *** Selected Company: Master [3cece12d-337d-ed11-9989-6045bd9248ba]
2022-12-19T11:56:33.7424563Z ##[command]Invoke-RestMethod -Method Get -Uri 'https://api.businesscentral.dynamics.com/v2.0/***/dyselnl-acceptance/api/microsoft/automation/v1.0/companies(3cece12d-337d-ed11-9989-6045bd9248ba)/extensions'
2022-12-19T11:56:34.1817055Z *** Installed Extensions:
2022-12-19T11:56:34.1850671Z 
2022-12-19T11:56:34.1977733Z 
2022-12-19T11:56:34.1978719Z packageId   : 58679c7b-af87-4c8a-9d08-978912dbfd57
2022-12-19T11:56:34.1979272Z id          : 20e625e3-6e92-4f69-b00a-4ec194c3519f
2022-12-19T11:56:34.1979929Z publisher   : Documizers B.V.
2022-12-19T11:56:34.1980275Z displayName : DocuBuilder
2022-12-19T11:56:34.1980865Z version     : 1.0
2022-12-19T11:56:34.1981025Z 
2022-12-19T11:56:34.1981796Z packageId   : 30f066ca-d507-4a4c-8f6d-6259e60da4e3
2022-12-19T11:56:34.1982202Z id          : 16319982-4995-4fb1-8fb2-2b1e13773e3b
2022-12-19T11:56:34.1982535Z publisher   : Microsoft
2022-12-19T11:56:34.1982863Z displayName : AMC Banking 365 Fundamentals
2022-12-19T11:56:34.1983163Z version     : 21.2
2022-12-19T11:56:34.1983310Z 
2022-12-19T11:56:34.1983616Z packageId   : 991f4667-ed9c-4733-8b8b-78d90d3158c0
2022-12-19T11:56:34.1984005Z id          : a2cc2ef8-949f-43d4-45b8-10bd6f8bc62c
2022-12-19T11:56:34.1984343Z publisher   : Microsoft
2022-12-19T11:56:34.1984638Z displayName : API Reports - Finance
2022-12-19T11:56:34.1984935Z version     : 21.2
2022-12-19T11:56:34.1985050Z 
2022-12-19T11:56:34.1985353Z packageId   : 1d479edd-bd8e-4adb-8e29-b8d562b161f8
2022-12-19T11:56:34.1985740Z id          : c1335042-3002-4257-bf8a-75c898ccb1b8
2022-12-19T11:56:34.1986054Z publisher   : Microsoft
2022-12-19T11:56:34.1986353Z displayName : Application
2022-12-19T11:56:34.1986638Z version     : 21.2
2022-12-19T11:56:34.1986752Z 
2022-12-19T11:56:34.1987040Z packageId   : 11d62b7c-44d4-4555-9ef2-9ca7634fb734
2022-12-19T11:56:34.1987429Z id          : 437dbf0e-84ff-417a-965d-ed2bb9650972
2022-12-19T11:56:34.1987761Z publisher   : Microsoft
2022-12-19T11:56:34.1988061Z displayName : Base Application
2022-12-19T11:56:34.1988450Z version     : 21.2
2022-12-19T11:56:34.1988844Z 
2022-12-19T11:56:34.1989299Z packageId   : c3218cc7-42cb-4b36-912f-11b0a4cbaa09
2022-12-19T11:56:34.1999001Z id          : 6992416f-3f39-4d3c-8242-3fff61350bea
2022-12-19T11:56:34.1999838Z publisher   : Microsoft
2022-12-19T11:56:34.2000533Z displayName : Business Central Cloud Migration - Previous Release
2022-12-19T11:56:34.2000992Z version     : 21.2
2022-12-19T11:56:34.2008645Z 
2022-12-19T11:56:34.2009815Z packageId   : 06dcb21f-0f2e-477e-9df8-a26a5e6f8ce3
2022-12-19T11:56:34.2010316Z id          : 57623bfa-0559-4bc2-ae1c-0979c29fc8d1
2022-12-19T11:56:34.2010973Z publisher   : Microsoft
2022-12-19T11:56:34.2011352Z displayName : Business Central Cloud Migration API
2022-12-19T11:56:34.2012017Z version     : 21.2
2022-12-19T11:56:34.2012186Z 
2022-12-19T11:56:34.2012780Z packageId   : ef0a975d-7768-469c-9a40-961cc827317e
2022-12-19T11:56:34.2013197Z id          : 334ef79e-547e-4631-8ba1-7a7f18e14de6
2022-12-19T11:56:34.2013866Z publisher   : Microsoft
2022-12-19T11:56:34.2014400Z displayName : Business Central Intelligent Cloud
2022-12-19T11:56:34.2014760Z version     : 21.2
2022-12-19T11:56:34.2015151Z 
2022-12-19T11:56:34.2015496Z packageId   : 8ab1954a-b9ae-447e-9707-9b3661c8b6ea
2022-12-19T11:56:34.2016286Z id          : c512d720-63b9-4b26-b062-a0c09b4ed322
2022-12-19T11:56:34.2016650Z publisher   : Microsoft
2022-12-19T11:56:34.2017242Z displayName : Company Hub
2022-12-19T11:56:34.2017553Z version     : 21.2
2022-12-19T11:56:34.2017954Z 
2022-12-19T11:56:34.2018311Z packageId   : cdf0f9fc-fe98-4beb-b561-8ef301d0eb25
2022-12-19T11:56:34.2019007Z id          : 5a0b41e9-7a42-4123-d521-2265186cfb31
2022-12-19T11:56:34.2019372Z publisher   : Microsoft
2022-12-19T11:56:34.2019948Z displayName : Contoso Coffee Demo Dataset
2022-12-19T11:56:34.2020289Z version     : 21.2
2022-12-19T11:56:34.2020622Z 
2022-12-19T11:56:34.2020977Z packageId   : 521930fc-c3a4-4298-b315-f4564d090df8
2022-12-19T11:56:34.2021903Z id          : 5b0a41a1-6c42-4123-a521-2265186cfb35
2022-12-19T11:56:34.2022504Z publisher   : Microsoft
2022-12-19T11:56:34.2023201Z displayName : Contoso Coffee Demo Dataset (NL)
2022-12-19T11:56:34.2023553Z version     : 21.2
2022-12-19T11:56:34.2023965Z 
2022-12-19T11:56:34.2024445Z packageId   : 332a50f1-e3b3-485e-ade1-22992a704007
2022-12-19T11:56:34.2024841Z id          : 7819d79d-feea-4f09-bbed-5bbaca4bf323
2022-12-19T11:56:34.2025195Z publisher   : Microsoft
2022-12-19T11:56:34.2025755Z displayName : Data Archive
2022-12-19T11:56:34.2026197Z version     : 21.2
2022-12-19T11:56:34.2026482Z 
2022-12-19T11:56:34.2026825Z packageId   : 08896933-5035-4a71-9c56-a629aaae2dfa
2022-12-19T11:56:34.2027216Z id          : ac14293f-1eb7-4a7b-9936-b280da31970b
2022-12-19T11:56:34.2027565Z publisher   : Microsoft
2022-12-19T11:56:34.2028111Z displayName : Data Search
2022-12-19T11:56:34.2028568Z version     : 21.2
2022-12-19T11:56:34.2028833Z 
2022-12-19T11:56:34.2029321Z packageId   : abe8ef9a-1595-486d-961c-6365d0845c0e
2022-12-19T11:56:34.2029885Z id          : 59909dc2-6adb-43e7-9f83-1e4fa2be0b37
2022-12-19T11:56:34.2030391Z publisher   : Microsoft
2022-12-19T11:56:34.2030898Z displayName : Digital Tax Declaration for the Netherlands
2022-12-19T11:56:34.2031415Z version     : 21.2
2022-12-19T11:56:34.2031777Z 
2022-12-19T11:56:34.2032365Z packageId   : 1d84ee76-c688-4d45-b701-fa0eb6de2bb0
2022-12-19T11:56:34.2032791Z id          : 08d69832-9231-429e-be2c-8bab2c96905b
2022-12-19T11:56:34.2033358Z publisher   : Microsoft
2022-12-19T11:56:34.2033853Z displayName : Email - Current User Connector
2022-12-19T11:56:34.2034346Z version     : 21.2
2022-12-19T11:56:34.2034618Z 
2022-12-19T11:56:34.2035108Z packageId   : 135d9445-13da-4ca2-9764-4988862ef90f
2022-12-19T11:56:34.2036498Z id          : aceb66c8-472e-437c-81d3-27e6c07d0f14
2022-12-19T11:56:34.2036950Z publisher   : Microsoft
2022-12-19T11:56:34.2037565Z displayName : Email - Microsoft 365 Connector
2022-12-19T11:56:34.2038074Z version     : 21.2
2022-12-19T11:56:34.2038344Z 
2022-12-19T11:56:34.2038834Z packageId   : 1cec3123-22c2-46c9-9f3a-2edeadf5c7a7
2022-12-19T11:56:34.2039570Z id          : e6328152-bb29-4664-9dae-3bc7eaae1fd8
2022-12-19T11:56:34.2047089Z publisher   : Microsoft
2022-12-19T11:56:34.2049688Z displayName : Email - Outlook REST API
2022-12-19T11:56:34.2050147Z version     : 21.2
2022-12-19T11:56:34.2050478Z 
2022-12-19T11:56:34.2051003Z packageId   : 8a4e7ec9-0845-4786-87eb-9f8d451c071b
2022-12-19T11:56:34.2051576Z id          : 8fc50dfb-d338-4fd9-9499-5e44cc8cbf50
2022-12-19T11:56:34.2052086Z publisher   : Microsoft
2022-12-19T11:56:34.2052550Z displayName : Email - SMTP API
2022-12-19T11:56:34.2053012Z version     : 21.2
2022-12-19T11:56:34.2053282Z 
2022-12-19T11:56:34.2053772Z packageId   : 7075c4d5-dc48-45ba-afb3-1f7ef8066382
2022-12-19T11:56:34.2054338Z id          : 68e13fa3-217a-4be0-9141-99e5bf0ca818
2022-12-19T11:56:34.2054825Z publisher   : Microsoft
2022-12-19T11:56:34.2055316Z displayName : Email - SMTP Connector
2022-12-19T11:56:34.2055805Z version     : 21.2
2022-12-19T11:56:34.2056068Z 
2022-12-19T11:56:34.2056555Z packageId   : 21563dc0-d361-4c01-9be6-c790bd47d1f5
2022-12-19T11:56:34.2057121Z id          : 2a89f298-7ffd-44a5-a7ce-e08dac98abce
2022-12-19T11:56:34.2057634Z publisher   : Microsoft
2022-12-19T11:56:34.2058140Z displayName : Essential Business Headlines
2022-12-19T11:56:34.2058628Z version     : 21.2
2022-12-19T11:56:34.2058891Z 
2022-12-19T11:56:34.2059376Z packageId   : 18a3c3ba-00fd-4e00-9371-abf015c2d8af
2022-12-19T11:56:34.2059936Z id          : 58623bfa-0559-4bc2-ae1c-0979c29fd9e0
2022-12-19T11:56:34.2060424Z publisher   : Microsoft
2022-12-19T11:56:34.2060912Z displayName : Intelligent Cloud Base
2022-12-19T11:56:34.2061387Z version     : 21.2
2022-12-19T11:56:34.2061651Z 
2022-12-19T11:56:34.2062140Z packageId   : 963c5018-562a-432a-bfeb-2f9846a1b668
2022-12-19T11:56:34.2062696Z id          : 70912191-3c4c-49fc-a1de-bc6ea1ac9da6
2022-12-19T11:56:34.2063351Z publisher   : Microsoft
2022-12-19T11:56:34.2063822Z displayName : Intrastat Core
2022-12-19T11:56:34.2064281Z version     : 21.2
2022-12-19T11:56:34.2064544Z 
2022-12-19T11:56:34.2065035Z packageId   : 578b108d-e1a8-4d1e-bd56-5f07366fa0e8
2022-12-19T11:56:34.2065593Z id          : cc8916a3-0a29-43e7-bdd1-d729dfd74ed7
2022-12-19T11:56:34.2066080Z publisher   : Microsoft
2022-12-19T11:56:34.2066548Z displayName : Intrastat NL
2022-12-19T11:56:34.2067000Z version     : 21.2
2022-12-19T11:56:34.2067264Z 
2022-12-19T11:56:34.2067751Z packageId   : 3b85e857-50a6-44cf-9609-4b0be42d8726
2022-12-19T11:56:34.2068312Z id          : 3d5b2137-efeb-4014-8489-41d37f8fd4c3
2022-12-19T11:56:34.2068800Z publisher   : Microsoft
2022-12-19T11:56:34.2069289Z displayName : Late Payment Prediction
2022-12-19T11:56:34.2069766Z version     : 21.2
2022-12-19T11:56:34.2070030Z 
2022-12-19T11:56:34.2070513Z packageId   : cb9dad70-35c5-4866-aa66-9d98c594c447
2022-12-19T11:56:34.2071057Z id          : d09fa965-9a2a-424d-b704-69f3b54ed0ce
2022-12-19T11:56:34.2071563Z publisher   : Microsoft
2022-12-19T11:56:34.2072053Z displayName : Payment Links to PayPal
2022-12-19T11:56:34.2072524Z version     : 21.2
2022-12-19T11:56:34.2072795Z 
2022-12-19T11:56:34.2073278Z packageId   : c4391d55-cba3-43c9-80ea-2ac562c2227e
2022-12-19T11:56:34.2073824Z id          : a53a4bb0-aa53-8ff8-77d6-fe3388db0eb8
2022-12-19T11:56:34.2074323Z publisher   : Microsoft
2022-12-19T11:56:34.2074797Z displayName : Recommended Apps
2022-12-19T11:56:34.2075258Z version     : 21.2
2022-12-19T11:56:34.2075525Z 
2022-12-19T11:56:34.2076027Z packageId   : 4af9f7fc-0952-439b-b236-7843db92394e
2022-12-19T11:56:34.2076572Z id          : c526b3e9-b8ca-4683-81ba-fcd5f6b1472a
2022-12-19T11:56:34.2077076Z publisher   : Microsoft
2022-12-19T11:56:34.2077572Z displayName : Sales and Inventory Forecast
2022-12-19T11:56:34.2078053Z version     : 21.2
2022-12-19T11:56:34.2078319Z 
2022-12-19T11:56:34.2078802Z packageId   : b1bc6f81-4fd2-4015-9e58-686714d15007
2022-12-19T11:56:34.2079352Z id          : 8c972578-fe72-4aa5-ae51-cc5575fef2ea
2022-12-19T11:56:34.2079854Z publisher   : Microsoft
2022-12-19T11:56:34.2080336Z displayName : Send To Email Printer
2022-12-19T11:56:34.2080899Z version     : 21.2
2022-12-19T11:56:34.2081166Z 
2022-12-19T11:56:34.2081649Z packageId   : 35d8f0e5-16ab-4d39-b282-f83ba7b77a15
2022-12-19T11:56:34.2082193Z id          : ec255f57-31d0-4ca2-b751-f2fa7c745abb
2022-12-19T11:56:34.2082697Z publisher   : Microsoft
2022-12-19T11:56:34.2083171Z displayName : Shopify Connector
2022-12-19T11:56:34.2083621Z version     : 21.2
2022-12-19T11:56:34.2083904Z 
2022-12-19T11:56:34.2084373Z packageId   : f9e0f03e-5f94-4a32-b894-b28a692a62cd
2022-12-19T11:56:34.2084935Z id          : 79b1a79a-2f66-4736-bc1b-8abb3537eb51
2022-12-19T11:56:34.2085436Z publisher   : Microsoft
2022-12-19T11:56:34.2085946Z displayName : Simplified Bank Statement Import
2022-12-19T11:56:34.2086426Z version     : 21.2
2022-12-19T11:56:34.2086712Z 
2022-12-19T11:56:34.2087067Z packageId   : e2c77863-2d84-4c9b-86a5-330a5d8e3db5
2022-12-19T11:56:34.2087476Z id          : 63ca2fa4-4f03-4f2b-a480-172fef340d3f
2022-12-19T11:56:34.2087826Z publisher   : Microsoft
2022-12-19T11:56:34.2088159Z displayName : System Application
2022-12-19T11:56:34.2088456Z version     : 21.2
2022-12-19T11:56:34.2088600Z 
2022-12-19T11:56:34.2088909Z packageId   : 6366fc6c-0705-4b46-b40b-ac6288a909ab
2022-12-19T11:56:34.2089313Z id          : 7961e9dc-a8e5-49b1-839b-3a78803a4cb8
2022-12-19T11:56:34.2089663Z publisher   : Microsoft
2022-12-19T11:56:34.2090013Z displayName : Troubleshoot FA Ledger Entries
2022-12-19T11:56:34.2090670Z version     : 21.2
2022-12-19T11:56:34.2090806Z 
2022-12-19T11:56:34.2091131Z packageId   : fc09886a-43ff-4ecf-98db-aa920b6dcf1b
2022-12-19T11:56:34.2091535Z id          : 2654d7e7-9afd-4947-9e02-6bb8f3e0cd04
2022-12-19T11:56:34.2091867Z publisher   : Microsoft
2022-12-19T11:56:34.2092208Z displayName : Universal Print Integration
2022-12-19T11:56:34.2093288Z version     : 21.2
2022-12-19T11:56:34.2093478Z 
2022-12-19T11:56:34.2093809Z packageId   : 01e51bb1-7207-4730-9436-e3b57441e1bf
2022-12-19T11:56:34.2094330Z id          : c50a4bf0-db51-4ad2-88d5-fe2287da0eb8
2022-12-19T11:56:34.2094719Z publisher   : Microsoft
2022-12-19T11:56:34.2095086Z displayName : VAT Group Management
2022-12-19T11:56:34.2095441Z version     : 21.2
2022-12-19T11:56:34.2095610Z 
2022-12-19T11:56:34.2095938Z packageId   : 21e81ae5-14fa-431d-8341-90c673a6fd2f
2022-12-19T11:56:34.2096388Z id          : bae453ed-0fd8-4416-afdc-4b09db6c12c3
2022-12-19T11:56:34.2096759Z publisher   : Microsoft
2022-12-19T11:56:34.2097143Z displayName : WorldPay Payments Standard
2022-12-19T11:56:34.2097508Z version     : 21.2
2022-12-19T11:56:34.2097677Z 
2022-12-19T11:56:34.2097788Z 
2022-12-19T11:56:34.2097892Z 
2022-12-19T11:56:34.2097976Z 
2022-12-19T11:56:34.2098322Z *** Published Extensions (not installed):
2022-12-19T11:56:34.2098543Z 
2022-12-19T11:56:34.2130870Z *** Import NAV/BC Management DLL's
2022-12-19T11:56:34.2196426Z *** ServiceTier not specified, loading default assemblies.
2022-12-19T11:56:34.2274094Z *** Default Assemblies not found. Load via BC-Artifacts
2022-12-19T11:56:34.2317501Z *** Install/Update BCContainerHelper [https://github.com/microsoft/navcontainerhelper]
2022-12-19T11:56:34.2352323Z *** Check BcContainerHelper
2022-12-19T11:56:34.4044972Z *** Load BcContainerHelper
2022-12-19T11:56:34.4729505Z BcContainerHelper version 4.0.7
2022-12-19T11:56:34.6104052Z BcContainerHelper emits usage statistics telemetry to Microsoft
2022-12-19T11:56:36.6556116Z 
2022-12-19T11:56:36.6556820Z ModuleType Version    Name                                ExportedCommands                                             
2022-12-19T11:56:36.6557257Z ---------- -------    ----                                ----------------                                             
2022-12-19T11:56:36.6557829Z Script     4.0.7      BcContainerHelper                   {Add-FontsToBcContainer, Add-GitToAlProjectFolder, Backup-...
2022-12-19T11:56:36.6558147Z 
2022-12-19T11:56:36.6558238Z 
2022-12-19T11:56:36.6558326Z 
2022-12-19T11:56:36.6562770Z 
2022-12-19T11:56:36.6592738Z ##[command]"Get-BCArtifactUrl" 
2022-12-19T11:56:36.6593148Z Name                           Value                                                                                   
2022-12-19T11:56:36.6593594Z ----                           -----                                                                                   
2022-12-19T11:56:36.6593963Z select                         Latest                                                                                  
2022-12-19T11:56:36.6594310Z type                           OnPrem                                                                                  
2022-12-19T11:56:36.6594672Z country                        W1                                                                                      
2022-12-19T11:56:36.6594927Z 
2022-12-19T11:56:36.6595018Z 
2022-12-19T11:56:36.6595305Z  -select: Latest -type: OnPrem -country: W1
2022-12-19T11:56:40.2859111Z *** Platform: C:\bcartifacts.cache\onprem\21.2.49946.49990\platform
2022-12-19T11:56:40.2883729Z *** Localisation: C:\bcartifacts.cache\onprem\21.2.49946.49990\w1
2022-12-19T11:56:40.3100612Z *** BC Management DLL: C:\bcartifacts.cache\onprem\21.2.49946.49990\platform\ServiceTier\program files\Microsoft Dynamics NAV\210\Service\Microsoft.Dynamics.Nav.Management.dll
2022-12-19T11:56:40.3475968Z *** BC App Management DLL: C:\bcartifacts.cache\onprem\21.2.49946.49990\platform\ServiceTier\program files\Microsoft Dynamics NAV\210\Service\Microsoft.Dynamics.Nav.Apps.Management.dll
2022-12-19T11:56:40.3704469Z *** BC NCL Management DLL: C:\bcartifacts.cache\onprem\21.2.49946.49990\platform\ServiceTier\program files\Microsoft Dynamics NAV\210\Service\Microsoft.Dynamics.Nav.Ncl.dll
2022-12-19T11:56:40.6736947Z *** BC Types DLL: C:\bcartifacts.cache\onprem\21.2.49946.49990\platform\ServiceTier\program files\Microsoft Dynamics NAV\210\Service\Microsoft.Dynamics.Nav.Types.dll
2022-12-19T11:56:40.6743619Z *** Batch Publish Extensions
2022-12-19T11:56:40.6750018Z   * Artifact Path  : C:\ADO_agents\agent1\_work\r28\a
2022-12-19T11:56:40.6972814Z *** Resolved Path  : C:\ADO_agents\agent1\_work\r28\a
2022-12-19T11:56:40.6980848Z *** Get Available Applications from [C:\ADO_agents\agent1\_work\r28\a].
2022-12-19T11:56:40.7050482Z *** Get [*.app] files recursive from [C:\ADO_agents\agent1\_work\r28\a]
2022-12-19T11:56:40.7068446Z *** Found [2] files.
2022-12-19T11:56:40.7077682Z *** Extract App detail from [C:\ADO_agents\agent1\_work\r28\a\_DYSELBC-W1-ACC\ELC25\Dysel_DYSEL_21.2.20221219.811_APP.app]
2022-12-19T11:56:40.8579583Z *** Extract App detail from [C:\ADO_agents\agent1\_work\r28\a\_DYSELBC-W1-ACC\Technical\.alpackages\Dysel_DYSEL System Application_21.2.20221219.810_APP.app]
2022-12-19T11:56:40.8611063Z *** Remove duplicate Apps
2022-12-19T11:56:40.8839553Z *** Installing Applications:
2022-12-19T11:56:40.8852056Z 
2022-12-19T11:56:40.8852600Z Publisher Name                     Path                                                                                
2022-12-19T11:56:40.8853165Z --------- ----                     ----                                                                                
2022-12-19T11:56:40.8853711Z Dysel     DYSEL System Application C:\ADO_agents\agent1\_work\r28\a\_DYSELBC-W1-ACC\Technical\.alpackages\Dysel_DYSE...
2022-12-19T11:56:40.8854341Z Dysel     DYSEL                    C:\ADO_agents\agent1\_work\r28\a\_DYSELBC-W1-ACC\ELC25\Dysel_DYSEL_21.2.20221219....
2022-12-19T11:56:40.8854626Z 
2022-12-19T11:56:40.8854720Z 
2022-12-19T11:56:40.8854839Z 
2022-12-19T11:56:40.8877670Z *** Publish App [C:\ADO_agents\agent1\_work\r28\a\_DYSELBC-W1-ACC\Technical\.alpackages\Dysel_DYSEL System Application_21.2.20221219.810_APP.app]
2022-12-19T11:56:40.9022087Z *** Upload extension [C:\ADO_agents\agent1\_work\r28\a\_DYSELBC-W1-ACC\Technical\.alpackages\Dysel_DYSEL System Application_21.2.20221219.810_APP.app]
2022-12-19T11:56:40.9032009Z *** Get App Info
2022-12-19T11:56:40.9083912Z  * App.PackageID = 561bfd14-26fb-4a3a-9ba2-c811c1262b4f
2022-12-19T11:56:40.9108308Z  * App.ID        = c4838e55-cada-4d22-a128-c60103a4092a
2022-12-19T11:56:40.9114450Z  * App.Name      = DYSEL System Application
2022-12-19T11:56:40.9120352Z  * App.Publisher = Dysel
2022-12-19T11:56:40.9126420Z  * App.Version   = 21.2.20221219.810
2022-12-19T11:56:40.9183046Z *** Get Extension status
2022-12-19T11:56:40.9193640Z ##[command]Invoke-RestMethod -Method Get -Uri 'https://api.businesscentral.dynamics.com/v2.0/***/dyselnl-acceptance/api/microsoft/automation/v1.0/companies(3cece12d-337d-ed11-9989-6045bd9248ba)/extensions'
2022-12-19T11:56:41.2864288Z ##[command]Invoke-RestMethod -Method Patch -Uri 'https://api.businesscentral.dynamics.com/v2.0/***/dyselnl-acceptance/api/microsoft/automation/v1.0/companies(3cece12d-337d-ed11-9989-6045bd9248ba)/extensionUpload(0)/content'
2022-12-19T11:56:44.7104629Z 
2022-12-19T11:56:44.7113626Z *** Poll Deployment status
2022-12-19T11:56:44.7177188Z ##[command]Invoke-RestMethod -Method Get -Uri 'https://api.businesscentral.dynamics.com/v2.0/***/dyselnl-acceptance/api/microsoft/automation/v1.0/companies(3cece12d-337d-ed11-9989-6045bd9248ba)/extensionDeploymentStatus'
2022-12-19T11:57:15.0525922Z ##[command]Invoke-RestMethod -Method Get -Uri 'https://api.businesscentral.dynamics.com/v2.0/***/dyselnl-acceptance/api/microsoft/automation/v1.0/companies(3cece12d-337d-ed11-9989-6045bd9248ba)/extensionDeploymentStatus'
2022-12-19T11:57:45.1668176Z ##[command]Invoke-RestMethod -Method Get -Uri 'https://api.businesscentral.dynamics.com/v2.0/***/dyselnl-acceptance/api/microsoft/automation/v1.0/companies(3cece12d-337d-ed11-9989-6045bd9248ba)/extensionDeploymentStatus'
2022-12-19T11:58:15.2976206Z ##[command]Invoke-RestMethod -Method Get -Uri 'https://api.businesscentral.dynamics.com/v2.0/***/dyselnl-acceptance/api/microsoft/automation/v1.0/companies(3cece12d-337d-ed11-9989-6045bd9248ba)/extensionDeploymentStatus'
2022-12-19T11:58:15.3679961Z *** Deployment Status:
2022-12-19T11:58:15.3683562Z 
2022-12-19T11:58:15.3685193Z 
2022-12-19T11:58:15.3688187Z operationID : 0cde328c-8ce1-4569-91f4-a447cbcb6a04
2022-12-19T11:58:15.3688620Z name        : DYSEL System Application
2022-12-19T11:58:15.3689102Z publisher   : Dysel
2022-12-19T11:58:15.3689930Z appVersion  : 21.2.20221219.810
2022-12-19T11:58:15.3690852Z status      : Failed
2022-12-19T11:58:15.3691299Z startedOn   : 2022-12-19T11:56:44.637Z
2022-12-19T11:58:15.3691508Z 
2022-12-19T11:58:15.3691884Z 
2022-12-19T11:58:15.3692831Z 
2022-12-19T11:58:15.3730193Z ##[error]App publish failed. Check the 'Extension Deployment Status' page in the Business Central client.
2022-12-19T11:58:15.3740605Z ##[error]App publish failed, aborting batch
2022-12-19T11:58:15.3801233Z *** Cleanup VSTS Environment: True
2022-12-19T11:58:17.6856689Z ##[section]Finishing: ALOps Extension API

Expected behavior I had expected (and by now desperately hoped) that the deployment would publish and install the apps.

Screenshots image

Additional context I do not know if this is relevant, but the Get-BCArtifactUrl is set to use OnPrem, while we are publishing to the cloud. In the build pipelines, we use the cloud artifacts (and the build obviously succeeded)

2022-12-19T11:56:36.6592738Z ##[command]"Get-BCArtifactUrl" 2022-12-19T11:56:36.6593148Z Name Value
2022-12-19T11:56:36.6593594Z ---- -----
2022-12-19T11:56:36.6593963Z select Latest
2022-12-19T11:56:36.6594310Z type OnPrem
2022-12-19T11:56:36.6594672Z country W1
2022-12-19T11:56:36.6594927Z 2022-12-19T11:56:36.6595018Z 2022-12-19T11:56:36.6595305Z -select: Latest -type: OnPrem -country: W1

waldo1001 commented 1 year ago

Hi,

If you publish with VSCode, it's going to be published in a different scope as if you would publish with the API or with the page in BC.

Since it seems you try to install an app in the APpSource number range, a dev-port deploy is the only thing you can do. For that, we have the "dev endpoint" setting. You are using the "api endpoint", which will trigger a normal deploy - which will never work with your numberrange.

So - empty the api_endpoint. And fill the dev_endpoing with "https://api.businesscentral.dynamics.com/v2.0/YourEnvironmentName/"

Please let me know if that works or not!

PeterConijn commented 1 year ago

Hi!

Thanks for the tip! You can't clear the API Endpoint, since that is a required field in ALOps, but ALOps is clever enough to overrule it with the Dev Endpoint when that last one is filled.

That will solve our immediate issues, but it brings the question to mind how one would install a PTE on a customer's Production using the ISV licensed object ID range(s); but that is a question for future Peter.

waldo1001 commented 1 year ago

You can't 🤷‍♂️. The only way to install an ISV License object to production, is AppSource (afaik).