Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Power BI, Fabric, SQL, and AI community-led event. March 31 - April 2. Use code MSCUST for a $150 discount. Prices go up Feb 11th.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Visual Studio Code is a lightweight, powerful source code editor for Windows, macOS, and Linux. It supports JavaScript, TypeScript, and Node.js and has a rich ecosystem of extensions for other languages like C++, C#, Java, Python, PHP, and Go, and runtimes like .NET and Unity. Learn more about Visual Studio Code in Get started with VS Code.
Visual Studio Code allows you to extend your capability through extensions. Visual Studio Code extensions can add more features to the overall experience. With the release of this feature, you can now use the Visual Studio Code extension to work with Power Pages.
The Power Platform Tools adds the capability to configure websites using Visual Studio Code, and use the built-in Liquid language IntelliSense enabling help with code completion, assistance, and hinting while customizing websites interface using Visual Studio Code. Using the Visual Studio Code extension, you can also configure portals through the Microsoft Power Platform CLI.
Note
Before using the Visual Studio Code extension for Power Pages, you must:
Download, install, and configure Visual Studio Code. More information: Download Visual Studio Code
Configure your environment and system for Power Pages CI/CD support using CLI. More information: Microsoft Power Platform CLI (preview)
After you install Visual Studio Code, you need to install the extension for the Power Platform tools plug-in for Visual Studio Code.
To install the Visual Studio Code extension:
Open Visual Studio Code.
Select Extensions from the left pane.
Select the Settings icon from the top-right on the extensions pane.
Search for and select Power Platform Tools.
Select Install.
Verify the extension is installed successfully from the status messages.
To authenticate against a Microsoft Dataverse environment, and to download website content, refer to the tutorial Use Microsoft Power Platform CLI with Power Pages - download website content.
Tip
The Power Platform Tools Extension automatically enables using Microsoft Power Platform CLI commands from within Visual Studio Code through Visual Studio Integrated Terminal.
The Visual Studio Code extension for Power Pages automatically identifies and shows icons for files and folders inside the downloaded website content.
Visual Studio Code uses the default file icon theme which doesn’t show Power Pages specific icons. To view file icons specific to your websites, you have to update the Visual Studio Code instance to use the Power Pages specific file icon theme.
To enable a portals-specific file-icon theme:
Open Visual Studio Code.
Go to File > Preferences > Theme > File Icon Theme
Select the theme for PowerApps portals Icons.
The Visual Studio Code extension enables a live preview option to view the Power Pages content page inside the Visual Studio Code interface during the development experience.
To see the preview, select from the top-right when having an HTML file open in edit mode.
The preview pane opens on the right side of the page being edited.
The preview feature requires that the other files are also open in the same Visual Studio Code session that makes up the HTML markup for the preview to show. For example, if only the HTML file is opened without the folder structure opened using Visual Studio Code, the following message appears.
When this problem occurs, open the folder using File > Open folder and select the downloaded website content folder to open before you try to preview again.
The autocomplete capability in the Visual Studio Code extension shows the current context being edited, and the relevant autocomplete elements through IntelliSense.
When customizing downloaded content using Visual Studio Code, you can now use IntelliSense for Power Pages Liquid tags.
Start typing to see a list of Liquid tags. Select a tag to format it correctly and continue with your input.
You can see Liquid object code completions by entering {{ }}
. With the cursor placed between the brackets, select <CTRL + space>
to display a list of Liquid objects that you can select. If the object has more properties, you can enter a . and then select <CTRL + space>
again to see specific properties of the Liquid object.
You can see Power Pages web template suggestions by place your cursor in the {include ' '}
statement and select <CTRL> - space
. A list of existing web templates appear for you to select.
From within Visual Studio Code, you're able to create, delete, and rename the following website components:
You can use the context menu options to create new website components. Right-click one of the supported objects, choose Power Pages, and select the website object type you wish to create.
Alternatively, you can use the Visual Studio Code command palette by selecting Ctrl + Shift + P
.
You need to specify more parameters to create the object.
Object | Parameters |
---|---|
Web pages | Name, page template, parent page |
Page templates | Name, web template |
Web templates | Name |
Content snippets | Name, and if the snippet will be HTML or text. |
New assets (Web files) | Name, parent page, and select file to upload. |
From the file navigation, you can use the context menu to rename or delete Power Pages components.
Note
Deleted objects can be restored from the desktop recycle bin.
The following limitations currently apply to the Power Platform Tools for portals:
Power Pages support for Microsoft Power Platform CLI (preview)
Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Power BI, Fabric, SQL, and AI community-led event. March 31 - April 2. Use code MSCUST for a $150 discount. Prices go up Feb 11th.
Register today