Documented various XM Cloud Plugin CLI commands options in the cheatography.
31 August, 2023
Sitecore CLI - XM Cloud Plugin Cheat sheet
30 August, 2023
Empower XM Cloud Users to view the Latest XM Cloud Deployment status in Content Editor using Sitecore PowerShell
The limitation in XM Cloud Deploy API is that it requires Organization Automation Client even though we need access to only certain XM Cloud Environment of a XM Cloud Project. So we need to store this information securely in encrypted connection string or get it from a Key Vault as Organization Automation Client has the power to destroy your entire XM Cloud Organization. 🤷
- Add PowerShell Script Module in Script Library folder with a name. Example: Sample
- In the newly Sample PowerShell Script Module item, add a Integration Point Libraries. This will open a window to select the integration points. In this dialog, choose Content Editor - Ribbon. This will add the ribbons which are available in this system as Script Library.
- In the Publish item, add a PowerShell Script Library called XM Cloud Deployment. This will be the name of the chunk in the Publish ribbon. And then add a PowerShell script item called Get Deployment Status. We can set an icon in the Appearance section of this item to match with the purpose of this button (/~/icon/apps/32x32/Announcements.png).
- In the script body, we can add this script to get the latest deployment status of the particular environment.
- In order to remove all the empty Ribbon libraries, go to Sample PowerShell Script Module item, right click, scripts, Purge Empty Libraries. This will remove all the empty Script Libraries.
29 August, 2023
XM Cloud CLI Plugin Commands
28 August, 2023
XM Cloud Deployment Request & Statuses
25 August, 2023
XM Cloud - Deployment in Queue will be started immediately if an in-progress deployment is cancelled
24 August, 2023
XM Cloud - GraphQL Endpoint Details - Delivery/Preview
In XM Cloud, there are two GraphQL playgrounds to run queries and test the content.
- Delivery API Playground
- Preview API Playground
Delivery API Playground
- Uses the Delivery API of XM APIs to test the published content.
- Delivery API is
- accessing approved and published content from Edge.
- optimized for performance and high availability
- Uses Content management instance for test the published and unpublished content.
23 August, 2023
Experience Edge for XM Cloud - Token API Audience
When you create Edge API Key using Token API, you need to pass the scopes. You can refer this article on how to create edge API Key using token API. There are two scopes needed to create the Edge API Key.
- audience-delivery - authorizes access to the Delivery API.
- content-#everything# - allows access to all content.
22 August, 2023
Generate XM Cloud (Experience) Edge API Key
- Go to XM Cloud Deploy App (https://deploy.sitecorecloud.io/) → Credentials → Environment → Create Credentials → Edge Administration → Create
- Copy client id and client secret. Client secret should be copied now and it cannot be retrieved again.
Generate Edge Administration Credential |
Select Environment |
Copy Client ID and Client Secret |
- For Organization Credential: Go to XM Cloud Deploy App (https://deploy.sitecorecloud.io/) → Credentials → Create Credentials → Create
- For Environment Credential: Go to XM Cloud Deploy App (https://deploy.sitecorecloud.io/) → Credentials → Environment → Create Credentials → Automation → Create
- Copy client id and client secret. Client secret should be copied now and it cannot be retrieved again.
- In the XM Cloud App Dashboard, click Sites, in the action menu …, click Settings, click Developer Settings and get the Key from SITECORE_API_KEY environment variable.
21 August, 2023
XM Cloud URLs
Title | URL |
---|---|
Cloud Portal | https://portal.sitecorecloud.io/ |
Apps | https://xmapps.sitecorecloud.io/ |
Deploy App | https://deploy.sitecorecloud.io/ |
Deploy API | https://xmclouddeploy-api.sitecorecloud.io/ |
Explorer App | https://explorer.sitecorecloud.io/ |
Monitoring API for logs | https://xmcloud-monitoring-api.sitecorecloud.io/ |
OAuth Audience for XM Cloud using API (default) | https://api.sitecorecloud.io/ |
OAuth Audience for Sitecore deployment using DevEx Plugin | https://xmcloud-cm.sitecorecloud.io/ |
OAuth token endpoint | https://auth.sitecorecloud.io/oauth/token |
Page Editor | https://pages.sitecorecloud.io/ |
Authority URL | https://auth.sitecorecloud.io/ |
15 August, 2023
Useful Sitecore PowerShell Scripts
In this blog post, I am sharing some of the useful SPE scripts which I used in my previous project.
Remove Sitecore Originator Field Value
Originator field indicates the branch template used to create the item. In case if the branch template is deleted, the field may be left out with orphaned GUID value.
Either the entire content tree can be parsed whether there is any orphaned GUID in that field or use Scan the database for broken links in Sitecore Control panel. In the below script, I took the list of items with broken originator field and created an CSV with Column ID for Item ID and script will intake the excel and clear the Originator field.
Apply random image to article pages
One of the ask is to upload a set of images in Media library and randomly apply one image to each of the article pages which are already created in Sitecore.
First, we uploaded all the images in a folder in Media library. Then executed the below script which will randomly choose one image and apply it in each article page. We also added a step to publish the page.
Remove Orphaned Renderings
In certain scenarios, content authors reports us to remove any orphaned renderings across the site. Though it is different between each Sitecore solutions, below code can be leveraged to build custom script and remove renderings. Thanks to Aaron Bickle who provided a starter kit for this task and was able to customize for our solution.
Sitecore