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.
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.
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:
To get the key, call the SSO Encode Sitecore License REST API:
POST https://gateway-sso-scs.cloud.sitecore.net/api/License/Encode
Content-Type: application/xml
The Content-Type
is used to declare the general type of data. Set this header to application/xml.
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>
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]"
}
To get a list of all provisioned xDB Sets, call the List xDB Sets REST API.
GET https://gateway-xdb-scs.cloud.sitecore.net/api/xdb/[sitecore license id]
X-ScS-Nexus-Auth: [sitecore nexus key]
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.
None.
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"
}
]
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.
GET https://discovery-xdb-cloud.sitecore.net/xdb/set/[sitecore license id]?DeploymentId=[xdb cloud deployment id]
X-ScS-Nexus-Auth: [sitecore nexus key]
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.
None.
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]"
}
There is a new Get Connection Strings REST API available for xDB Cloud 2.0
, which you can use on step #3.