For Marketing Cloud developers who used to and wanted to have the features of IDE, the default browser based editor is a nightmare to edit long scripts. Here comes a savior for those!
Now you can connect your Marketing Cloud with your local Visual Studio Code with a super simple extension – AMPscript by Agadzhanov Sergey.
An actively maintained project (as of this writing) – vscode-ampscript provides us the ability to:
- Utilize the features of Visual Studio Code.
- Connect Marketing Cloud assets with Visual Studio Code:
- Cloud Pages
- Mobile Messages
- Syntax Highlighting for AMPScript.
- Code and Hover Snippets.
Connecting VS Code with Salesforce Marketing Cloud Instance
Setting up Marketing Cloud
- Login to Marketing Cloud. Make sure you have permission to create packages.
- Go to Setup by hovering your Name Avatar.
- Under the setup section, open Apps > Installed Packages.
- Create a new package by providing a name and description that you desire.
- Click Add Component button at the bottom of the page.
- Select API Integration and click Next.
- Select “Server-to-Server” Integration Type and click Next.
- Select the permissions that you wish. Basically you might need
- Email – Read and Write
- Web – Read, Write and Publish
- Saved Content – Read and Write
- Click Save.
- If you have Business Units in your Marketing Cloud account, (Only available for Enterprise 2.0 tenant)
- Click on the Access Tab
- Make sure the Integration is enabled for the Business Unit you wanted to integrate.
Setting up Visual Studio Code
- Install AMPScript Extension. (Make sure you update your Visual Studio code to the latest)
- Open View > Command Palette.
MCFS: Connection Managerin the Command Palette.
- Click on the New Connection from the Connections List section in the page that is opened.
- Copy “Authentication Base URI”, “Client Id”, “Client Secret” and your MID (Business Unit ID) from the Package Page and paste the values in the appropriate fields.
- Click Save Changes.
- Now click Connect to connect to your Marketing Cloud Instance.