Skip to content
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

{Eventhubs} az eventhubs namespace/eventhub authorization-rule: Migrate EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to AAZ #25118

Merged
merged 27 commits into from
Apr 13, 2023

Conversation

schaudhari6254888
Copy link
Contributor

Related command

Description

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


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

@schaudhari6254888 schaudhari6254888 changed the title Eventhub-namespace,Eventhub AuthRule Eventhub-namespace Authrule,Eventhub AuthRule Jan 13, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 13, 2023

Eventhub

@yonzhan yonzhan added this to the Jan 2023 (2023-02-07) milestone Jan 13, 2023
@schaudhari6254888 schaudhari6254888 changed the title Eventhub-namespace Authrule,Eventhub AuthRule [Eventhubs] '#ffffff' 'az eventhubs eventhub authorization-rule' Jan 14, 2023
@schaudhari6254888 schaudhari6254888 changed the title [Eventhubs] '#ffffff' 'az eventhubs eventhub authorization-rule' [Eventhubs] '#ffffff az eventhubs eventhub authorization-rule' Jan 14, 2023
@schaudhari6254888 schaudhari6254888 changed the title [Eventhubs] '#ffffff az eventhubs eventhub authorization-rule' [Eventhubs] 'az eventhubs eventhub authorization-rule' & 'az eventhubs namespace authorization-rule' : Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to aaz Jan 14, 2023
@schaudhari6254888 schaudhari6254888 changed the title [Eventhubs] 'az eventhubs eventhub authorization-rule' & 'az eventhubs namespace authorization-rule' : Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to aaz [Eventhubs] az eventhubs eventhub authorization-rule & az eventhubs namespace authorization-rule: Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to aaz Jan 14, 2023
@schaudhari6254888 schaudhari6254888 changed the title [Eventhubs] az eventhubs eventhub authorization-rule & az eventhubs namespace authorization-rule: Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to aaz [Eventhubs] Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to aaz Feb 8, 2023
@schaudhari6254888
Copy link
Contributor Author

The CI's are failing due to the below test failed.
src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py::test_iot_hub
We required to run this test because in this test Eventhubs Namespace commands are used.
Also this test is running successfully in my Local. I am using python version 3.8.
Can someone let me know What is going wrong here

@schaudhari6254888 schaudhari6254888 marked this pull request as ready for review February 20, 2023 06:23
@schaudhari6254888
Copy link
Contributor Author

The CI's are failing due to the below test failed. src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py::test_iot_hub We required to run this test because in this test Eventhubs Namespace commands are used. Also this test is running successfully in my Local. I am using python version 3.8. Can someone let me know What is going wrong here

This issue is still open. can someone please help me with this.

@evelyn-ys
Copy link
Member

To rerun test for hybrid profile, you need to switch env using az cloud set --name $cloudName --profile $targetProfile first @schaudhari6254888

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Mar 30, 2023

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

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.cmd('iot hub show-connection-string -n {0} --policy-name {1}'.format(hub, policy_name))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you change the test_iot_commands.py file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to record the test_iot_hub test for profile 2019-03-01, please checkout to that profile first az cloud set --name AzureCloud --profile 2019-03-01-hybrid and run test in live again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you want to re-record this test? Is this test related with eventhub module?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses eventhub cmdlet, we are not sure why it is asking for a recording. But, the testcase is buggy from iot hub side and we cannot get it to succeed.

# Create Cluster
self.cmd('eventhubs cluster create --resource-group {rg} --name {clustername} --location {loc} --tags tag1=value1',
self.cmd('eventhubs cluster create --resource-group test-migration --name {clustername} --location eastus --tags tag1=value1',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use fixed personal resource group in test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evelyn-ys, we will need to do it for this test case because cluster is an expensive resource to create and recently our testscripts created too many clusters that were unmonitored and cost us a lot and hence we decided to use a resource group that we can clean up every day to avoid wastage of resources and money.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resource group preparation will do auto clean after test finishing. I don't understand why there will be "too many clusters that were unmonitored". Won't these clusters being deleted during deleting resource group?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Cluster can be deleted only 4 hours after creation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then can you add comments to the test for others who might need to rerun tests after your change to know why and how to prepare for the test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the comments in cluster test file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this PR be merged if this comment appears good?

@schaudhari6254888 schaudhari6254888 changed the title [Eventhubs] Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to aaz [Eventhubs] az eventhubs namespace authorization-rule az eventhubs eventhub authorization-rule: Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to aaz Apr 5, 2023
@schaudhari6254888 schaudhari6254888 changed the title [Eventhubs] az eventhubs namespace authorization-rule az eventhubs eventhub authorization-rule: Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to aaz [Eventhubs] az eventhubs namespace authorization-rule az eventhubs eventhub authorization-rule: Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to AAZ Apr 5, 2023
@schaudhari6254888 schaudhari6254888 marked this pull request as ready for review April 5, 2023 12:20
@@ -107,7 +107,7 @@ def test_eh_namespace(self, resource_group):
self.cmd('eventhubs namespace authorization-rule keys renew --resource-group {rg} --namespace-name {namespacename} --name {authoname} --key {secondary}')

# Delete Authorization Rule
self.cmd('eventhubs namespace authorization-rule delete --resource-group {rg} --namespace-name {namespacename} --name {authoname}')
self.cmd('eventhubs namespace authorization-rule delete --resource-group {rg} --namespace-name {namespacename} --name {authoname} --yes')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this command didn't require --yes for confirmation, then it's breaking change for automation customers because they need to add --yes for their script or else it will hang

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kairu-ms Is there a way to not add --yes confirmation when using aaz to generate delete command?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can remove the confirmation message, to remove --yes when using aaz to generate delete command

@evelyn-ys evelyn-ys changed the title [Eventhubs] az eventhubs namespace authorization-rule az eventhubs eventhub authorization-rule: Migrating EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to AAZ {Eventhubs} az eventhubs namespace/eventhub authorization-rule: Migrate EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to AAZ Apr 13, 2023
@evelyn-ys evelyn-ys merged commit 6d3f598 into Azure:dev Apr 13, 2023
avgale pushed a commit to avgale/azure-cli that referenced this pull request Aug 24, 2023
…rate EventHub entity AuthRule and EventHub Namespace AuthRule cmdlets to AAZ (Azure#25118)

* Eventhub-namespace,Eventhub AuthRule

* CI's Fixes

* More CI fixes

* Updates

* CI's fixes

* CI fixes

* ci agaaaaaaaaaaaaaaaaaaaaaain

* CI's fixes again

* CI's fixessssssssssssssssssssss

* updates

* updates

* updates

* Hybrid profile test_iot_command.py succeeded

* Recording added

* CI's fixes again

* UPdates

* UPdates

* UPdates

* Updates

* updatess removed --yes confirmation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants