Fri Nov 11 2022 • ☕️ 3 min read • you like my writing? Buy me a coffee
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.
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:
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
On Sitecore Slack also another approach was described to get the Project Id.
Open the XM Cloud Deploy app on https://deploy.sitecorecloud.io/:
Click on the settings icon in the upper right corner and enable in Experimental Features the Environment Details:
If you now click on the project name in the XM Cloud Deploy app:
And then click on the environment name:
A pane with environment information is available with all the IDs you need.
Note that on Sitecore Learning there is a whole section on XM Cloud Command Line Interface.
Discuss on Twitter • Edit 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/.
Personal blog by Serge van den Oever - als je maar lol hebt...
LinkedIn: Serge van den Oever - articles on LinkedIn
Technology Consultant @ Macaw
Competence Team Lead Custom Application Development @ Macaw
2021-2023 Technology Sitecore Most Valuable Professional