CI/CD Pipeline using YAML file
This is blog is intended to share information about creating a CI / CD Pipeline using YAML file. Case Study Create a CI/CD pipeline using YAML for a web application So, let’s start with lets creating a project Use cmd to create a project and then bind it to a solution Create Solution dotnet new sln -o Test_CI_CDPipeline Then change the directory cd Test_CI_CDPipeline Then create a Web Project inside Test_CI_CDPipeline dotnet new mvc -n Test_CI_CDPipeline Now bind the project to solution dotnet sln HelloWorldApp.sln add HelloWorldApp.Web\HelloWorldApp.Web.csproj Need to restore all the dependencies dotnet restore Now, build the solution. Do not restore dependencies while we are building the solution. dotnet build –no-restore –configuration release Publish the solution dotnet publish –no-build –configuration release. Now a project is created, built, and published on local Machine. The aim is to achieve the same using a continuous integration pipeline. For this one need to have an Azure DevOps account. In that, create an organization (if not created already) and then create a project. You can either create a private project or a public project. Before that, one needs to initialize git in the location machine. Go to the working folder (location of the location file). Initiate the git git init The purpose of git is to host the source code. Ensure that binaries created while building a project should not be included. For this add gitignore file to the project. Now, you need to stage all the content git add . Commit the content git commit -m “—Name-it—” Now you can push this to the Azure DevOps repo. Copy and paste the command and everything from the local machine will be pushed to Azure Repo. Create Pipeline Go to Pipelines on the Left panel and click on Create Pipeline. It gives two options YAML or Classic editor. Select Azure Repos Git (YAML) as it will be used to push the local project in further steps Select the project created earlier Select the type of project you are creating After this, you will see a YAML file. Here one needs to edit the file and make changes as per the need. Below is a sample code Trigger: specifies which branches cause a continuous integration build to run Pool: specifies which pool to use for a job of the pipeline. A pool specification also holds information about the job’s strategy for running. Steps: specifies a list of tasks that need to be run Task: specifies commands/tasks that need to perform to achieve a build file. Build the project first Publish the Project Publish it as an Artifact Click save and run. Below shows the artifact created Now, this artifact needs to be consumed by an Azure website. For this, one needs to create a web application. Create an app service for that in the Azure portal. We need to create a service connection to connect Azure resource. Go to Project Setting, then service connections Create a New connection and select Azure Resource Manager Choose Automated (here you need to login with the same credentials that you use for the Azure portal) and click next Choose the subscription and Resource group. Give a name to the connection Now, proceed with creating a release pipeline Select the template you want to use and then apply. Choose the artifact from where you want the files to be picked up and click add Click on Job to a stage Add your Azure subscription, select the app service you have created, and save it. Then click on Create release Click on Deploy Once you are done deploying, click on the URL from the App service
Share Story :
Make form read-only using JavaScript
One way to lock down a form is through JavaScript. Let’s go through how to do this by looking at the code. var formCustomizations = { disableForm: function (executionContext) { let formContext = executionContext.getFormContext(); let formControls = formContext.ui.controls; formControls.forEach(element => { if (element.getName() != “” && element.getName() != null) { element.setDisabled(true); } }); } } Here when the JavaScript Function Is called and the execution parameter is passed, the user can see the desired output. formContext.ui.controls; Provides the properties and methods to retrieve information about the user interface (UI) controls for several sub-components of the form. formControls.forEach(element => { if (element.getName() != “” && element.getName() != null) { element.setDisabled(true);} Here the forEach loop will traverse and see if there are any fields that are not blank and the field value is not null, then set all that fields to read only on that form. Hope this helps!
Share Story :
Cancel the running flows with JavaScript code
We will look at how we can use JavaScript to cancel flows that are running without canceling each flow manually. To do this, follow the steps below. Let’s look at a scenario where we are seeing the flows that are in a running state and are not terminating. Click on All runs, this navigates you to all flow runs view. When we are in the All runs view, we need to open the developer console in the browser. The developer console can be opened by clicking F12 (or holding fn and F12) on Windows. Or by right-clicking on the screen and clicking Inspect. In the developer console, navigate to the Console pane. To clear the console window, click CTRL + L. The console pane is where we will add the JavaScript code that will cancel the running flows. As can be seen in the next step. // Copy this first and run it in the console var jq = document.createElement(‘script’); jq.src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js”; document.getElementsByTagName(‘head’)[0].appendChild(jq); // … give time for script to load, then type (or see below for non wait option) jQuery.noConflict() //Paste the same again var jq = document.createElement(‘script’); jq.src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js”; document.getElementsByTagName(‘head’)[0].appendChild(jq); // … give time for script to load, then type (or see below for non wait option) jQuery.noConflict() // Then copy this in the console to start the cancelation of the flows. confirm = function () {return true;}; setInterval(function () { $(“.fl-StatusInCell:contains(‘Running’)”).parent().parent().find(‘.ms-DetailsRow-cell’).last().click(); $(‘button[name=”Cancel”]’).click(); },5000); Click the running code after the code is implemented in the console, and the output will be seen below Hope this Helps!
Share Story :
Dynamic visibility of Gallery Items based on previous item data in Canvas PowerApps
Introduction Let’s say you come across a scenario where you want to show dynamic records for your gallery items based on previous record details. For example: Let’s say a basic Q&A where the User should input data and then proceed.So, I have created something similar that will help in developing such a design quickly and efficiently. Steps to implement in Canvas PowerApps Step 1: Create a collection that will store data of the gallery. (You can use Dataverse records here with the unique identifier in the collection.) Note: Collection is better to use if you are referring to the same table. If you use Gallery.AllItems then you will encounter errors and circular reference issues. Set a Blank Vertical Gallery where Items property is as follows: Step 2: Add a Text Input in Gallery that will accept the User’s Input Along with Questions. Conclusion That’s all. You got dynamic content based on previous values. I hope this helps!
Share Story :
Download SSRS report as a PDF with Power Automate – Part 2
In this blog, we will see how to extract the value for PdfDownloadUrl so we can load it into another request and get our PDF.
Share Story :
Download SSRS report as a PDF with Power Automate – Part 1
In this blog, we will see how to retrieve PDF Download URL from the console using the SSRS report. Step 1 – Create a new flow and set the trigger to Manually trigger a flow. Step 2 – After you have your trigger, you need to add two inputs to it, Report Name and Report XML. Step 3 – Then, add a List Rows action from the Dataverse connector and configure it to lookup the report by the Report Name. Step 4 – Setup the report viewer – We do this using the HTTP with Azure AD connector, specifically the Invoke an HTTP request action. Step 5 – We need to authorize our connection to use this action. If you’re using Dynamics 365 online, grab your CRM URL (including https://) and paste it in for both Base Resource URL and Azure AD Resource URL. Method POST Url of the request /CRMReports/rsviewer/reportviewer.aspx Headers Content-Type: application/x-www-form-urlencoded Body of the request id=report&iscustomreport=Custom Report&reportnameonsrs=Name on SRS&CRM_Filter=encodeUriComponent(ReportXML)&reporttypecode=Report Type For encodeUriComponent – Use the following encodeUriComponent(triggerBody()[‘text_1’]) Step 6 – Extract the PdfDownloadUrl from the Report Viewer page. Let’s extract the value for PdfDownloadUrl so we can load it into another request and get our PDF. We’ll do this in 3 parts in Part 2.
Share Story :
How to create a Business Central free trial tenant
Introduction Hi, Readers. Today I would like to talk about How to create a Business Central free trial tenant. References https://www.microsoft.com/en-in/microsoft-365/enterprise/office-365-e3?activetab=pivot:overviewtab Steps: Step 1: Search Office 365 E3 on Google or click on the below link. https://www.microsoft.com/en-in/microsoft-365/enterprise/office-365-e3?activetab=pivot:overviewtab Click on the Free trial Fill in personal details which are required Step 2: In the next screen, enter the domain you want example bclearning.onmicrosoft.com Set a password and click on Next Step 3: Enter Any Registration no. (Ex. Any Unique no.) You have successfully created an Office 365 account. Ensure that you are logged in with this account. Step 4: Now you need to open this link in your browser https://businesscentral.dynamics.com/ Click on Continue. Step 5: You can create multiple users here. If you don’t want it, just select the skip option. Here is your Business Central free trial tenant. Now you can explore Business Central. Hope this help. Thanks for reading.
Share Story :
Creating Sales Order/Sales Quote from POS in LS Central
Introduction LS Central allows us to create a Sales Order or Sales Quote directly from POS. I will be demonstrating the same below in this blog. Pre-requisites LS Central v16+ Business Central OnPrem/OnCloud References Suspend Type, Sales Type (lsretail.com) Configuration Search for “Sales Type” in Business Central Create a new record titled “SALES ORDER” in it. Make sure to set the Suspend Type to Sales Order/Sales Quote as required. I am setting it to Sales Order for this example. Log In to your POS with a POS Super User account and Right click on a button and go to button properties, I’m using the default “SUSPEND” button for example here. Set the command to “SUSPEND” and the parameter to the “Sales Order” record you created a few moments ago. Once this is done, create a new Transaction with a Customer and then click on the button. In the confirmation box, click on Yes. If you check in Business Central now, you can see that a new Sales Order has been created. You can also see the same from POS itself if you click on the “Sales Order” button that we created just now. Conclusion: Thus we saw how to create a Sales Order/Sales Quote directly from POS. Happy Coding!
Share Story :
Working with OData Bound Actions
Introduction OData Bound Actions allows us to perform logic in Business Central by hitting specific end points. We can also pass in parameters and get results in response. It’s very similar to using Azure Functions but is natively built into Business Central at no extra cost! In this example, we’ll be returns the Base64 version of an Image of a Customer, we will also see how to get the Image for any other customer as well. Pre-requisites Business Central OnCloud/OnPrem References WebServiceActionContext Data Type – Business Central | Microsoft Docs Creating and Interacting with an OData V4 Bound Action – Business Central | Microsoft Docs Configuration OData Bound Actions are written on Pages or API – Pages that you are declaring as Web Services. In this example below, I’ve created a simple Customer Page with a few fields and kept the OData key field as the “No.” field. I’ve also defined this as a Web Service in Business Central. To create a OData Bound Action, we create a Global Procedure with the Service Enabled decorator. In this procedure, we have to create a WebServiceActionContext variable and set the “ObjectType”, “ObjectID” and Keys that we are using for this Web Service, which is “No.” in this case, after our processing is done we also need to set the “Result Code” for this request. In the above piece of code, I’ve written simple logic which converts the content of a Media Data Type (Image field) to Base64 Text and returns it. In Post-Man if you check of the metadata, you’ll be able to see this action defined in the metadata. Now, it’s time to test out OData Bound Action! To call the OData Bound Action, we need to be working with a single record. So we specify the “No.” field to identify a single record. Now, we append our procedure name as “NAV.[Procedure Name]” and make a POST request. If we put this Base64 through a Base64 to File Converter, we can see that the original data is recovered. Now, we create a new procedure, which will take the System ID as a parameter and return the Image data for that Customer Record. If you want to pass the parameters to the OData Bound Actions, you have to do it as the Body of the Request. Conclusion: P.S. I’ve tried but it seems polymorphism doesn’t work with this. I hope this was insightful and a quick start on how to write OData Bound Actions. Happy coding!
Share Story :
How to configure Mailbox and set Regarding with in Outlook?
These are the following requirements for enabling D365 for Outlook. License that includes Outlook Email Exchange services Mailbox configured in D365 CRM Steps Below are the steps to approve the mailbox configuration of the Outlook add-in – Go to Advanced Settings -> Email Configuration 2. Select Mailboxes 3. Select the User you want to configure mailbox Note: Global Admin is required for Mailbox Approval. Once done proceed to next step 4. After clicking on OK, click on Test & Enable Mailbox 5. You will see success status as below 6. After the status changes to success, go to Outlook -> File -> Manage Add-ins 7. n Add-Ins for Outlook, search for Dynamics 365 and add it That’s it. Now you have D365 Addon for Outlook enabled. Hope this helps!!