<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kartik Kanakasabesan</title>
    <description>The latest articles on DEV Community by Kartik Kanakasabesan (@kkanakas).</description>
    <link>https://dev.to/kkanakas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1031172%2F199faaf1-8f89-4517-a3d4-53cb72f1c8ff.jpeg</url>
      <title>DEV Community: Kartik Kanakasabesan</title>
      <link>https://dev.to/kkanakas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kkanakas"/>
    <language>en</language>
    <item>
      <title>Releasing the February Update for the Power Platform CLI</title>
      <dc:creator>Kartik Kanakasabesan</dc:creator>
      <pubDate>Fri, 17 Mar 2023 20:30:44 +0000</pubDate>
      <link>https://dev.to/kkanakas/releasing-the-february-update-for-the-power-platform-cli-40gn</link>
      <guid>https://dev.to/kkanakas/releasing-the-february-update-for-the-power-platform-cli-40gn</guid>
      <description>&lt;p&gt;We are happy to finally release our February update for the Power Platform CLI. For those of you who are new, our pattern has been that we release an update for the work done in the last month, in the current month. Usually, we each include some new capabilities, along with the usual fixes that we hear from you folks along the way.&lt;/p&gt;

&lt;p&gt;Firstly, we have a new icon for the Power Platform CLI and the Power Platform Developers tools in general, and it looks like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuznuxwxunlofpvjzmzo6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuznuxwxunlofpvjzmzo6.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A lot of you folks had asked for something more meaningful to represent the developer tooling capabilities of power platform. Well, we finally delivered, and we are happy for it.  Thank you all for your support. You will start seeing the icon updates happen shortly in all the relevant web tooling properties like the Visual Studio Code activity panel, Azure DevOps, Visual Studio Marketplace etc. just to name a few.&lt;/p&gt;

&lt;h4&gt;
  
  
  Less Noisy solution.xml
&lt;/h4&gt;

&lt;p&gt;Now let us get into the meat of things. We did not put a blog out in January, but one of the features that we included, and we did not  talk about was that solution.xml is less noisy when diffing in source control repositories.  Here is an example of the same solution files unpacked with an older version versus the new version of Power platform CLI. The new output is on the left-hand side of the picture below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv59zr1uqaxos5du9x2sd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv59zr1uqaxos5du9x2sd.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  New command!!  In preview: the Fetch command
&lt;/h4&gt;

&lt;p&gt;We knew a lot of folks in the community used the fetchxml capability to query dataverse, and our team's internal build had a similar command that is used by our development team everyday. We have decided to make this command available in preview capacity for you all to use in the innerloop context. For those you who may not be aware of the fetch capability. Developers building applications for  Power Platform usually need to query the dataverse instance to get various properties of the Dataverse entities in question. We now have the ability to do the same thing in the Power Platform CLI. &lt;strong&gt;When using the -x parameter remember to have all the XML nodes in a single line and not multiple lines or you can use the -xf and read it from the XML file&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkebxusi6cnd0t0h7vozo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkebxusi6cnd0t0h7vozo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  New command!! pac admin status
&lt;/h4&gt;

&lt;p&gt;When using the Admin commands, which operate in async mode, most of you had asked us, " how do I really know if the async job request is done?". Now we have a command that shows you the status of the async job  with pac admin status &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcf30i23cpw5cae3ka4zb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcf30i23cpw5cae3ka4zb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More details of the all the features are captured in the release notes at this &lt;a href="https://www.nuget.org/packages/Microsoft.PowerApps.CLI/" rel="noopener noreferrer"&gt;link&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Please try out these capabilities and give us feedback at the following location &lt;a href="mailto:ISVFeedback@Microsoft.com"&gt;ISVFeedback@Microsoft.com&lt;/a&gt; or The PowerUsers community. Raise the issue and bugs at the following location in GitHub &lt;a href="https://aka.ms/powerplatform-vscode" rel="noopener noreferrer"&gt;https://aka.ms/powerplatform-vscode&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>powerfuldevs</category>
      <category>azure</category>
      <category>powerplatform</category>
      <category>developers</category>
    </item>
    <item>
      <title>New GitHub Sample Workflows for Power Platform</title>
      <dc:creator>Kartik Kanakasabesan</dc:creator>
      <pubDate>Sat, 11 Mar 2023 00:30:15 +0000</pubDate>
      <link>https://dev.to/powerplatform/new-github-sample-workflows-for-power-platform-81m</link>
      <guid>https://dev.to/powerplatform/new-github-sample-workflows-for-power-platform-81m</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2qy8vkxq6n6t6djkpze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2qy8vkxq6n6t6djkpze.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait there are GitHub actions for Power Platform?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/microsoft/powerplatform-actions" rel="noopener noreferrer"&gt;Power Platform Build Tools &lt;/a&gt;as they are officially called, have been available for GitHub for over a year. So, yes, the answer is yes. We have Power Platform GitHub actions documentation available at this &lt;a href="https://learn.microsoft.com/en-us/power-platform/alm/devops-github-actions" rel="noopener noreferrer"&gt;location &lt;/a&gt;. In addition to the documentation, we also have hands on lab content available &lt;a href="https://github.com/microsoft/powerplatform-actions-lab" rel="noopener noreferrer"&gt;here&lt;/a&gt; for the users to go try out. One of the folders in the Power Platform Hands on lab is the samples folder. This is the location where our team posts sample workflows (as the name suggests) on actions that can be done with Power Platform and GitHub. &lt;/p&gt;

&lt;h3&gt;
  
  
  What are the new workflows that we have added?
&lt;/h3&gt;

&lt;p&gt;A lot of you wanted to see the kind of flexibility of the tasks offered for Power Platform in GitHub actions. The purpose of this post is to show you just that. &lt;/p&gt;

&lt;h3&gt;
  
  
  Username and Password or Service Principal?
&lt;/h3&gt;

&lt;p&gt;That is the first question a lot of folks ask. In the samples folder you will see that there are examples of both. I am biased towards service principals, and I am not ashamed to say it. Username and Password are a viable choice, but make sure that such accounts are not impacted by MFA policies. Considering that runners (if you are using cloud-based pools) are dynamically allocated, MFA will cause issues for your GitHub workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are the new samples?
&lt;/h3&gt;

&lt;p&gt;The sample workflows are as follows: &lt;br&gt;
1) &lt;a href="https://github.com/microsoft/powerplatform-actions-lab/blob/main/sample-workflows/create-envs.yml" rel="noopener noreferrer"&gt;Create environments&lt;/a&gt;&lt;br&gt;
2) &lt;a href="https://github.com/microsoft/powerplatform-actions-lab/blob/main/sample-workflows/exportandunpack.yml" rel="noopener noreferrer"&gt;Export, Unpack and Commit&lt;/a&gt; &lt;br&gt;
3) &lt;a href="https://github.com/microsoft/powerplatform-actions-lab/blob/main/sample-workflows/delete-environments.yml" rel="noopener noreferrer"&gt;Delete environments&lt;/a&gt;&lt;br&gt;
4) &lt;a href="https://github.com/microsoft/powerplatform-actions-lab/blob/main/sample-workflows/deploy-managed-application.yml" rel="noopener noreferrer"&gt;Deploy Managed Application&lt;/a&gt;&lt;br&gt;
5) &lt;a href="https://github.com/microsoft/powerplatform-actions-lab/blob/main/sample-workflows/deploy-unmanaged-application.yml" rel="noopener noreferrer"&gt;Deploy Unmanaged Application&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;These new workflows as their name states do things within the Power Platform, let us start with the first one&lt;/p&gt;

&lt;h4&gt;
  
  
  Create environment
&lt;/h4&gt;

&lt;p&gt;All the workflows use workflow_dispatch calls which means they are manually activated. If you would like to know what are the other types of dispatch mechanism. I would recommend reading up on the event triggers on the &lt;a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows" rel="noopener noreferrer"&gt;GitHub website&lt;/a&gt;. Create environment takes a few variables as user input or when invoked remotely via Power Automate (that is a different blog) and then proceed to create a developer environment for Dev, a Sandbox environment for Test, and a Production environment for Production. This particular workflow assumes that you are going to create 3 environments, the assumption here is that Production and Testing environments maybe long lived environments but you developer environments are ephemeral, as in you will be deleting them once you are done. What you say? Deleting developer environments?  Yes, if you are persisting your solutions into source control like GitHub, then you can always reconstitute the developer environment from source code. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;- name: Create Developer Environment&lt;br&gt;
      uses: microsoft/powerplatform-actions/create-environment@v0&lt;br&gt;
      with:&lt;br&gt;
        app-id: ${{secrets.CLIENT_ID}}&lt;br&gt;
        client-secret: ${{ secrets.PowerPlatformSPN }}&lt;br&gt;
        tenant-id: ${{secrets.TENANT_ID}}&lt;br&gt;
        name: ${{ github.event.inputs.env_name}}_Dev&lt;br&gt;
        type: Developer&lt;br&gt;
        domain: ${{ github.event.inputs.env_name}}Dev&lt;/code&gt;&lt;br&gt;
In this case, based on the variables used you can see we are creating the Developer environment and using service principals to do so. Now remember when creating an environment with a service principal, by default the service principal owns it. The next task is user assignment in this case I am adding another user to the environment with similar privileges as the service principal. You can absolutely change those if you like.&lt;br&gt;
&lt;code&gt;- name: assign-user to developer environment&lt;br&gt;
      uses:  microsoft/powerplatform-actions/assign-user@v0&lt;br&gt;
      with:&lt;br&gt;
        app-id: ${{secrets.CLIENT_ID}}&lt;br&gt;
        client-secret: ${{ secrets.PowerPlatformSPN }}&lt;br&gt;
        tenant-id: ${{secrets.TENANT_ID}}&lt;br&gt;
        environment: 'https://${{ github.event.inputs.env_name}}Dev.dynamics.com'&lt;br&gt;
        user:${{ github.event.inputs.user_id }}&lt;br&gt;
        role: System Administrator&lt;/code&gt;&lt;br&gt;
But in your case, you can add any other role here. You can also add another service principal account as well using &lt;br&gt;
&lt;code&gt;application-user&lt;/code&gt; parameter.&lt;/p&gt;

&lt;h4&gt;
  
  
  Export Unpack and Commit
&lt;/h4&gt;

&lt;p&gt;In this workflow we export a given solution as unmanaged, unpack it, then export the managed version of the solution, and then commit them to the GitHub repository. &lt;/p&gt;

&lt;p&gt;About committing managed solution into the source code repository. I am wading into philosophical waters here! Checking in a managed solution to me is like checking in a dll into source code.So, if you have the source code, why check in the dll as well, you can always reconstitute it, right! BTW, if you have no idea what I am talking about for &lt;a href="https://learn.microsoft.com/en-us/power-platform/alm/solution-concepts-alm" rel="noopener noreferrer"&gt;managed and unmanaged solutions&lt;/a&gt;, the power platform ALM page is a wonderful place to get acquainted with the concepts.  I come from a world where you only check-in the unmanaged contents, put it in a build server and then export from the build server as managed, which makes it immutable and ready for deployment into Test and/or Production. &lt;br&gt;
There is another school of thought, that states that you export both the unmanaged and managed versions of the solution and if all well with the application then just proceed to deploy the managed version into Test and/or Production. The good thing is we support both.&lt;/p&gt;

&lt;p&gt;Now, you can unpack managed solutions to and check them in. If you are going to do that make sure the unpack in a different location. the Sample workflow only unpacks the unmanaged solution. Your process maybe different.&lt;/p&gt;

&lt;h4&gt;
  
  
  Delete environments
&lt;/h4&gt;

&lt;p&gt;This is a simple one where we just delete the Development, Test, and Production environments. When deleting environment remember if there is data in the environment (as in inside dataverse) they would get lost as well. You can use the data migration tool (in a different blog) to export the data and check that into source code as well.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;- name: Delete Dev Environment&lt;br&gt;
      uses: microsoft/powerplatform-actions/delete-environment@v0&lt;br&gt;
      with:&lt;br&gt;
        app-id: ${{secrets.CLIENT_ID}}&lt;br&gt;
        client-secret: ${{ secrets.PowerPlatformSPN }}&lt;br&gt;
        tenant-id: ${{secrets.TENANT_ID}}&lt;br&gt;
        environment-url: ${{ inputs.dev_env }}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Deploying applications
&lt;/h4&gt;

&lt;p&gt;Here we have 2 workflows, in the case of the managed solution, you can see that we only deploy the solution.zip and it pretty straight forward. &lt;br&gt;
&lt;code&gt;- name: Import solution as unmanaged to build env&lt;br&gt;
        uses: microsoft/powerplatform-actions/import-solution@v0&lt;br&gt;
        with:&lt;br&gt;
          environment-url: ${{github.event.inputs.environment_url}}&lt;br&gt;
          app-id: ${{secrets.CLIENT_ID}}&lt;br&gt;
          client-secret: ${{ secrets.PowerPlatformSPN }}&lt;br&gt;
          tenant-id: ${{secrets.TENANT_ID}}&lt;br&gt;
          solution-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}_managed.zip&lt;br&gt;
          force-overwrite: true&lt;br&gt;
          publish-changes: true&lt;/code&gt;&lt;br&gt;
All it does is that takes the managed zip file and imports it to the target environment.  &lt;/p&gt;

&lt;p&gt;Now in the case of the unmanaged solution, there is an extra task that needs to be done. This is called packing the solution, as in reconstituting the solution.zip file. So that it is ready to import. &lt;br&gt;
&lt;code&gt;- name: Pack the solution&lt;br&gt;
        uses: microsoft/powerplatform-actions/pack-solution@v0&lt;br&gt;
        with:&lt;br&gt;
          solution-folder: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}&lt;br&gt;
          solution-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}.zip&lt;br&gt;
          solution-type: Unmanaged&lt;/code&gt;&lt;br&gt;
&lt;code&gt;- name: Import solution as unmanaged to build env&lt;br&gt;
        uses: microsoft/powerplatform-actions/import-solution@v0&lt;br&gt;
        with:&lt;br&gt;
          environment-url: ${{github.event.inputs.environment_url}}&lt;br&gt;
          app-id: ${{secrets.CLIENT_ID}}&lt;br&gt;
          client-secret: ${{ secrets.PowerPlatformSPN }}&lt;br&gt;
          tenant-id: ${{secrets.TENANT_ID}}&lt;br&gt;
          solution-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}.zip&lt;br&gt;
          force-overwrite: true&lt;br&gt;
          publish-changes: true&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now also realize, when are you importing an unmanaged solution into a target environment, unmanaged means that it can change (as in edit the application), so if you do make changes to the application in the QA environment then make sure export the unmanaged changes to the source repository before exporting the managed solution. Now , importing unmanaged solutions into any environment other than development makes me uneasy, as the best practice is to have unmanaged solutions in your developer environment, and only managed solutions in QA and Production. Some of the patterns you can think of are &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dev (Exports Unmanaged) -&amp;gt; (Imports UnManaged) Build-&amp;gt; Build (Exports Managed) -&amp;gt; (Imports Managed) QA (Exports Managed) -&amp;gt; (Imports Managed) Prod&lt;/li&gt;
&lt;li&gt;Dev (Exports Unmanaged + Managed) -&amp;gt; (Imports Managed) QA (Exports Managed) -&amp;gt; (Imports Managed) Prod &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are plenty of other patterns that you can explore these are just some of them&lt;/p&gt;

&lt;p&gt;There plenty of other sample workflows in the repository, I am also thinking about creating a repository for the community to share their workflows as well. If this an idea you all like. Please do let me know. &lt;/p&gt;

&lt;p&gt;Looking forward to hearing from you all and exploring what other patterns that you have implemented.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>devops</category>
      <category>frontend</category>
      <category>powerfuldevs</category>
    </item>
  </channel>
</rss>
