AXForum  
Вернуться   AXForum > Microsoft Dynamics NAV > NAV: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 14.07.2020, 21:16   #1  
Blog bot is offline
Blog bot
Участник
 
23,255 / 788 (73) +++++++
Регистрация: 28.10.2006
waldo: Deploying from DevOps the right way (Part 2): Deploying to OnPrem Business Central environments with the automation API
Источник: https://dynamicsuser.net/nav/b/waldo...automation-api
==============

You might have read my previous blogpost on how to enable the “external deployment” in an OnPrem Business Central environment. Well, that post deserved an “extension” as I didn’t provide examples on how to deploy with PowerShell – which you would be able to do within Azure DevOps.

Scenario

The scenario is still the same: you have all these OnPrem customers, where you would like to deploy your apps to. Microsoft is clear: just install a DevOps agent on all those customers. The alternative that I try to give is – well, don’t install the devops agent, but just make “External Deployment” possible by following my steps in my previous post, and use the Automation API, just like you would for Business Central SaaS. Sidenote: this API needs to be accessible from your company. So we make sure that the customer enables our IP in their firewall to be able to access this automation API directly from our location.

PowerShell

Since I don’t use PowerShell in DevOps (suplise, suplise), I created an example-script for you in my repo here: https://github.com/waldo1001/Cloud.R...omationAPI.ps1
Just a few things worth to mention:
  • It’s good to have the app.json and the app-file in the artifacts, to be able to easily get the details about the app being released
  • The publish is just a matter of streaming the file in the request
  • Notice I’m using the “beta” version of the API. I was able to publish the extension with v1.0, but I wasn’t able to get the deployment status – only through the beta-version. Since this is an unsupported way of deployment, I don’t think I can ask Microsoft to help me on this ;-).
  • You would be able to loop the call about the deployment progress, to see if it was successful or not – basically a loop until the status says “completed” or “failed”.
The main part here obviously is the Patch-method to upload the extension. The external deployer you installed will do the rest.. .

ALOps

As said, I don’t use PowerShell anymore, because I’m using ALOps, just because it so much more hassle-free .. and we see that many people are starting to use ALOps as well, also for community purposes. Nice! This means community projects are also getting decent build pipeline in stead of none – and it’s free, so why not ;-).
In ALOps, we created the “ALOps Extension API” step, which you can use to publish an extension through the Automation API OnPrem. The easiest way to do that is by simply introduce one step, and set the “Batch Publish” interaction. Basically it will get all app-files you selected as artifacts, figure out the order to publish for you, and install all artifacts that you have set up in your release-step. Easy peasy. It doesn’t care if it’s in Docker or not .. If the endpoint is available, the external deployer is installed, then your publish will work. Here is the setup in the classic editor which releases 22 apps – one simple step, with only 1 real parameter to fill:

Or in yaml:

steps: - task: hodor.hodor-alops.ALOpsExtensionAPI.ALOpsExtensionAPI@1   displayName: 'Batch Publish'   inputs:     interaction: batch     api_endpoint: 'https://thedestinationbc/bc/api'     authentication: windows


Источник: https://dynamicsuser.net/nav/b/waldo...automation-api
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
stoneridgesoftware: Four Questions to Ask Before Transitioning from NAV to Business Central Blog bot NAV: Blogs 0 21.05.2020 04:49
stoneridgesoftware: Implementing a Credit Limit Approval Process with Workflows in Business Central: Part 2 Blog bot NAV: Blogs 0 02.05.2020 01:17
waldo: 3D print Microsoft Dynamics 365 Business Central Blog bot NAV: Blogs 0 11.01.2019 03:13
alexef: How to add a field to Item Card in Business Central Blog bot NAV: Blogs 0 22.05.2018 20:11
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 13:46.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.