<img src="https://secure.leadforensics.com/133892.png" alt="" style="display:none;">


The challenge

I recently got a requirement from a Microsoft customer engagement (Dynamics 365) client to manage publishing (export/import) of solutions among diffrent environments (from Dev to Test, QA and PROD). The client wanted to restirct use of PowerApps admin center and CRM for solution publishing. The need arised becuase the client was enterprise and CRM was intergral part for their sales and services operations and they needed to track what has been implemented, who implemented, changes and fixes with existing and new solutions. On top if it, they wanted a new application for solution publishing like, with a single click they are able to publish it to other CRM environments. After some discussions they wanted the application to be more interactive and responsive so that they can see the publishing results and be notified, applicaiton can be accesible from anywhere, any device, be able to share securely with other departments in the organization (Office Groups).

The Solution

No question, PowerApps was the way to go for application as per their requirment, but next question was how we going to automate crm solution deployment among crm instances. Well there are others solution available but thanks to Power Platform Build Tools for DevOps which solves our automatic solution deployment with source control. They are also helpful for versioning and deploying PCF controls for future. After quick demo of Build Tools to client we agree on making and defining new Build and release pipelines for CRM Test, QA and PROD instances with funtionality of Continuous deployment trigger (means whenver we have new build aritcraft a release pipeline will trigger and deploy solution except for PROD which needs approval first).

But next challange was how we going to queue the builds for CRM deloyments, here Azure DevOps API comes to rescue us, which come as .Net Client Libraries and  Rest API flavors. Just to save time (demo) I go with .Net client libraries with PAT authentication method but you can read this document for token authentication. PAT is also helpful in restircting access to DevOPs Project. Please note in appsetting.json the CollUrl refers to url of your devops organization (https://dev.azure.com/{yourorganization}).

 But how do we use Azure DevOps API directly into our application that was a challange and what if we want to use this Azure DevOps API in our existing application in way we want, how we can do that. So I decided to wrapp the DevOps API into our own ASP.Net Core 3.1 WebAPI and later expose this as Custom Connector into organiation, so our PowerApp can use it. Why we build our own WebAPI becuase we have some internal operations to perform along with solution deployment for example, notifications in Jira or DevOPs workitems linked to story or parent workitems and attachemnts etc.

Here is the plain source code of WebAPI (controllers for Build Operations and WorkItems).

Please note here, if I just barely need to call pipeline from any application, then that is possible through some webhook like Azure function or Power automate but as I mentioned we want our application to be more interactive and responsive that is why it is exposed as Rest API. Here is simple screenshot of our PowerApps Custom Connector based on our WebAPI controllers.

WebAPI as custom Connector


The Application (PowerApp):

Enough talking, time to show what we have done so far. Here I will just show screen shots of PowerApp with sequence number and WebAPI operation behind. Please note the screen shot contains dummy data just for understanding what happenings.

No alt text provided for this image

Now we have DevOps project and pipelines selected, now it is time to select a solution and deploy it to one or more CRM instances.

No alt text provided for this image

Now next screen will show the status and logs of executing pipeline.Please notethe screen below shows end result but in reality the result will be displayed as long as the pipeline executes. For example the status changes from Queued -> InProgess -> Completed/Failed. I use timer control to fetch status as the pipeline executes. I recommend use of PowerAppsConcurrentfunction if you want stablity in http requests and then loading result in controls in a sequence.

No alt text provided for this image

Here is link for very basic Azure Pipelines for Dynamic365. YAML. Just to give you an idea to start and you can customize according to your needs.

Finally my goal for this post is just to share my experience and sure, there are endless possibilities with DevOps API as you queue any type of pipelines for open source frameworks and technologies (non microsoft) not even from jsut from PowerApp.

Feel free to contact me if you need any informaiton about technology we use so far and feel free to use source code of WebAPI on github. even you can extend it to your needs, there are lot of functions I have not mentioned here.

Happy CRMING and DevOps 😊


Abonner på bloggen!

Diskuter dette innlegget

Tips til lesing

Når du implementerer et CRM-system, er det forskjellige fallgruver du må unngå. Her er noen av de vanligste fallgruvene og hvordan du kan bekjempe dem for å sørge for at virksomheten din får en vellykket CRM-implementering.
Personlig og unik kundeopplevelse er velkjent innen B2C- eller forbrukermarkedet, men også for virksomheter som selger og leverer til andre virksomheter (B2B-markedet) blir det stadig viktigere med unike kundeopplevelser som er basert på datainnsamling og dataanalyse.
Når du har en fullstendig integrert CRM og ERP-løsning, vil hver avdeling i virksomheten finne det svært enkelt å samarbeide med én felles forretningsplattform. Slik kan man sikre at kundebasen er synkronisert og tilgjengelig ved fingertuppene samtidig som at integrerte prosesser fjerner mye dobbeltarbeid.  
ERP- og CRM-systemer har lenge blitt brukt som frittstående verktøy i forretningslandskapet frem til skiftet til skyen. Behovet for å integrere disse to systemene ses nå som en del av forretningsvekst og produktivitet.
right-arrow share search phone phone-filled menu filter envelope envelope-filled close checkmark caret-down arrow-up arrow-right arrow-left arrow-down