-
Notifications
You must be signed in to change notification settings - Fork 3k
[Cosmos] Infra: use Bicep for resource provisioning #24198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
61ba8d1
initial commit
simorenoh 15dcceb
Client Constructor (#20310)
annatisch bda95c3
read database
simorenoh c9648ab
Update simon_testfile.py
simorenoh 80540dc
with coroutine
simorenoh 1285438
Update simon_testfile.py
simorenoh 992b0cd
small changes
simorenoh 47cb688
async with returns no exceptions
simorenoh f3fa79f
Merge pull request #1 from Azure/simonmoreno/async
simorenoh 0c49739
async read container
simorenoh 47f4af5
async item read
simorenoh c97c946
cleaning up
simorenoh fcd95db
create item/ database methods
simorenoh 36c5b90
item delete working
simorenoh 44db2a2
docs replace functionality
simorenoh ec5b6ed
upsert functionality
simorenoh d63d052
Merge pull request #2 from simorenoh/item-read
simorenoh 5d74c8f
missing query methods
simorenoh 89fc2f7
CRUD for udf, sproc, triggers
simorenoh fdaa880
Merge branch 'Azure:main' into async-client
simorenoh 3f9baf2
Merge branch 'Azure:main' into async-client
simorenoh d6650bc
Merge branch 'Azure:main' into query-functionality
simorenoh 043dfe0
initial query logic + container methods
simorenoh befdb41
Merge branch 'async-client' into query-functionality
simorenoh 8cffbe2
Merge pull request #3 from simorenoh/query-functionality
simorenoh 72de7c8
missing some execution logic and tests
simorenoh 5b805b8
oops
simorenoh 8d8d0c4
fully working queries
simorenoh b597ca8
small fix to query_items()
simorenoh 18319df
Update _cosmos_client_connection_async.py
simorenoh 162c44d
Update _cosmos_client_connection.py
simorenoh ebbac51
documentation update
simorenoh 43f78e6
Merge branch 'Azure:main' into main
simorenoh 470aa5b
updated MIT dates and get_user_client() description
simorenoh 74da690
Update CHANGELOG.md
simorenoh 7104d63
Merge branch 'Azure:main' into main
simorenoh 20718c7
Delete simon_testfile.py
simorenoh d825eaa
Merge pull request #4 from simorenoh/async-client
simorenoh e3c27a5
leftover retry utility
simorenoh 3b778ad
Update README.md
simorenoh c6e352e
docs and removed six package
simorenoh 8971a25
Merge remote-tracking branch 'upstream/main'
simorenoh 52736ac
changes based on comments
simorenoh ad98039
small change in type hints
simorenoh f76c595
updated readme
simorenoh 3f02a65
fixes based on conversations
simorenoh e719869
added missing type comments
simorenoh d03ee05
Merge branch 'Azure:main' into main
simorenoh 02c52ee
update changelog for ci pipeline
simorenoh 2cb4551
added typehints, moved params into keywords, added decorators, made _…
simorenoh cf20d35
changes based on sync with central sdk
simorenoh f456817
remove is_system_key from scripts (only used in execute_sproc)
simorenoh ea9bd16
Revert "remove is_system_key from scripts (only used in execute_sproc)"
simorenoh 709d2eb
async script proxy using composition
simorenoh 3277dd8
pylint
simorenoh a57cb4d
capitalized constants
simorenoh 014578b
Apply suggestions from code review
simorenoh 0d79695
closing python code snippet
simorenoh fdabea1
last doc updates
simorenoh 016d0dd
Update sdk/cosmos/azure-cosmos/CHANGELOG.md
tjprescott 8228aa9
version update
simorenoh 7ae1cd0
Merge branch 'Azure:main' into main
simorenoh 7e8e953
cosmos updates for release
simorenoh 99997e9
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
simorenoh f446308
Merge branch 'Azure-main'
simorenoh bc466d8
Merge branch 'Azure-main'
simorenoh bca2da7
Merge branch 'Azure:main' into main
simorenoh 437895f
fix connection string comma
simorenoh dd4b4a4
Update CHANGELOG.md
simorenoh 79e0b28
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
simorenoh 399f8bc
Merge branch 'Azure:main' into main
simorenoh a3bd2e8
fixing extra await keyword in sample
simorenoh dbf1532
Update CHANGELOG.md
simorenoh c275953
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
simorenoh 140b042
Update CHANGELOG.md
simorenoh 426a616
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
simorenoh 7c551dc
Merge branch 'Azure:main' into main
simorenoh 0678376
Merge branch 'Azure:main' into main
simorenoh a97a3c8
using bicep file to provision test resources
simorenoh 86aee39
Update tests.yml
simorenoh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
param baseName string | ||
|
||
@description('Flag to enable or disable multiple write locations on CosmosDB Account') | ||
param enableMultipleWriteLocations bool | ||
|
||
@description('Default Cosmosdb Account level consistency') | ||
param defaultConsistencyLevel string = 'Session' | ||
|
||
@description('Enable multiple regions, default value is false') | ||
param enableMultipleRegions bool = false | ||
|
||
@description('Location for the Cosmos DB account.') | ||
param location string = resourceGroup().location | ||
|
||
@description('The api version to be used by Bicep to create resources') | ||
param apiVersion string = '2020-04-01' | ||
|
||
var accountName = toLower(baseName) | ||
var resourceId = cosmosAccount.id | ||
var singleRegionConfiguration = [ | ||
{ | ||
locationName: 'East US 2' | ||
provisioningState: 'Succeeded' | ||
failoverPriority: 0 | ||
isZoneRedundant: false | ||
} | ||
] | ||
var multiRegionConfiguration = [ | ||
{ | ||
locationName: 'East US 2' | ||
provisioningState: 'Succeeded' | ||
failoverPriority: 0 | ||
isZoneRedundant: false | ||
} | ||
{ | ||
locationName: 'East US' | ||
provisioningState: 'Succeeded' | ||
failoverPriority: 1 | ||
isZoneRedundant: false | ||
} | ||
] | ||
var locationsConfiguration = (enableMultipleRegions ? multiRegionConfiguration : singleRegionConfiguration) | ||
|
||
resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2020-04-01' = { | ||
name: toLower(accountName) | ||
location: location | ||
kind: 'GlobalDocumentDB' | ||
properties: { | ||
publicNetworkAccess: 'Enabled' | ||
enableAutomaticFailover: false | ||
enableMultipleWriteLocations: enableMultipleWriteLocations | ||
isVirtualNetworkFilterEnabled: false | ||
disableKeyBasedMetadataWriteAccess: false | ||
enableFreeTier: false | ||
enableAnalyticalStorage: false | ||
databaseAccountOfferType: 'Standard' | ||
consistencyPolicy: { | ||
defaultConsistencyLevel: defaultConsistencyLevel | ||
} | ||
locations: locationsConfiguration | ||
} | ||
} | ||
|
||
|
||
output ACCOUNT_HOST string = reference(resourceId, apiVersion).documentEndpoint | ||
output ACCOUNT_KEY string = listKeys(resourceId, apiVersion).primaryMasterKey | ||
simorenoh marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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.
Uh oh!
There was an error while loading. Please reload this page.