How to obtain the endpoint URL for CosmosDB for Postgresql Cluster?

Jacky Lam 210 Reputation points
2023-06-15T07:06:20.45+00:00

Hi,

I want to use CLI to obtain the endpoint URL for a CosmoDB for Postgresql Cluster resource. I try both az postgre and az comosdb, but it also returns resource not found. For example:

az cosmosdb show --name cosmospostgrepreprdjl1 --resource-group ABC

az postgres server show -g ABC --name cosmospostgrepreprdjl1

where cosmospostgrepreprdjl1 is the name showing on the resource list of a resource group ABC

Jacky

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,909 questions
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,552 Reputation points Microsoft Employee Moderator
    2023-06-17T22:10:29.4766667+00:00

    Hi, @Jacky Lam We don’t support native Azure CLI commands for Azure Cosmos DB for PostgreSQL yet. You can use ‘az rest’ as a thin wrapper for REST API calls though.

     As you probably know, you can get connection strings for various languages and frameworks/tools on the ‘Connection strings’ tab in the cluster properties in Azure portal.

     If you need to get a connection string programmatically you would need to construct it in the required syntax by getting variables such as the name of the node you need to connect to. 

    You can list nodes in a cluster using this API call and list clusters in a resource group using this API call. Also relevant to it is our current format of the node DNS names. Please note that this format is valid for recently created clusters, namely for those created on June 6<sup>th</sup>, 2023 and later. This page describes the old format too.

    Let me know if you need any additional information.

    Regards

    Geetha

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.