Skip to content

{Network} Update connection monitor creation and related commands#29124

Open
Ishpreet-01 wants to merge 49 commits intoAzure:devfrom
Ishpreet-01:feature-com-mod
Open

{Network} Update connection monitor creation and related commands#29124
Ishpreet-01 wants to merge 49 commits intoAzure:devfrom
Ishpreet-01:feature-com-mod

Conversation

@Ishpreet-01
Copy link
Copy Markdown

@Ishpreet-01 Ishpreet-01 commented Jun 7, 2024

Related commands
az network watcher connection-monitor create
az network watcher connection-monitor output add
az network watcher connection-monitor endpoint add
az network watcher connection-monitor test-configuration add
az network watcher connection-monitor test-group add

Description

We have two versions of connection monitors- Connection Monitor (Classic) and Connection Monitor. The Connection Monitor (Classic) was in a deprecation phase and it completely stopped working on 29th February after which the customers were not able to use the existing commands for creating a connection monitor. These commands were not able to support the newer connection monitor and the customers were not able to create a connection monitor using these commands.

Changes that we have made
In the network module:

  • Modified the output/add.py file
  • Modified the endpoint/add.py file
  • Modified the test-configuration/add.py file
  • Modified the test-group/add.py file
  • Modified the connection_monitor/create.py file
  • Modified the watcher.py file

We have modified these five commands and followed an approach similar to PowerShell according to which the customer will now be able to use these commands and use the output in the subsequent commands for creating a connection monitor. The test group add command is modified to accept a list of sources, destinations and test configurations and then we can use the output of this command in the connection monitor create command in order to create a connection monitor.

Effect of our changes

  • We are now able to create a connection monitor with multiple sources, destinations and test configurations using these commands.
  • The commands support the newer connection monitor and the customers will now be able to use them properly
  • The customer will not have to pass multiple parameters in the command for creating a connection monitor explicitly. The sources, destinations and test configurations will be stored in the test group command output

Testing Guide

For testing the commands, we use the launch.json file where we specified the commands using the args array.
For output add, the command used is:
"network", "watcher", "connection-monitor", "output", "add", "--type", "Workspace", "--workspace-id", "WorkspaceId"
For test configuration add, the command used is:
"network", "watcher", "connection-monitor", "test-configuration", "add", "--name", "myTC", "--frequency", "60", "--protocol", "Http", "--http-method", "Get", "--http-valid-status-codes", "[200,201]", "--http-port", "84", "--http-request-headers", "[{'name':'name1','value':'value1'},{'name':'name2','value':'value2'}]"
For endpoint add, the command used is:
"network", "watcher", "connection-monitor", "endpoint", "add", "--name", "MyVM", "--type", "AzureVM", "--resource-id", "MyResourceId", "--scope-exclude", "[{'address':'10.0.0.25'},{'address':'10.0.0.30'}]", "--coverage-level", "BelowAverage"
For test group add, the command used is:
"network", "watcher", "connection-monitor", "test-group", "add", "--name", "tg1", "--sources", "[{'name':'Google','type':'ExternalAddress','address':'google.com'},{'name':'github','type':'ExternalAddress','address':'github.com','coverageLevel':'BelowAverage','scope':{'exclude':[{'address':'10.0.0.25'},{'address':'10.0.0.30'}]}}]", "--destinations", "[{'name':'MyVM','type':'AzureVM','resourceId':'MyResourceId'}]", "--test-configurations", "[{'name':'tc1','protocol':'Http','frequency':'60','httpConfiguration':{'method':'Get','validStatusCodeRanges':['200','201'],'requestHeaders':[{'name':'name1','value':'value1'},{'name':'name2','value':'value2'}]}}]"
For connection monitor create, the command used is:
"network", "watcher", "connection-monitor", "create", "--name", "cm3", "--network-watcher-name", "testnw", "--resource-group", "testrg", "--location", "eastus2", "--test-groups", "[{'testGroupName':'tg1','sources':[{'name':'VNet1','type':'AzureVNet','resourceId':'resourceId','coverageLevel':'BelowAverage',{name:'VNet2','type':'AzureVNet','resourceId':'resourceId2'}],'destinations':[{'name':'Google','type':'ExternalAddress','address':'google.com'},{name:'Github','type':'ExternalAddress','address':'github.com'}],'testConfigurations':[{'name':'tc1','protocol':'Http',frequency:'60','httpConfiguration':{'method':'Get','validStatusCodeRanges':['200','201'],'requestHeaders':[{'name':'name1','value':'value1'},{'name':'name2','value':'value2'}]}},{'name':'tc3','protocol':'Http',frequency:'60'}]},{'testGroupName':'tg2','sources':[{'name':'Vnet','type':'AzureVNet','resourceId':'resourceId'},{'name':'VM','resourceId':'resourceId','type':'AzureVM'}],'destinations':[{'name':'Github','type':'ExternalAddress','address':'github.com'},{name:'Bing','type':'ExternalAddress','address':'bing.com'}],'testConfigurations':[{'name':'tc2','protocol':'Http',frequency:'120','httpConfiguration':{'method':'Get','validStatusCodeRanges':['200','201']}}]}]"

These commands are tested properly, and we also validated them using the get and delete API calls where we were able to get all the details of the connection monitor created using this command and also delete the CM successfully.

This checklist is used to make sure that common guidelines for a pull request are followed.

…ction monitor with http, tcp and icmp test configs
…onfig1 test to handle this and added relevant tests for cm creation the same
…cope for endpoint and also added tests for the same
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jun 7, 2024

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.11
️✔️3.9
️✔️ams
️✔️latest
️✔️3.11
️✔️3.9
️✔️apim
️✔️latest
️✔️3.11
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.11
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️aro
️✔️latest
️✔️3.11
️✔️3.9
️✔️backup
️✔️latest
️✔️3.11
️✔️3.9
️✔️batch
️✔️latest
️✔️3.11
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.11
️✔️3.9
️✔️billing
️✔️latest
️✔️3.11
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.11
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.11
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.11
️✔️3.9
️✔️config
️✔️latest
️✔️3.11
️✔️3.9
️✔️configure
️✔️latest
️✔️3.11
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.11
️✔️3.9
️✔️container
️✔️latest
️✔️3.11
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.11
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.11
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️dla
️✔️latest
️✔️3.11
️✔️3.9
️✔️dls
️✔️latest
️✔️3.11
️✔️3.9
️✔️dms
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.11
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.11
️✔️3.9
️✔️find
️✔️latest
️✔️3.11
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.11
️✔️3.9
️✔️identity
️✔️latest
️✔️3.11
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️kusto
️✔️latest
️✔️3.11
️✔️3.9
️✔️lab
️✔️latest
️✔️3.11
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️maps
️✔️latest
️✔️3.11
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.11
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.11
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.11
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.11
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.11
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.11
️✔️3.9
️✔️profile
️✔️latest
️✔️3.11
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.11
️✔️3.9
️✔️redis
️✔️latest
️✔️3.11
️✔️3.9
️✔️relay
️✔️latest
️✔️3.11
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️role
️✔️latest
️✔️3.11
️✔️3.9
️✔️search
️✔️latest
️✔️3.11
️✔️3.9
️✔️security
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.11
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.11
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.11
️✔️3.9
️✔️sql
️✔️latest
️✔️3.11
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.11
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.11
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️util
️✔️latest
️✔️3.11
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Jun 19, 2024

image

unnecessary changes

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Jun 19, 2024

please provide the pr in aaz repo

@necusjz necusjz changed the title [Network Watcher] Change: Update connection monitor creation and related commands {Network} Update connection monitor creation and related commands Jun 19, 2024
@Ishpreet-01 Ishpreet-01 requested a review from bebound as a code owner June 19, 2024 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-quality-productivity-squad Auto-Assign Auto assign by bot Network az network vnet/lb/nic/dns/etc...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants