Month: February 2022

Process to delete Sitecore OrderCloud Marketplace

Last Updated on February 18, 2022 by sandeeppote

Admin User who created the Marketplace can delete and Transfer the Ownership of the Account. Where the ownership is transfered to the users cannot delete the Marketplace.

To delete the Marketplace you should have first created a Marketplace and login to the portal as Admin User having Full Access.

For creating your Marketplace see this blog.

Once you have logged in to the portal from Dashboard select the Marketplace you want to delete.

In this case lets delete the Marketplace with name “OrderCloud Blog Auto Generated ID”

Once you are in the Marketplace, you should see the option to Delete since you have FullAccess

Confirmation message is displayed. Click on Send Confirmation Code

A confirmation code is sent to your registered mail.

Once you select option to Send Confirmation Code, you should receive mail on your registered email address from noreply@four51.com.

The mail should have details of the Marketplace you are attempting ot delete along with the code

Use this code to confirm the deletion of Maretplace

And the deleted Marketplace is no more in the Dashboard-

Docker Restart Policies

Last Updated on March 11, 2023 by sandeeppote

To setup restart policy to the container, use following command-

docker run --restart=<<policy option>> <<container>>

Following are the options for the container restart-

  1. no (default)
  2. on-failure
  3. always
  4. unless-specified

Following is the matrix for the restart policies-

* – this will start when the Docker daemon is started

Above is applicable if the container starts successfully

Live Restore

If you want to keep container running if the Docker daemon crashes or stops use the live restore option. This reeduces the container downtime due to daemon crashes or planned outages or upgrades.

Update the /etc/docker/daemon.json in Ubuntu system and add option live-restore:true

Setup OrderCloud Headstart project using Azurite, Storage Explorer and Cosmos DB Emulator – Part 1

Last Updated on May 25, 2022 by sandeeppote

Follow below steps to configure Sitecore Ordercloud Headstart middleware without having to provision Azure online resources. i.e. setup offline Azure resources

Online vs Local Azure resources-

Azure Online ResourcesAzure Offline Resources
Azure App Configurationuse appSettings.json
Storage AccountAzurite Emulator and Azure Storage Explorer
Azure Cosmos DatabaseAzure Cosmos DB Emulator

Step 1 – Install and Run Azurite Emulator

Install Azurite- Pre-requisite is to install node js

npm install -g azurite

Run Azurite- Navigate to the folder where the supporting files should be deployed e.g.: c:\Azurite

azurite start

OR - if you want specfic folder and in debug mode 

azurite --silent --location c:\azurite --debug c:\azurite\debug.log

Blob service should listen to http://127.0.0.1:10000

Step 2 – Install Microsoft Azure Storage Explorer

Install Azure storage explorer. Download from here

Step 3 – Configure Blob Containers

Connect to Local Azure Storage

Click on the connect to open the connection dialog box

Select the Local storage emulator

Fill in the required details

Display name

Account name – this wil be used to connect to the blob storage

Blobs port- port used to connect to the vlob storage

Queues and Tables port- port used to connect queues and tables respectively

These are the connection information (you might have to note this)-

Local account is created-

Storage Explorer is now able to conect to Local Storage Emulator i.e. Azurite

Create a Blob Container – ngx-translate and create new Virtual Directory i18n

Blob Container and folder name can be any other name. You need to configure this correctly in UI config. See this in later steps

Upload the translation file

Ideally Container, Virtual Directory and trnslation file should be created by Headstart Api. I couldn’t make it work. Hence alternative this I have attached en.json file here.

Once uploaded you should be able to see the uploaded file-

Set Public Access Level to Blob Container

Select the Public read access for containers and blobs

Configure CORS settings

CORS settings are required for accessing the en.json file to access from the local blob storage

Click “Add” to add new CORS Settings-

Following values in –

Allowed Headers – x-ms-meta-data,x-ms-meta-target,x-ms-meta-abc

Exposed Headers – x-ms-meta-*

Check for all the steps performed above the operations in Blob Storage Explorer is successful.

Reference for CORS Rule-

https://docs.microsoft.com/en-us/rest/api/storageservices/cross-origin-resource-sharing–cors–support-for-the-azure-storage-services

Now try to access the translator file from local blob storage on – 127.0.0.1:10000/devstoreaccount1/ngx-translate/i18n/en.json

OrderCloud headstart configuration issues- resolved

Last Updated on February 1, 2022 by sandeeppote

OrderCloud headstart configuration issue- resolved

Error- Running the Headstart.Api with non-compatible .net framework

Resolution – Install .net core 3.1 from here

Error – while running the HeadStart.Api from the Azure Api Configuration when Cosmos is not setup in ServiceCollectionExtensions.cs

When writing this blog there is a issue whilst connecting the Cosmos service is the configuration for the same is set.

Change the code to following in ServiceCollectionExtensions.cs file-

Change the highlighted line as the empty strings are not gracefully handled.

Resolution

==> ServiceCollectionExtensions.cs

if(string.IsNullOrEmpty(config.DatabaseName)|| 
                string.IsNullOrEmpty(config.EndpointUri) || 
                string.IsNullOrEmpty(config.PrimaryKey))
{
  // allow server to be started up without these settings
  // in case they're just trying to seed their environment
  // in the future we'll remove this in favor of centralized seeding   
  // capability

     return services;
}

Error – while running the HeadStart.Api from the Azure Api Configuration when Cosmos is not setup in CosmosExtensions.cs

When writing this blog there is a issue whilst connecting the Cosmos service is the configuration for the same is set.

Change the code to following in CosmosExtensions.cs file-

Change the highlighted line as the empty strings are not gracefully handled.

Resolution- Crate a cosmos endpoint or change the highlighted line of code to-

==> CosmosExtensions.cs

if( string.IsNullOrEmpty(endpointUrl) ||     
           string.IsNullOrEmpty(primaryKey) ||  
           string.IsNullOrEmpty(databaseName))
{
   // allow server to be started up without these settings
   // in case they're just trying to seed their environment
   // in the future we'll remove this in favor of centralized seeding 
   //capability

        return services;
}