Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2fe3ae4
updated sdk version
Jun 15, 2020
0d8a926
replaced ipRangeFilter by IpRules
Jun 15, 2020
e222acc
fixing IpRules
Jun 16, 2020
6224d47
Added autoscale related changes
Jun 16, 2020
063bfa4
tests for autoscale
Jun 16, 2020
3c52f90
Changes for ip_rules
Jun 17, 2020
939f147
init for updates in database account properties
Jun 16, 2020
9ea26bd
final changes and tests for enableFreeTier, serverVersion and enableA…
Jun 17, 2020
4bc3129
error message
Jun 17, 2020
8d48d6e
added analytical ttl in mongo collection
Jun 17, 2020
27bd4d7
fixes
Jun 17, 2020
e62c0b5
analytical_storage_ttl in cassandra table
Jun 17, 2020
0f46ce8
updated all tests
Jun 17, 2020
7a8cfab
[CosmosDB] Allow creating fixed collections (#13950)
MehaKaushik Jun 17, 2020
40beea1
Cherrypicking latest master CosmosDB
shurd Jun 17, 2020
d5be0d4
updated tests
Jun 18, 2020
abd4c7c
Merge upstream/dev
Jun 18, 2020
9516285
fixing lint issue
Jun 18, 2020
71adb50
fixing style check
Jun 19, 2020
5d1f99f
Addressed comments
Jun 26, 2020
39d2ab7
Removed preview tag from RuntimeResources
Jun 26, 2020
ee920e4
fixing cosmosdb in network
Jun 30, 2020
7852ac3
Fixing cosmosdb network tests
Jun 30, 2020
b20c3d7
missed private_endpint_connection yaml
Jun 30, 2020
202bf3a
Merge remote-tracking branch 'upstream/dev' into temp
Jul 2, 2020
665d105
missed private_endpint_connection yaml
Jun 30, 2020
2d07475
re-added network tests
Jul 2, 2020
db0cd1e
re-running tests
Jul 2, 2020
e3e04c1
fixture for CI
Jul 2, 2020
fe96d0a
changes to address github issue 14191
Jul 2, 2020
de2e4bf
nit
Jul 2, 2020
ec6def8
addressed PR comments
Jul 7, 2020
ec8e363
re-ran the network tests for cosmosdb
Jul 7, 2020
d11513c
lint fix
Jul 7, 2020
7c0cd0c
re-added network module tests
Jul 7, 2020
d185e0f
addressed comment
Jul 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixture for CI
  • Loading branch information
Meha Kaushik committed Jul 2, 2020
commit e3e04c15807200f2b7b2bf87a61a2451a1da901c

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -672,80 +672,81 @@ def test_private_link_resource_batch_account(self, resource_group, batch_account
self.cmd('network private-endpoint delete -n {second_endpoint_name} -g {rg}')


class NetworkPrivateLinkCosmosDBScenarioTest(ScenarioTest):
@ResourceGroupPreparer(name_prefix='cli_test_cosmosdb_plr')
def test_private_link_resource_cosmosdb(self, resource_group):
self.kwargs.update({
'acc': self.create_random_name('cli-test-cosmosdb-plr-', 28),
'loc': 'eastus'
})

self.cmd('az cosmosdb create -n {acc} -g {rg}')

self.cmd('az network private-link-resource list --name {acc} --resource-group {rg} --type Microsoft.DocumentDB/databaseAccounts',
checks=[self.check('length(@)', 1), self.check('[0].properties.groupId', 'Sql')])

@ResourceGroupPreparer(name_prefix='cli_test_cosmosdb_pe')
def test_private_endpoint_connection_cosmosdb(self, resource_group):
self.kwargs.update({
'acc': self.create_random_name('cli-test-cosmosdb-pe-', 28),
'loc': 'eastus',
'vnet': self.create_random_name('cli-vnet-', 24),
'subnet': self.create_random_name('cli-subnet-', 24),
'pe': self.create_random_name('cli-pe-', 24),
'pe_connection': self.create_random_name('cli-pec-', 24)
})

# Prepare cosmos db account and network
account = self.cmd('az cosmosdb create -n {acc} -g {rg}').get_output_in_json()
self.kwargs['acc_id'] = account['id']
self.cmd('az network vnet create -n {vnet} -g {rg} -l {loc} --subnet-name {subnet}',
checks=self.check('length(newVNet.subnets)', 1))
self.cmd('az network vnet subnet update -n {subnet} --vnet-name {vnet} -g {rg} '
'--disable-private-endpoint-network-policies true',
checks=self.check('privateEndpointNetworkPolicies', 'Disabled'))

# Create a private endpoint connection
pe = self.cmd('az network private-endpoint create -g {rg} -n {pe} --vnet-name {vnet} --subnet {subnet} -l {loc} '
'--connection-name {pe_connection} --private-connection-resource-id {acc_id} '
'--group-id Sql').get_output_in_json()
self.kwargs['pe_id'] = pe['id']
self.kwargs['pe_name'] = self.kwargs['pe_id'].split('/')[-1]

# Show the connection at cosmos db side
results = self.kwargs['pe_id'].split('/')
self.kwargs[
'pec_id'] = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/{2}/privateEndpointConnections/{3}'.format(
results[2], results[4], self.kwargs['acc'], results[-1])
self.cmd('az network private-endpoint-connection show --id {pec_id}',
checks=self.check('id', '{pec_id}'))
self.cmd(
'az network private-endpoint-connection show --resource-name {acc} --name {pe_name} --resource-group {rg} --type Microsoft.DocumentDB/databaseAccounts',
checks=self.check('name', '{pe_name}'))
self.cmd('az network private-endpoint-connection show --resource-name {acc} -n {pe_name} -g {rg} --type Microsoft.DocumentDB/databaseAccounts',
checks=self.check('name', '{pe_name}'))

# Test approval/rejection
self.kwargs.update({
'approval_desc': 'You are approved!',
'rejection_desc': 'You are rejected!'
})
self.cmd(
'az network private-endpoint-connection approve --resource-name {acc} --resource-group {rg} --name {pe_name} --type Microsoft.DocumentDB/databaseAccounts '
'--description "{approval_desc}"', checks=[
self.check('properties.privateLinkServiceConnectionState.status', 'Approved')
])
self.cmd('az network private-endpoint-connection reject --id {pec_id} '
'--description "{rejection_desc}"',
checks=[
self.check('properties.privateLinkServiceConnectionState.status', 'Rejected')
])
self.cmd('az network private-endpoint-connection list --name {acc} --resource-group {rg} --type Microsoft.DocumentDB/databaseAccounts', checks=[
self.check('length(@)', 1)
])

# Test delete
self.cmd('az network private-endpoint-connection delete --id {pec_id} -y')
# To be uncommented when https://github.com/Azure/azure-cli/issues/14194 is resolved
# class NetworkPrivateLinkCosmosDBScenarioTest(ScenarioTest):
# @ResourceGroupPreparer(name_prefix='cli_test_cosmosdb_plr')
# def test_private_link_resource_cosmosdb(self, resource_group):
# self.kwargs.update({
# 'acc': self.create_random_name('cli-test-cosmosdb-plr-', 28),
# 'loc': 'eastus'
# })

# self.cmd('az cosmosdb create -n {acc} -g {rg}')

# self.cmd('az network private-link-resource list --name {acc} --resource-group {rg} --type Microsoft.DocumentDB/databaseAccounts',
# checks=[self.check('length(@)', 1), self.check('[0].properties.groupId', 'Sql')])

# @ResourceGroupPreparer(name_prefix='cli_test_cosmosdb_pe')
# def test_private_endpoint_connection_cosmosdb(self, resource_group):
# self.kwargs.update({
# 'acc': self.create_random_name('cli-test-cosmosdb-pe-', 28),
# 'loc': 'eastus',
# 'vnet': self.create_random_name('cli-vnet-', 24),
# 'subnet': self.create_random_name('cli-subnet-', 24),
# 'pe': self.create_random_name('cli-pe-', 24),
# 'pe_connection': self.create_random_name('cli-pec-', 24)
# })

# # Prepare cosmos db account and network
# account = self.cmd('az cosmosdb create -n {acc} -g {rg}').get_output_in_json()
# self.kwargs['acc_id'] = account['id']
# self.cmd('az network vnet create -n {vnet} -g {rg} -l {loc} --subnet-name {subnet}',
# checks=self.check('length(newVNet.subnets)', 1))
# self.cmd('az network vnet subnet update -n {subnet} --vnet-name {vnet} -g {rg} '
# '--disable-private-endpoint-network-policies true',
# checks=self.check('privateEndpointNetworkPolicies', 'Disabled'))

# # Create a private endpoint connection
# pe = self.cmd('az network private-endpoint create -g {rg} -n {pe} --vnet-name {vnet} --subnet {subnet} -l {loc} '
# '--connection-name {pe_connection} --private-connection-resource-id {acc_id} '
# '--group-id Sql').get_output_in_json()
# self.kwargs['pe_id'] = pe['id']
# self.kwargs['pe_name'] = self.kwargs['pe_id'].split('/')[-1]

# # Show the connection at cosmos db side
# results = self.kwargs['pe_id'].split('/')
# self.kwargs[
# 'pec_id'] = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/{2}/privateEndpointConnections/{3}'.format(
# results[2], results[4], self.kwargs['acc'], results[-1])
# self.cmd('az network private-endpoint-connection show --id {pec_id}',
# checks=self.check('id', '{pec_id}'))
# self.cmd(
# 'az network private-endpoint-connection show --resource-name {acc} --name {pe_name} --resource-group {rg} --type Microsoft.DocumentDB/databaseAccounts',
# checks=self.check('name', '{pe_name}'))
# self.cmd('az network private-endpoint-connection show --resource-name {acc} -n {pe_name} -g {rg} --type Microsoft.DocumentDB/databaseAccounts',
# checks=self.check('name', '{pe_name}'))

# # Test approval/rejection
# self.kwargs.update({
# 'approval_desc': 'You are approved!',
# 'rejection_desc': 'You are rejected!'
# })
# self.cmd(
# 'az network private-endpoint-connection approve --resource-name {acc} --resource-group {rg} --name {pe_name} --type Microsoft.DocumentDB/databaseAccounts '
# '--description "{approval_desc}"', checks=[
# self.check('properties.privateLinkServiceConnectionState.status', 'Approved')
# ])
# self.cmd('az network private-endpoint-connection reject --id {pec_id} '
# '--description "{rejection_desc}"',
# checks=[
# self.check('properties.privateLinkServiceConnectionState.status', 'Rejected')
# ])
# self.cmd('az network private-endpoint-connection list --name {acc} --resource-group {rg} --type Microsoft.DocumentDB/databaseAccounts', checks=[
# self.check('length(@)', 1)
# ])

# # Test delete
# self.cmd('az network private-endpoint-connection delete --id {pec_id} -y')


class NetworkPrivateLinkWebappScenarioTest(ScenarioTest):
Expand Down