Serge van den Oever's weblog

XM Cloud - getting the Project ID

November 11, 2022 • ☕️ 3 min read
If you like my writing
Buy me a coffee when you like my writing!

When working with the Sitecore CLI to retrieve information from XM Cloud, for many operations a Project Id is required. There are multiple ways to obtain this Project Id. In this post I will describe two ways to do this.

The first way is using the Sitecore CLI itself. To work with the Sitecore CLI, we need to have the Sitecore CLI configured. Within an XM Cloud project create by XM Cloud, this configuration is already part of the code repository.

All configuration files for the Sitecore CLI

If you open a terminal window and navigate to the root folder of your project, you first need to login to XM Cloud:

dotnet sitecore cloud login

The connection information is available in the user.json file, and you are presented with a web interface to approve the authentication:

r5o25amc5255

r5o26amc5265

After pressing the Confirm button you are automatically authenticated if you recently logged in on the Sitecore Cloud portal, otherwise you are presented with a login screen.

When logged in into XM Cloud, the Project Id can be retrieved using the command:

dotnet sitecore cloud project list

r5o30amc5305

On Sitecore Slack also another approach was described to get the Project Id.

Open the XM Cloud Deploy app on https://deploy.sitecorecloud.io/:

r5o33amc5335

Click on the settings icon in the upper right corner and enable in Experimental Features the Environment Details:

r5o35amc5355

If you now click on the project name in the XM Cloud Deploy app:

r5o42amc5425

And then click on the environment name:

r5o43amc5435

A pane with environment information is available with all the IDs you need.

r5o47amc5475

Note that on Sitecore Learning there is a whole section on XM Cloud Command Line Interface.

Discuss on TwitterEdit on GitHub

Serge van den Oever's weblog

Serge van den Oever

Personal blog by Serge van den Oever - als je maar lol hebt...
Twitter: @svdoever
LinkedIn: Serge van den Oever - articles on LinkedIn

Technology Consultant @ Macaw
Competence Team Lead Custom Application Development @ Macaw
2022 Technology Sitecore Most Valuable Professional
2021 Technology Sitecore Most Valuable Professional


If you like my writing
Buy me a coffee when you like my writing!