BUG: Cosmos container creates invalid resourceId reference in 1.3
See original GitHub issueI 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:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Works for me! Thanks for the fix.
Great, I’m testing it now.