Setting up Codex with Power Platform MCP Server

Amongst available AI clients available, Codex is well-known by ChatGPT and here’s how you can use to configure with Power Platform MCP Server.

Install Codex on VS Code

One of the first things to do is to install Codex as an extension in Visual Studio Code –

  1. Look for the below extension and you should see a ChatGPT icon.

  2. Once this is installed, go to Extensions and you can sign in with your GitHub Pro account.

  3. It’ll open up a Sign-in page and you’ll need to enter your credentials.

  4. Make sure you open a Folder in VS Code and also ensure npm is installed by running this command in terminal ‘npm -v‘.


  5. Next, before you configure the TOML file – make sure you are having powerplatform-mcp installed locally and then configure the TOML file for Codex.

Downloading Power Platform MCP locally and connecting to the MCP

Now that Codex is installed and NPM is installed as well. Let’s first download Power Platform MCP first and then connect it to the Power Platform MCP environment –

  1. Let’s check if PowerPlatform-MCP is already installed or not by checking its version number.
    Below, it says that it didn’t find zsh, means powerplatform-mcp is not installed locally.

  2. Because I use a Mac, I can do so using Homebrew. You can check alternatively on doing this using Windows and downloading using Powershell.
    In case you face permission issues on the device, you can just run the below command –
    sudo npm install -g powerplatform-mcp” and you should see the packages getting downloaded successfully.

  3. Now, go ahead and configure the Toml file.

  4. Then, in the TOML file, you can enter the configuration like so –

  5. And when you try to query in Codex, you’ll see the results come through in the form of answers.

Hope this was useful!

Thank you!

Time Entry Calendar in Project Operations

If you have been used to doing Time Entries daily on the classic Time Entry grid and that has been a habit for quite some time, you might not realize that it is slower and inefficient to do, just because you got used to it now.
So, here’s Time Entry calendar view which is better way to visualize and do Time Entries! This is in Preview as of the day of writing this post.

Enable Time Entry Calendar View

Here’s how you can turn on your Time Entry Calendar from Project Operations’ Settings

  1. Navigate to Settings Area in Project Operations Model-Driven app.


  2. Then drop down form Features to find the Time Entry Calendar listed.


  3. Click on it to turn it on. It’ll ask for confirmation, it ask describes what it does.


How Time Entry Calendar works?

Here’s how Time Entry Calendar feature works when you want to do Time Entries.

  1. Now when you navigate to the Time Entries from My Work (or wherever you have put it), you’ll see this new option in My Work called as Time Entry Calendar, while you existing Time Entry section still exists as is.

  2. When it loads, you can see the Time Entries now appear like how allocations appear on your Schedule Board, gives you a better way to visualize Time Entries to be done and and most importantly, select the Time for the Time Entry.
    You can visualize Daily, Weekly and Monthly.


  3. You can even click on the Time you want to make Time Entry on and the window pane will let you drill down to the Task level on the Project which you want to make Time Entry on.

Hope this was useful!

Thank you!

Power Platform Tools for Visual Studio

Here’s how you can quickly deploy and debug Dynamics 365 CRM plugins using Power Platforms Tools in Visual Studio

This is the first post in the series and once complete setting up Power Platform Tools for Visual Studio, I’ll follow up with writing and deploying C# CRM Plugins through Power Platform Tools for Visual Studio!

Let’s setup Power Platform Tools for Visual Studio first!

Getting Power Platform Tools in Visual Studio

Here’s how you can configure Power Platform Tools in Visual Studio from the Marketplace –

  1. In your Visual Studio, under Extensions, click on Manage Extensions.

  2. Then, search for Power Platform Tools and you’ll find on in the top few results itself which you will be able to identify as highlighted below.
    Click to install the “Power Platform Tools for VS 2022

  3. You’ll need to close Visual Studio for the installation to be proceed.

  4. Then, it’ll continue as a VSIX Installer and continue to install this extension for your VS.

  5. And this will be completed in a few moments.

  6. Once done, when you open Visual Studio back again, you’ll find “Connect to Dataverse” under Tools section in Visual Studio

  7. It’ll ask you to authenticate into your Dataverse environment. This doesn’t work with accounts using MFA – so for this demonstration, I turned off MFA temporarily for my trial environment.

  8. Then, I was asked to select the environment within the tenant.

  9. Now, I was asked to choose the Solution within the selected environment.


  10. Now, I could see all the Tables expanded in the Power Platform Explorer view.

  11. When you minimize, this is what you’ll see. You’ll see all items available to work with.


Next, I’ll demonstrate on registering a Plugin Assembly from Visual Studio Tools and registering a plugin. Watch this space!

Hope this was useful!

Thank you!

Setup Power Platform CLI using Windows installer [.msi]

In the past, I had posted about how you can use Microsoft Power Platform CLI from Visual Studio Code – Set up Power Platform Tools in Visual Studio Code | Power Platform CLI.

In this post, I’ll show how you can do so using direct download and installation using .msi file.

Download Power Platform CLI installer

Here’s the link you need to go to in order to download Power Platform CLI –

  1. Visit – https://learn.microsoft.com/en-us/power-platform/developer/howto/install-cli-msi?WT.mc_id=DX-MVP-5003911


  2. Once downloaded, make sure to start the installer, it’ll ask you for confirmation.

  3. It takes a few minutes to complete setting up. Then, you can Run powershell

  4. In PowerShell, you can type pac and enter to see if Power Platform CLI was installed. By default, it’ll connect to the organization your PC is connected to.

  5. Once connected, you’ll see list of commands for the CLI which you can use given you have the appropriate connections.

Hope this was useful!

Thank you!

Recycle Bin in Dynamics 365 CRM | [Preview]

Now, you can retrieve deleted records up to 30 days in Dynamics 365 CRM /. CE apps.
Here’s how you turn this feature on!

Enable Recycle Bin

Here’s how you can enable this given you have the correct Dynamics 365 System Administrator privileges –

  1. Go to the Environment’s Settings in Power Platform Admin Center (https://admin.powerplatform.microsoft.com/)

  2. Now, expand Product section and go to the Features option.

  3. When you scroll to the bottom, you’ll see Recycle Bin option as a feature. At the time of this blog post, the feature is in Preview – Hence, this is not recommended for production purposes yet.
    By default, it’s turned Off.

  4. Once you flick the switch, you’ll be asked for number of days the data has to be retained for. I’ll enter 30 here and then scroll to the bottom and save the setting.

  5. Once saved, you can go to your environment and test this on a sample record. See the section next.

Deleted Records

Now, since this is enabled and post that when you delete records, here’s how you can find them for the number of days you’ve configured Recycle Bin for –

  1. For example, this is the Account record you want to delete.

  2. Go to the View Deleted Records section in the in your environment’s Settings area.

  3. You’ll see the Deleted records which you can select and choose to Restore.


  4. Confirm.

  5. Upon Restoring, they’ll appear where they were originally supposed to exist.


    Because this feature is still in Preview, here’s Microsoft’s Documentation on the same with listing of some known issues as well – https://learn.microsoft.com/en-gb/power-platform/admin/restore-deleted-table-records?WT.mc_id=DX-MVP-5003911

Hope this was useful!

Thank you!

Create a Custom Connector For Power Automate & Power Apps

One of the most important qualities of extending capabilities of any platform is being able to add Custom code and make it available to wider use cases.

In this case, it’s a custom code that is encompassed in a Custom Connector in Power Platform and made available to Power Automate or Power Platform.

Use Case

The purpose of my custom connector is to call my hosted custom code in Power Automate or Power Apps.

For this example, I’ve created a simple Azure Function that just returns a value – just to test the working of the Custom Connector. Of course, your use case is to be able to connect to the hosted app, expect it to process the business logic which you intend to do and return back the results.
So, in my case – my Azure Function will simply greet the name passed to it.


See the Postman test below –

Now, let’s make a Custom Connector that will execute this Azure Function in your Power Automate.

Create Custom Connector in Power Apps / Power Automate

You can either make the Custom Connector from the Power Automate portal or the Power Apps Maker portal, both are the same things. Let’s see this example from Power Apps portal –

  1. In this use case, I’m in a Solution in Power Apps / Power Automate. Open the one in your case since you can’t create a Custom Connector from outside a Solution any longer.

  2. Now you can drop down from New and see in Automation menu that you can create a Custom Connector

  3. Now, you’ll be required to enter the name of the Connector itself and other details like a PNG icon for it, Description etc.

  4. Now, below is the info that I filled in. I’m calling it Data Transporter and have selected an Icon which should make me easy to recognize my connector in Power Automate and Power Apps and enter enter the details of my hosted Azure Function which is authenticated using an API Key.
    So, here’s what my info looks like –

  5. Now, when I click on Security after filling all the info, the type of Authentication I used in this case if API Key, yours could be different depending on what your custom application is configured to work with –

  6. It’ll ask you to fill in the information so that it appears as parameters to fill in for the Custom Connector when the end user will work on their Flows/Apps.

  7. The info I’m choosing to fill is this – I’m giving a name to the parameter to indicate what info is required. The actual parameter name required by the Azure Function, in this case – it’s ‘code’ and since I need to pass the API key in Query string, I’ve selected Query instead of Header.

  8. When you go to the next part, i.e. Definition, make sure you also give a Name to the Custom Connector already. Before your lose the info you’ve already entered. Make sure you also click on Create Connector


    Once you click on Create connector, it’ll create it in a few moments.

  9. Now, since you are aware of Triggers and Actions from using Power Automate – in this use case, my Custom Connector is designed to be an Action i.e. when called/used in Power Automate, it’ll simply perform the operation it’s designed to do.
    Hence, I’m selecting an Action here.
    When I select New Action from the left hand pane, it’ll open up information for me to fill out to describe the Action.

  10. Now, since this will appear as a listed item in Actions in my Power Automate connector, I’m filling in this info (and we can check later how it appears).


    Next, I’ll click on + Import from sample as it’ll give me a place to enter a sample for the request to call my hosted Azure Function.



  11. Next, I’ll pass these values as I did in Postman to create the sample. Once done, I can click on Import.

  12. When I import, I’ll the request parameters set in the Custom Connector based on the sample I entered.

  13. Next, I’ll scroll down to ensure that all validations are perfect and I needn’t fix anything.

  14. Next, I’ll skip AI Plugins step and also the Code step since I want to keep this example concise and to the scope of the hosted Azure Function only.


    And this is skipped too –

  15. Now, the final step is to Test the Custom Connector. The Editor will ask you to Update connector before you can Test. Then, in order to begin testing – you’ll need to first create a Connection using New Connection button as shown below.


  16. When you click on New Connection, you’ll be taken to a new tab to enter the API key which you created as parameter in the initial setup of this Connector. See #7 above. Enter the API key you have which works for this hosted app and then click Create connection.


  17. Next, in case the Connection doesn’t appear, click Refresh button once.

  18. Once you refresh, you should see your Connection come up and selected.

  19. Now, next step is to test the Custom Connector itself. Enter the values that you wish to test for and click Test operation.

  20. You’ll see the test results based on what the hosted code is supposed to perform.
    In my case, it was easy as it just greets the name entered.


    And your Custom Connector is now ready to be used!

Consuming Custom Connector

Now, let’s see how you can use the Customer Connector in Power Automate in order to perform the operation in your Flows –

  1. Once in Power Automate, look for the Custom tab in the Action selector.

  2. Then, you can see the Action you defined in your Connector Definition steps above.

  3. Since you need to authenticate using the API key you have, the create Connection step will ask you this info and you can give the name of the Connection.

  4. Pass the value you want to pass as data.

  5. Finally, you can just save and test the Flow itself and look for your Outputs.


    And that’s how you can have a Custom Connector for your custom app/service your have created. I’ll soon write about other aspects of Custom Connector which I wasn’t able to cover in this blog.

Hope this was useful!

Thank you!

HTTP Trigger Azure Function Authorization Types simplified

Now, many of you must be wondering how the Authorization types for Azure Functions using HTTP Triggers work and where to look for information while using these different types. Hopefully, this post helps simplify each of those for you.

Now, when you create a new Azure Function from Visual Studio or from the Azure Portal, you’ll be asked about Authorization where you’ll find the selection to either be 1 of the below –

  1. Anonymous
  2. Function
  3. Admin
  4. System

Anonymous

This type of Authotization let’s you use the Azure Function without needing for any key and anyone with the URL alone can access it. Of course, this is not recommended for any production use –

  1. Now, if you notice your Visual Studio, when you write your first Azure Function, it comes with pre-defined method ready for you to continue to write your own code. But right away, you’ll see that the Authorization method is pre-defined considering you must’ve selected Anonymous while starting the Project.

  2. Also, since the Azure Function is understood to be Published already on the Azure Portal, you’ll see in the Function’s settings that the same has been reflected as well.

  3. Now, if you test this using Postman, the code will be able to run directly just using the URL without any API key. Either you pass in the body – and you’ll get a 200 OK with the result that the Azure Function is supposed to result.


    Or using query parameters – the result will be the same.


    This simply explains Anonymous authorization. Without any check on who’s supposed to access the Azure Function.

Function

In this type of Authentication, only the Function and resources associated to it will be accessible. This needs the caller to have a key [or code] to be passed while calling Azure Function –

  1. Let’s look at the code, and see that the type is not set to Function for Authorization.

  2. And when you Publish the code, the same will be reflected in the Settings too.


  3. And when you want to access the Azure Function from Postman, you’ll need the Function Keys defined in the Function Keys area of the Function itself – a Default Key is given already but you can choose to add your own keys and using any of them would do.

  4. Now, here’s what the Key looks like when you click on Show [there’s a button on the far right to expose the key’s value]

  5. Now, when you go to Postman, you need to can pass this as a query parameter –


    Now, let’s look at the Admin Type of Authorization.

Admin

In this type of Authorization, you get access to Functions’ Runtime APIs. The way to use the Admin key is similar to the Function Keys, just that they are available from the Function App itself than the Function –

  1. Now, when the Authorization is set to Admin

  2. You’ll see this reflected in the portal once Published.

  3. Now, in the Function App itself – you can navigate to the App keys under Functions [as of the portal’s layout in mid-2024]

  4. You can expose to see this value and share it to the clients who are going to consume this Function App. They key required here is the _master

  5. Now, you can test this using Postman


    Remember, this type of Authorization is to be used when the calling client needs to also access Functions Runtime API.
    Finally, Let’s look at the System type.

System

This type of key is managed by Function runtime and is used when the calling client when there’s a need for granular access to function runtime features.

  1. Now, you can set this from the code and publish it.


  2. And it’ll appear in the settings of the Function [In case when the Function wants to access granular function runtime features].

  3. And this is present in the App keys area under System Keys section.

  4. And when you test the same, they work just like any other key from the Function app when called.

Hope this was useful!

Create your first custom Copilot for Customer Service Hub – Part 2 | Authentication

Now, you must have created your own Copilot to be deployed for the Customer Service Hub. If not, here’s the link to Part 1 of this blog – Create your first custom Copilot for Customer Service Hub – Part 1

Configure User Authentication with Microsoft Entra ID

Here’s how you can configure the User Authentication with Microsoft’s Entra ID for your Copilot to be authenticated with –

  1. Go to the Azure Portal [https://portal.azure.com/], then given the appropriate permissions your might have, you should be able to create an App Registration

  2. Now, create on New Registration –

  3. Now, give it a suitable name so that you can identify that the purpose of this App Registration is for Copilot. Select multi-tenant, leave Redirect URI blank and click on Register.

  4. Once ready, go to Authentication and then click to add Platform.


  5. In the platform selection, click on Web.

  6. Now, enter the URIs – First, enter the first URI, make sure to select Access tokens and ID tokens in Implicit grant and hybrid flows section and then click Configure.

    https://token.botframework.com/.auth/web/redirect
    https://europe.token.botframework.com/.auth/web/redirect



  7. Then, go ahead and add the Second URI from the main screen itself. Then, click Save and refresh the page once.

  8. Now that both the URIs are added, click on the configuration link to consider both the links for configuration.

  9. Now, you’ll be taken to this pane where you can click

  10. Now, both the URIs will appear here.

  11. Next, generate Client ID and Client Secret as you’ll need these details too –


Set Copilot Authentication to use Custom Authentication

Going back to the Copilot itself, set the Authentication you just created in the Azure Portal –

  1. Go to Settings on the Copilot to use the Custom Authentication.

  2. Go to Security section and then select Authentication.

  3. Select Authenticate manually and then enter the details as shown below. Enter the Client ID and Secret which you must’ve saved before.



  4. Next, come back to Copilot Settings and in Security, go to Settings and then look for Web channel security.

  5. Once you open it, you’ll find that the Secured Access is disabled. Go ahead and enable it.
    It takes up to 2 hours for it to take effect. Till then, old settings apply.

  6. Finally, in Channels, select Customer Service Hub so that you can connect to the Customer Service Hub.

  7. On the right hand side pane which opens up, you’ll see that this is not connected. Click the Connect button.


  8. It connects to Customer Service Omnichannel in a few moments.


Part 1: Create your first custom Copilot for Customer Service Hub – Part 1

Hope this was useful!

Thank you!

Create your first custom Copilot for Customer Service Hub – Part 1 | Create Copilot

Now, if you already have Copilot Studio in your Organization or have created a trail [Start your Copilot Studio Trial], you might be looking to build your first Copilot. Here’s how you can do it –

In this example, I’m creating a Copilot to help new Customer Service Reps at the organization to search and seek help about the organization itself quicker.

Create your Copilot

Here’s how you can start building your first custom Copilot –

  1. In your Copilot Studio environment, you must be seeing this New Copilot button in Copilot section. Click that.

  2. Here’s you need to start describing the Copilot you are looking to create. This is optional but recommended to do so as first step. It’ll ask you some questions on the context of the Copilot which you are looking to create.

  3. After it gathers some information from you, it’ll summarize what the Copilot is aimed to do.
    Now, once done you can click Skip to Configure to go to the next step.

  4. Further, you can name the Copilot and then start adding Knowledge by adding sources where the Copilot will source information from.

  5. Some of the most common ways for the Copilot to source knowledge from is from website and SharePoint data itself.

  6. In this example, I’m sourcing some information about whitepapers from thecompany’s website itself.

  7. Now, once this is ready, I’ll further proceed to Create the Copilot itself once relevant Knowledge links have been added as required. Once done, click Create.

  8. Now, once the Copilot is created – it’s ready to be configured further or even ready to be Published if nothing else is to be added at this point.
    You can scroll down in the details section and find that the Copilot is ready to be Published.
    Note that based on the Copilot settings for Channel, it’s only available to Teams at first – but you need to configure for other channels – like Customer Service Hub [in this case]


  9. Now that this is published. –

  10. Your Copilot is now ready!

In the next blog, we’ll connect this Custom Copilot to Customer Service Hub – Create your first custom Copilot for Customer Service Hub – Part 1 | Create Copilot

Hope this was useful!

Thank you!

Start your Copilot Studio Trial

Here’s how you can try out Copilot Studio for free first. Along with that, here’s the Copilot Studio Pricing – https://www.microsoft.com/en-us/microsoft-copilot/microsoft-copilot-studio#Pricing

Copilot Studio Trial

Here’s how you can start your own Copilot Studio Trial.

  1. Navigate to the Copilot Studio homepage – https://www.microsoft.com/en-us/microsoft-copilot/microsoft-copilot-studio
    You’ll see this Homepage and you can see a button to Try free

  2. Then, just like any other Sign up process for Microsoft products, you can start by the entering the Email of the org which you want to provision this on.

  3. Once you click Next, you’ll be asked to Sign In once everything looks good to be provisioned.

  4. Once you Sign In, you’ll be asked for Region and Phone.

  5. Once you click on Get Started, you’ll be asked for final confirmation and then it’ll start provisioning.

  6. Once you click on Get Started, it’ll take a few minutes to get provisioned.
    Then, you’ll finally see Copilot Studio show up. Select your region and Get Started.

  7. Finally, switch to the right environment which you wish to work on.
    It’ll start with a Welcome Wizard and you are ready to go and start your Copilot Journey!


    And this is where you can start exploring within the Copilot Studio!

Hope this was useful!

Thank you!