Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def default_api_version(self):
}),
ResourceType.MGMT_MSI: '2023-01-31',
ResourceType.MGMT_APPSERVICE: '2022-03-01',
ResourceType.MGMT_IOTHUB: '2022-04-30-preview',
ResourceType.MGMT_IOTHUB: '2023-06-30-preview',
ResourceType.MGMT_IOTDPS: '2021-10-15',
ResourceType.MGMT_IOTCENTRAL: '2021-11-01-preview',
ResourceType.MGMT_ARO: '2023-04-01',
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

10,755 changes: 5,180 additions & 5,575 deletions src/azure-cli/azure/cli/command_modules/iot/tests/latest/recordings/test_iot_hub.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ def test_iot_hub(self, resource_group, resource_group_location, storage_account)
policy = self.cmd('iot hub policy renew-key --hub-name {0} -n {1} --renew-key Primary'.format(hub, policy_name),
checks=[self.check('keyName', policy_name)]).get_output_in_json()

policy_name_conn_str_pattern = r'^HostName={0}.azure-devices.net;SharedAccessKeyName={1};SharedAccessKey={2}'.format(
policy_name_conn_str = r'HostName={0}.azure-devices.net;SharedAccessKeyName={1};SharedAccessKey={2}'.format(
hub, policy_name, policy['primaryKey'])

# Test policy_name connection-string 'az iot hub show-connection-string'
self.cmd('iot hub show-connection-string -n {0} --policy-name {1}'.format(hub, policy_name), checks=[
self.check_pattern('connectionString', policy_name_conn_str_pattern)
self.check('connectionString', policy_name_conn_str)
])

# Test swap keys 'az iot hub policy renew-key'
Expand Down Expand Up @@ -390,7 +390,7 @@ def test_iot_hub(self, resource_group, resource_group_location, storage_account)
self.cmd('iot hub devicestream show -n {0} -g {1}'.format(hub, rg), checks=self.is_empty())

# Test 'az iot hub message-enrichment create'
real_endpoints = 'event'
real_endpoints = 'events'
fake_endpoints = 'events fake_endpoint'
key = 'key'
fake_key = 'fake_key'
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ def test_private_endpoint_connection_apim(self, resource_group, resource_group_l
result = self.cmd(
'network private-endpoint-connection reject -g {resource_group} --resource-name {service_name} -n {endpoint_request} --type Microsoft.ApiManagement/service ',
checks=[self.check('properties.privateLinkServiceConnectionState.status', 'Rejected')])

self.cmd("az apim wait --updated --name {service_name} --resource-group {resource_group}")

# Create second endpoint with manual approval
Expand All @@ -1323,7 +1323,7 @@ def test_private_endpoint_connection_apim(self, resource_group, resource_group_l
self.cmd(
'network private-endpoint-connection approve -g {resource_group} --resource-name {service_name} -n {endpoint_request2} --type Microsoft.ApiManagement/service',
checks=[self.check('properties.privateLinkServiceConnectionState.status', 'Approved')])

self.cmd("az apim wait --updated --name {service_name} --resource-group {resource_group}")

self.cmd(
Expand All @@ -1337,7 +1337,7 @@ def test_private_endpoint_connection_apim(self, resource_group, resource_group_l

self.cmd("az apim wait --updated --name {service_name} --resource-group {resource_group}")
self.cmd("az apim wait --updated --name {service_name} --resource-group {resource_group}")

# Remove endpoint
self.cmd(
'network private-endpoint-connection delete -g {resource_group} --resource-name {service_name} -n {endpoint_request} --type Microsoft.ApiManagement/service -y')
Expand Down Expand Up @@ -1395,7 +1395,7 @@ def test_private_link_resource_event_grid(self, resource_group):
self.cmd(
'network private-link-resource list --id {namespace_id}',
checks=[self.check('length(@)', 1), self.check('[0].properties.groupId', 'topic')])

partner_registration_id = self.cmd('az eventgrid partner registration create --name {partner_registration_name} --resource-group {rg}',).get_output_in_json()['id']
self.kwargs.update({
'partner_registration_id': partner_registration_id
Expand Down Expand Up @@ -3815,6 +3815,7 @@ def test_private_endpoint_connection_grafana(self, resource_group):

class NetworkPrivateLinkDeviceUpdateScenarioTest(ScenarioTest):
@live_only()
@AllowLargeResponse(4096)
@ResourceGroupPreparer(name_prefix='test_deviceupdate_private_endpoint', random_name_length=40, location="westus2")
def test_private_link_endpoint_deviceupdate(self, resource_group):
self.kwargs.update({
Expand Down Expand Up @@ -4040,7 +4041,7 @@ def test_private_link_endpoint_ml_registry(self, resource_group):

self.cmd('extension add --name ml')

# Create registry
# Create registry
with open('registry.yml', 'w') as the_file:
the_file.write(f'name: {self.kwargs["registry_name"]}\nlocation: {self.kwargs["location"]}\nreplication_locations:\n - location: {self.kwargs["location"]}')

Expand Down Expand Up @@ -4095,7 +4096,7 @@ def test_private_link_endpoint_ml_registry(self, resource_group):
time.sleep(90)
self.cmd('network private-endpoint-connection show --id {private-endpoint-connection-id}',
expect_failure=True)

class NetworkPrivateLinkMicrosoftMonitorAccountsRegistryScenarioTest(ScenarioTest):
@live_only()
@ResourceGroupPreparer(name_prefix='test_monitor_accounts_registries_pe_', random_name_length=40, location="eastus2euap")
Expand Down Expand Up @@ -4223,28 +4224,28 @@ def test_private_endpoint_connection_mysql_flexible_server(self, resource_group)
self.cmd('network vnet subnet update -n {subnet_name} --vnet-name {vnet_name} -g {resource_group} '
'--disable-private-endpoint-network-policies true',
checks=self.check('privateEndpointNetworkPolicies', 'Disabled'))

#Create MySQL Server
result = self.cmd('mysql flexible-server create -g {rg} --name {server_name} --public-access none').get_output_in_json()
self.kwargs['flexible_sever_id'] = result['id']
self.kwargs['flexible_sever_id'] = result['id']

#Create Endpoint
result = self.cmd('network private-endpoint create -g {resource_group} -n {endpoint_name} --vnet-name {vnet_name} --subnet {subnet_name} '
'--connection-name {endpoint_conn_name} --private-connection-resource-id {flexible_sever_id} '
'--group-id mysqlServer --manual-request').get_output_in_json()
self.assertTrue(self.kwargs['endpoint_name'].lower() in result['name'].lower())

result = self.cmd('network private-endpoint-connection list -g {resource_group} -n {server_name} --type Microsoft.DBforMySQL/flexibleServers', checks=[
self.check('length(@)', 1),
]).get_output_in_json()
self.kwargs['private_endpoint_connection_id'] = result[0]['id']

self.cmd('network private-endpoint-connection approve --id {private_endpoint_connection_id} --description Approved',
checks=[self.check('properties.privateLinkServiceConnectionState.status', 'Approved')])

#Remove Endpoint
self.cmd('network private-endpoint-connection delete --id {private_endpoint_connection_id} -y')

class NetworkPrivateLinkCloudHsmClustersScenarioTest(ScenarioTest):
@ResourceGroupPreparer(name_prefix='cli_test_chsm_plr_rg')
def test_chsm_private_link_resource(self, resource_group):
Expand All @@ -4259,7 +4260,7 @@ def test_chsm_private_link_resource(self, resource_group):

# Create CHSM Resource
self.cmd('resource create -g {rg} -n {chsm_name} --resource-type {type} --location {loc} --is-full-object --properties "{properties}"')

# Show resource was created
self.cmd('network private-link-resource list '
'--name {chsm_name} '
Expand Down Expand Up @@ -4312,7 +4313,7 @@ def test_chsm_private_endpoint_connection(self, resource_group):
self.kwargs['pe_id'] = pe['id']

# Show the private endpoint connection
result = self.cmd('network private-endpoint-connection list --name {chsm_name} -g {rg} --type {type}',
result = self.cmd('network private-endpoint-connection list --name {chsm_name} -g {rg} --type {type}',
checks=self.check('length(@)', 1)).get_output_in_json()
print(result)
self.kwargs['hsm_pe_id'] = result[0]['id']
Expand Down Expand Up @@ -4369,7 +4370,7 @@ def test_chsm_private_endpoint_connection(self, resource_group):
self.cmd('az resource delete --name {chsm_name} -g {rg} --resource-type {type}')

class NetworkPrivateLinkCosmosDBPostgresScenarioTest(ScenarioTest):

@ResourceGroupPreparer(name_prefix='cli_test_cosmosdb_pg')
def test_private_link_resource_cosmosdb_postgres(self, resource_group):
self.kwargs.update({
Expand All @@ -4385,7 +4386,7 @@ def test_private_link_resource_cosmosdb_postgres(self, resource_group):
'--coordinator-storage {storage} '
'--administrator-login-password {pass} '
)

self.cmd('az cosmosdb postgres cluster wait --created -n {cluster_name} -g {rg}')

self.cmd('az network private-link-resource list --name {cluster_name} --resource-group {rg} --type Microsoft.DBforPostgreSQL/serverGroupsv2',
Expand Down Expand Up @@ -4425,7 +4426,7 @@ def test_private_endpoint_connection_cosmosdb_postgres(self, resource_group):
'--administrator-login-password {pass} '
).get_output_in_json()
self.kwargs['cluster_id'] = cluster['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} '
Expand Down
Loading