7

Sitecore has provisioned xDB Cloud Set for me. How can I get connection strings and/or endpoints of my xDB Cloud Set?

For example, I want to connect to databases in MongoDB using Robomongo tool.

8

To get connection strings and/or endpoints of xDB Cloud Set that is based on Sitecore xDB Cloud services v1.0 or v2.0, you have to perform the following steps:

  1. Get the Sitecore Nexus Auth key to talk to xDB Cloud services.
  2. Get the Deployment ID of xDB Set you are interested in.
  3. Get a list of endpoints for the specified xDB Set.

Sitecore Nexus Auth Key

To get the key, call the SSO Encode Sitecore License REST API:

Request

POST https://gateway-sso-scs.cloud.sitecore.net/api/License/Encode
Content-Type: application/xml

Request Headers

The Content-Type is used to declare the general type of data. Set this header to application/xml.

Request Body

The body of the request contains sitecore license file:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="http://www.sitecore.net/licenseviewer/license.xsl"?>
<signedlicense id="[sitecore license id]"> 
...
  <Signature>...</Signature>
...
</signedlicense>

Response

Status code 200 (OK) is returned for a successful response with the following JSON document in the body:

{
  "Key": "X-ScS-Nexus-Auth",
  "Value": "[sitecore nexus key]"
}

2. Sitecore Deployment ID

To get a list of all provisioned xDB Sets, call the List xDB Sets REST API.

Request

GET https://gateway-xdb-scs.cloud.sitecore.net/api/xdb/[sitecore license id]
X-ScS-Nexus-Auth: [sitecore nexus key]

Request Headers

The X-ScS-Nexus-Auth is used to authenticate the request to Sitecore xDB Cloud service. It is a string value, unique to your Sitecore License ID.

Request Body

None.

Response

Status code 200 (OK) is returned for a successful response with the following JSON document in the body:

[
  {
    "DeploymentId": "My-xDB-Cloud-Prod"
  },
  {
    "DeploymentId": "My-xDB-Cloud-NonProd"
  }
]

3. Sitecore xDB Set Endpoints

To get a list of all endpoints of the specified xDB Set, call the following REST API, which is undocumented.

This REST API is exactly the same thing that Sitecore xDB Cloud Client calls for xDB Cloud 1.0 if you examine the Sitecore.Cloud.Xdb assembly using such tool as .NET Reflector or dotPeek.

Request

GET https://discovery-xdb-cloud.sitecore.net/xdb/set/[sitecore license id]?DeploymentId=[xdb cloud deployment id]
X-ScS-Nexus-Auth: [sitecore nexus key]

Request Headers

The X-ScS-Nexus-Auth is used to authenticate the request to Sitecore xDB Cloud service. It is a string value, unique to your Sitecore License ID.

Request Body

None.

Response

Status code 200 (OK) is returned for a successful response with the following JSON document in the body:

{
  "LicenseId": "[sitecore license id]",
  "DeploymentId": "[sitecore xdb cloud deployment id]",
  "XdbConnectionStrings": {
    "analytics": "mongodb://[user-name]:[password]@[host1]:[port1],[host2]:[port2]/[guid]-Analytics?ssl=true;replicaSet=[hostX];connectTimeout=1m;maxIdleTime=1m;socketTimeout=1m",
    "tracking.live": "mongodb://[user-name]:[password]@[host1]:[port1],[host2]:[port2]/[guid]-TrackingLive?ssl=true;replicaSet=[hostX];connectTimeout=1m;maxIdleTime=1m;socketTimeout=1m",
    "tracking.history": "mongodb://[user-name]:[password]@[host1]:[port1],[host2]:[port2]/[guid]-TrackingHistory?ssl=true;replicaSet=[hostX];connectTimeout=1m;maxIdleTime=1m;socketTimeout=1m",
    "tracking.contact": "mongodb://[user-name]:[password]@[host1]:[port1],[host2]:[port2]/[guid]-TrackingContact?ssl=true;replicaSet=[hostX];connectTimeout=1m;maxIdleTime=1m;socketTimeout=1m"
  },
  "ReportingServiceUri": "https://Reporting-[deployment type]-[guid]-[location]-Xdb-Sc.cloudapp.net",
  "DeploymentType": "[Prod | NonProd]",
  "SitecoreVersion": "[sitecore experience platform version]",
  "Location": "[West US | North Europe | Japan East | Australia Southeast]",
  "Indexes": {
    "sitecore-analytics-cloud-index": {
      "Name": "[guid]-analyticsindex",
      "BaseUrl": "https://[search service name].search.windows.net/indexes",
      "QueryKey": "[query key]",
      "ApiVersion": "2015-02-28"
    }
  },
  "XdbCloudVersion": "[1.0 | 2.0]",
  "ReportingServiceCertificate": "[certificate thumbprint]"
}
1

There is a new Get Connection Strings REST API available for xDB Cloud 2.0, which you can use on step #3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.