Azure-cli: Bug: az cosmosdb list-connection-strings returns empty result

Created on 12 Sep 2017  Â·  12Comments  Â·  Source: Azure/azure-cli

Description

az cosmosdb list-connection-strings returns empty result:

{
  "connectionStrings": null
}

Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:
docker

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here: 2.0.17

OS Version: What OS and version are you using?
Answer here: linux

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: sh

Most helpful comment

The az cosmosdb list-connection-strings command now returns connection strings for all API types. It returns primary, primary read-only, secondary and secondary read-only

All 12 comments

This is account management API not data plane api. Should be assigned to digvijay @dmakwana who owns account mgt API.

Still happening in Azure CLI 2.0.44

still issue persists in Azure cli 2.0.45

I have the same issue using azure-cli 2.0.46 on mac os 10.14

2.0.47 has this issue as well (running from cloud shell).

This seems to still be an issue. Is there a work around other than retrieving the keys and then building the connection string?

# Cosmos connection string
cosmosKey=$(az cosmosdb list-keys --name $cosmos --resource-group $resourceGroup --query primaryMasterKey --output tsv)
connectionString="AccountEndpoint=https://$cosmos.documents.azure.com:443/;AccountKey=$cosmosKey;Database=$cosmosDatabase;DefaultCollection=$cosmosCollection"
echo "ConnectionString:DefaultConnection=$connectionString"
az webapp config connection-string set --resource-group $resourceGroup --name $appService --connection-string-type Custom --settings DefaultConnection="$connectionString"

To add context from what I've seen - if you run az cosmosdb list-connection-strings for a MongoDB set-up, the connection string shows up no problem. When the connection string is for a Document SQL set-up, the value is null.

The az cosmosdb list-connection-strings command now returns connection strings for all API types. It returns primary, primary read-only, secondary and secondary read-only

@shurd can this issue be closed then?

Let me verify it once, i will confirm you.

On Sat, 2 Feb 2019, 5:22 am Travis Prescott <[email protected] wrote:

@shurd https://github.com/shurd can this issue be closed then?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Azure/azure-cli/issues/4419#issuecomment-459907653,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AP5ILCgIWiIAxhiHfeCwao6gRXBtiX78ks5vJNMmgaJpZM4PU4Cy
.

@tjprescott yes, this issue can be closed

Thanks @shurd!

Was this page helpful?
0 / 5 - 0 ratings