Create and Publish Web Resources From VS Code Using Dataverse DevTools

In Power Apps or CRM Development, we have to update the code by navigating to the web resource every time and publish it. But, here is a great solution which is Dataverse DevTools. This simplifies the task by publishing of web resource within VS Code itself.

Create and Publish web resources from VS Code using Dataverse DevTools

Install Dataverse DevTools from the extensions in Visual Studio Code.

Create and Publish web resources from VS Code using Dataverse DevTools

In VS Code, create a JavaScript file.(I have created a file named alert.js)

Create and Publish web resources from VS Code using Dataverse DevTools

In VS Code click on the Dataverse icon on the vertical bar on the left.

Create and Publish web resources from VS Code using Dataverse DevTools

Click on Create New Connection button to create a connection between your VS Code and Dataverse

Create and Publish web resources from VS Code using Dataverse DevTools

Enter your environment URL in the prompt and then press Enter

Create and Publish web resources from VS Code using Dataverse DevTools

In the next prompt select Microsoft Login Prompt and press Enter

Create and Publish web resources from VS Code using Dataverse DevTools

Select any one option in the list

Create and Publish web resources from VS Code using Dataverse DevTools

If this page appears on the browser, the authentication is successful. Then move to VS Code.

Create and Publish web resources from VS Code using Dataverse DevTools

The connection section shows that the connection is established between Dataverse and VS Code.

Create and Publish web resources from VS Code using Dataverse DevTools

Expand the web resources and you will see all the web resources in your environment.

Create and Publish web resources from VS Code using Dataverse DevTools

Click on the bulb icon adjacent near to the web resources.

Create and Publish web resources from VS Code using Dataverse DevTools

A page appears with all the files in your folder.(In my case I have only one js file).

Create and Publish web resources from VS Code using Dataverse DevTools

Click on the link button, a prompt pops out and asks to link the existing web resource or upload as new web resource. (I want to create a new web resource),

  •  For linking existing web resource select the web resource to link with the local file.
    Create and Publish web resources from VS Code using Dataverse DevTools
  • Select a solution where you want to create that web resource.
    Create and Publish web resources from VS Code using Dataverse DevTools
  • In the next prompt add a display name and press Enter.
    Create and Publish web resources from VS Code using Dataverse DevTools
  • In the next prompt enter the logical name without prefix and press Enter.
    Create and Publish web resources from VS Code using Dataverse DevTools

The local file is connected with the dataverse web resource.

Create and Publish web resources from VS Code using Dataverse DevTools

Update the file with some code and save.(I have used the above code to show an alert).

Create and Publish web resources from VS Code using Dataverse DevTools

In the smart match page click on the upload, then the status of the file gets up-to date.

Create and Publish web resources from VS Code using Dataverse DevTools

Use the function in any of the triggering event then save and publish the form.(I have used it in account form - download).

Go to the form and check if it works,

Create and Publish web resources from VS Code using Dataverse DevTools

That’s Great Right... By this you can push your code to Dataverse without publishing.

Thanks.