Fix broken Cosmos DB ARM deployment template - #192
Open
Manya Sharma (ManyaS-Git) wants to merge 1 commit into
Open
Fix broken Cosmos DB ARM deployment template#192Manya Sharma (ManyaS-Git) wants to merge 1 commit into
Manya Sharma (ManyaS-Git) wants to merge 1 commit into
Conversation
AzureDeployment/CosmosDB/cosmosdb.json was not valid JSON, so the template could not be parsed or deployed at all: - The Microsoft.DocumentDB/databaseAccounts resource was missing its closing brace, leaving the resource array unparseable. - A comma was missing between the database and container resources. - The sqlDatabases and containers resources used the wrong type paths (Microsoft.DocumentDB/sqlDatabases and Microsoft.DocumentDB/containers). As top-level child resources they need the full parent path (Microsoft.DocumentDB/databaseAccounts/sqlDatabases[/containers]) and a name prefixed with the parent resource name. The container's dependsOn was updated to reference the full database resource name. Verified: the file now parses as valid JSON and every resource uses the correct provider type path and parent-prefixed name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AzureDeployment/CosmosDB/cosmosdb.jsonwas not valid JSON, so the template could not be parsed — let alone deployed — by Azure Resource Manager. It has been broken since it was added in PR #18.Three problems:
Microsoft.DocumentDB/databaseAccountsresource was never closed, sojson.loadfails immediately (Expecting property name enclosed in double quotes: line 44).Microsoft.DocumentDB/sqlDatabases,Microsoft.DocumentDB/containers). As top-level child resources they must use the full parent path (Microsoft.DocumentDB/databaseAccounts/sqlDatabasesandMicrosoft.DocumentDB/databaseAccounts/sqlDatabases/containers) and theirnamemust be prefixed with the parent resource name. The container'sdependsOnwas updated to reference the full database resource name.Verification
json.loadnow succeeds — the file is valid JSON.name, matching the documented Cosmos DB ARM pattern.