STAEDEAN Business Central Documentation
Library apps update issue.
- Our library apps were prefixed with Exclude. Since our January 2022 release, we have renamed our apps and dropped the Exclude prefix. This results that our apps from Business Central version 19 (Fall 2021) can be updated from both the [Admin Center] as well as the [Admin API]. Updating from 18 to 19 will still have to go via the [Admin API]
- Apps with the prefix Exclude are filtered from the Extension Management page and also the Admin-/Partner- Center Extension page.
- This presented us with an issue that our library apps cannot be updated/maintained by us, our partners or our clients in a normal fashion. Via this path, only 1 update is forced when a major release is installed. Which occurs every 6 months.
These library apps are STAEDEAN-Common and STAEDEAN-BIS We aim to rename these apps so that they will be listed and managed like all other apps: Microsoft has forecasted a feature that would make app renaming possible in a Release for 2021 Wave 1, (version 18.x)
Managing apps using Admin Center
For more details access this link
Managing apps using admin api
Display the installed apps
The first step on this approach would be to see the installed apps in your online environment. For this you could use a powershell script that has two steps in it
- retrieve a bearer token using oAuth, see link for examples https://github.com/microsoft/BCTech/blob/master/samples/AdminCenterApi/PowerShell/Authenticate.ps1
- use the admin api to get a json list of all the installed apps, see below script for an example and more details on this link https://yzhums.com/12259/
$environmentName = "YourEnvironment" #replace with the environment name
$accessToken = "oAuthToken" #replace with the token that you retrieve from Azure
$response = Invoke-WebRequest `
-Method Get `
-Uri "https://api.businesscentral.dynamics.com/admin/v2.6/applications/businesscentral/environments/$environmentName/apps" `
-Headers @{Authorization=("Bearer $accessToken")}
Write-Host (ConvertTo-Json (ConvertFrom-Json $response.Content))
Update STAEDEAN-Common & STAEDEAN-BIS
- for updating the STAEDEAN-Common and STAEDEAN-BIS you need the id's of these apps
- STAEDEAN-Common: "3d24078f-27f6-4e56-b448-15adbb4f9858"
- STAEDEAN-BIS: "9b0fdadc-3c4a-4dc4-82bf-6ac1c4bd5d71"
- You can execute the following script to update the required app
- the latest version can be found at BIS-Releases
$appIdToInstall = "3d24078f-27f6-4e56-b448-15adbb4f9858" #replace with your app id
$appTargetVersion = "App target version"
$accessToken = "oAuthToken" #replace with the token that you retrieve from Azure
$environmentName = "YourEnvironment" #replace with the environment name
try{
$response = Invoke-WebRequest `
-Method Post `
-Uri "https://api.businesscentral.dynamics.com/admin/v2.6/applications/BusinessCentral/environments/$environmentName/apps/$appIdToInstall/update" `
-Body (@{
"AcceptIsvEula" = $true
"targetVersion" = $appTargetVersion
"languageId" = "1033"
"installOrUpdateNeededDependencies" = $true
"useEnvironmentUpdateWindow" = $false
} | ConvertTo-Json) `
-Headers @{Authorization=("Bearer $accessToken")} `
-ContentType "application/json"
}
catch [System.Net.WebException]{
$Exception = $_.Exception
$respStream = $Exception.Response.GetResponseStream()
$reader = New-Object System.IO.StreamReader($respStream)
$respBody = $reader.ReadToEnd() | ConvertFrom-Json | ConvertTo-Json -Depth 100
$reader.Close();
Write-Error $Exception.Message
Write-Error $respBody -ErrorAction Stop
}
For both STAEDEAN-Common and STAEDEAN-BIS you can verifiy it's status by using the following script
$environmentName = "YourEnvironment" #replace with your environment name
$accessToken = "oAuthToken" #replace with the token that you retrieve from Azure
$response= Invoke-WebRequest `
-Method Get `
-Uri "https://api.businesscentral.dynamics.com/admin/v2.6/applications/BusinessCentral/environments/$environmentName/apps/$appIdToInstall/operations" `
-Headers @{Authorization=("Bearer $accessToken")}
Write-Host (ConvertTo-Json (ConvertFrom-Json $response.Content))