question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: Cosmos container creates invalid resourceId reference in 1.3

See original GitHub issue

I just upgraded to 1.3 and I’ve found a bug while creating a Cosmos collection. This is my code:

let cosmos = cosmosDb {
    name cosmosDatabaseName
    account_name cosmosAccountName
    throughput 400<CosmosDb.RU>
    failover_policy CosmosDb.NoFailover
    add_containers [
        cosmosContainer {
            name "mycontainer"
            partition_key ["/id"] CosmosDb.Hash
        }
    ]
}

The output ARM template contains the following for the “mycontainer” container:

"dependsOn": [
     "[resourceId('Microsoft.DocumentDb/databaseAccounts/sqlDatabases', 'DatabaseName')]"
]

This does not validate and fails deployment. From looking at an exported template, I believe the correct call to resourceId should contain the account name parameter as well:

"dependsOn": [
     "[resourceId('Microsoft.DocumentDb/databaseAccounts/sqlDatabases', 'AccountName', 'DatabaseName')]"
]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
BrianVallelungacommented, Dec 23, 2020

Works for me! Thanks for the fix.

1reaction
BrianVallelungacommented, Dec 23, 2020

Great, I’m testing it now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Azure Cosmos DB not found exceptions
Invalid character in an item ID​​ An item is inserted into Azure Cosmos DB with an invalid character in the item ID.
Read more >
Error "Resource Not Found" creating Cosmos DB container ...
I am running the following command to create a container for my Cosmos DB, that I copied from the manual and replaced with...
Read more >
Error while deploying cosmosdb container · Issue #6228
The error you're getting is because the graph was being created before the database was done being created. Generally speaking, I would keep...
Read more >
Consuming Azure Cosmos DB REST API v3
Recently I had a need to create containers under a Cosmos database programmatically as well as to create and grants permissions for users....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found