azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

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

Open chrisdostert opened this issue 9 years ago • 12 comments

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

chrisdostert avatar Sep 12 '17 15:09 chrisdostert

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

moderakh avatar Sep 21 '17 00:09 moderakh

Still happening in Azure CLI 2.0.44

syedhassaanahmed avatar Aug 18 '18 14:08 syedhassaanahmed

still issue persists in Azure cli 2.0.45

pritam97 avatar Sep 16 '18 08:09 pritam97

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

holzapfelnet avatar Oct 07 '18 14:10 holzapfelnet

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

luisgmsft avatar Oct 11 '18 19:10 luisgmsft

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"

Dave76 avatar Nov 29 '18 04:11 Dave76

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.

mindlessroman avatar Dec 10 '18 18:12 mindlessroman

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 avatar Feb 01 '19 18:02 shurd

@shurd can this issue be closed then?

tjprescott avatar Feb 01 '19 23:02 tjprescott

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 .

pritam97 avatar Feb 02 '19 06:02 pritam97

@tjprescott yes, this issue can be closed

shurd avatar Feb 04 '19 16:02 shurd

Thanks @shurd!

tjprescott avatar Feb 04 '19 18:02 tjprescott