Serge van den Oever's weblog

XM Cloud - getting the Project ID

Fri Nov 11 2022 • ☕️ 3 min read • you like my writing? Buy me a coffee

XM Cloud - getting the Project ID

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

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. You are free to share and adapt this work for non-commercial purposes, provided you give appropriate credit, provide a link to the license, and indicate if changes were made. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/.

Serge van den Oever's weblog

Serge van den Oever

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

Technology Consultant @ Macaw
2021-2024 Sitecore Technology MVP