-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Role] BREAKING CHANGE: az role assignment list: Drop --include-classic-administrators argument
#29470
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
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @jiasli, |
❌AzureCLI-BreakingChangeTest
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
|
|
BREAKING CHANGE |
|
Sample classic admins returned by {
"id": "NA(classic admins)",
"name": "NA(classic admins)",
"principalId": "00000000-0000-0000-0000-000000000000",
"principalName": "[email protected]",
"roleDefinitionId": "NA(classic admin role)",
"roleDefinitionName": "ServiceAdministrator;AccountAdministrator",
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
},
{
"id": "NA(classic admins)",
"name": "NA(classic admins)",
"principalId": "00000000-0000-0000-0000-000000000000",
"principalName": "[email protected]",
"roleDefinitionId": "NA(classic admin role)",
"roleDefinitionName": "CoAdministrator",
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
}, |
|
|
||
| def _backfill_assignments_for_co_admins(cli_ctx, auth_client, assignee=None): | ||
| worker = MultiAPIAdaptor(cli_ctx) | ||
| co_admins = auth_client.classic_administrators.list() # known swagger bug on api-version handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what the bug is.
|
According to https://learn.microsoft.com/en-us/azure/role-based-access-control/classic-administrators, the full deprecation of classic admins has been extended to April 3, 2024. Putting this PR into backlog. |
| ResourceType.MGMT_AUTHORIZATION: SDKProfile('2015-07-01', { | ||
| 'classic_administrators': '2015-06-01' | ||
| }), | ||
| ResourceType.MGMT_AUTHORIZATION: '2015-07-01', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing ResourceType.MGMT_AUTHORIZATION's value from an SDKProfile to str causes test failure:
2025-04-22T10:21:46.6275851Z ________________ ProviderOperationTest.test_provider_operation _________________
2025-04-22T10:21:46.6276390Z [gw0] linux -- Python 3.12.10 /mnt/vss/_work/1/s/env/bin/python
2025-04-22T10:21:46.6276919Z self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f482d0c7e00>
2025-04-22T10:21:46.6277448Z cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f482d3db950>
2025-04-22T10:21:46.6277964Z command = 'provider operation show --namespace microsoft.compute'
2025-04-22T10:21:46.6278413Z expect_failure = False
2025-04-22T10:21:46.6278573Z
2025-04-22T10:21:46.6278994Z def _in_process_execute(self, cli_ctx, command, expect_failure=False):
2025-04-22T10:21:46.6279678Z from io import StringIO
2025-04-22T10:21:46.6280135Z from vcr.errors import CannotOverwriteExistingCassetteException
2025-04-22T10:21:46.6280535Z
2025-04-22T10:21:46.6280866Z if command.startswith('az '):
2025-04-22T10:21:46.6281239Z command = command[3:]
2025-04-22T10:21:46.6281548Z
2025-04-22T10:21:46.6281872Z stdout_buf = StringIO()
2025-04-22T10:21:46.6282251Z logging_buf = StringIO()
2025-04-22T10:21:46.6282888Z try:
2025-04-22T10:21:46.6283343Z # issue: stderr cannot be redirect in this form, as a result some failure information
2025-04-22T10:21:46.6283825Z # is lost when command fails.
2025-04-22T10:21:46.6284306Z > self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
2025-04-22T10:21:46.6284579Z
2025-04-22T10:21:46.6284982Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:303:
2025-04-22T10:21:46.6285454Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-04-22T10:21:46.6285970Z env/lib/python3.12/site-packages/knack/cli.py:245: in invoke
2025-04-22T10:21:46.6286424Z exit_code = self.exception_handler(ex)
2025-04-22T10:21:46.6286887Z src/azure-cli-core/azure/cli/core/__init__.py:129: in exception_handler
2025-04-22T10:21:46.6287333Z return handle_exception(ex)
2025-04-22T10:21:46.6287759Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-04-22T10:21:46.6287970Z
2025-04-22T10:21:46.6288418Z ex = AttributeError("'str' object has no attribute 'provider_operations_metadata'")
2025-04-22T10:21:46.6288895Z args = (), kwargs = {}
2025-04-22T10:21:46.6289040Z
2025-04-22T10:21:46.6289482Z def _handle_main_exception(ex, *args, **kwargs): # pylint: disable=unused-argument
2025-04-22T10:21:46.6290041Z if isinstance(ex, CannotOverwriteExistingCassetteException):
2025-04-22T10:21:46.6290590Z # This exception usually caused by a no match HTTP request. This is a product error
2025-04-22T10:21:46.6290883Z # that is caused by change of SDK invocation.
2025-04-22T10:21:46.6291103Z raise ex
2025-04-22T10:21:46.6291270Z
2025-04-22T10:21:46.6291457Z > raise CliExecutionError(ex)
2025-04-22T10:21:46.6291773Z E azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception AttributeError during execution and fails the command.
2025-04-22T10:21:46.6291948Z
2025-04-22T10:21:46.6292185Z src/azure-cli-testsdk/azure/cli/testsdk/patches.py:35: CliExecutionError
2025-04-22T10:21:46.6292628Z
2025-04-22T10:21:46.6292873Z During handling of the above exception, another exception occurred:
2025-04-22T10:21:46.6293008Z
2025-04-22T10:21:46.6293292Z self = <azure.cli.command_modules.resource.tests.hybrid_2018_03_01.test_resource.ProviderOperationTest testMethod=test_provider_operation>
2025-04-22T10:21:46.6293486Z
2025-04-22T10:21:46.6293676Z def test_provider_operation(self):
2025-04-22T10:21:46.6293929Z > self.cmd('provider operation show --namespace microsoft.compute', checks=[
2025-04-22T10:21:46.6294242Z self.check('id', '/providers/Microsoft.Authorization/providerOperations/Microsoft.Compute'),
2025-04-22T10:21:46.6294547Z self.check('type', 'Microsoft.Authorization/providerOperations')
2025-04-22T10:21:46.6294762Z ])
2025-04-22T10:21:46.6294826Z
2025-04-22T10:21:46.6295082Z src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2018_03_01/test_resource.py:240:
2025-04-22T10:21:46.6295362Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-04-22T10:21:46.6295632Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:177: in cmd
2025-04-22T10:21:46.6295927Z return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
2025-04-22T10:21:46.6296247Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:252: in __init__
2025-04-22T10:21:46.6296526Z self._in_process_execute(cli_ctx, command, expect_failure=expect_failure)
2025-04-22T10:21:46.6296958Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:315: in _in_process_execute
2025-04-22T10:21:46.6297195Z raise ex.exception
2025-04-22T10:21:46.6297438Z env/lib/python3.12/site-packages/knack/cli.py:233: in invoke
2025-04-22T10:21:46.6297688Z cmd_result = self.invocation.execute(args)
2025-04-22T10:21:46.6297943Z src/azure-cli-core/azure/cli/core/commands/__init__.py:666: in execute
2025-04-22T10:21:46.6298161Z raise ex
2025-04-22T10:21:46.6298404Z src/azure-cli-core/azure/cli/core/commands/__init__.py:734: in _run_jobs_serially
2025-04-22T10:21:46.6298692Z results.append(self._run_job(expanded_arg, cmd_copy))
2025-04-22T10:21:46.6298970Z src/azure-cli-core/azure/cli/core/commands/__init__.py:703: in _run_job
2025-04-22T10:21:46.6299211Z result = cmd_copy(params)
2025-04-22T10:21:46.6299435Z src/azure-cli-core/azure/cli/core/commands/__init__.py:336: in __call__
2025-04-22T10:21:46.6299694Z return self.handler(*args, **kwargs)
2025-04-22T10:21:46.6299957Z src/azure-cli-core/azure/cli/core/commands/command_operation.py:362: in handler
2025-04-22T10:21:46.6300236Z show_exception_handler(ex)
2025-04-22T10:21:46.6300498Z src/azure-cli-core/azure/cli/core/commands/arm.py:432: in show_exception_handler
2025-04-22T10:21:46.6300728Z raise ex
2025-04-22T10:21:46.6300960Z src/azure-cli-core/azure/cli/core/commands/command_operation.py:360: in handler
2025-04-22T10:21:46.6301226Z return op(**command_args)
2025-04-22T10:21:46.6301443Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-04-22T10:21:46.6301545Z
2025-04-22T10:21:46.6301767Z cmd = <azure.cli.core.commands.AzCliCommand object at 0x7f482b5608f0>
2025-04-22T10:21:46.6302020Z resource_provider_namespace = 'microsoft.compute'
2025-04-22T10:21:46.6302127Z
2025-04-22T10:21:46.6305438Z def show_provider_operations(cmd, resource_provider_namespace):
2025-04-22T10:21:46.6305883Z > version = getattr(get_api_version(cmd.cli_ctx, ResourceType.MGMT_AUTHORIZATION), 'provider_operations_metadata')
2025-04-22T10:21:46.6306240Z E AttributeError: 'str' object has no attribute 'provider_operations_metadata'
2025-04-22T10:21:46.6306373Z
2025-04-22T10:21:46.6306620Z src/azure-cli/azure/cli/command_modules/resource/custom.py:3124: AttributeErrorThis is because azure.cli.command_modules.resource.custom.show_provider_operations tries to get the API version of provider_operations_metadata to call Provider Operations Metadata - Get API:
| version = getattr(get_api_version(cmd.cli_ctx, ResourceType.MGMT_AUTHORIZATION), 'provider_operations_metadata') |
az role assignment list: Drop --include-classic-administrators argumentaz role assignment list: Drop --include-classic-administrators argument
Related command
az role assignment listDescription
Close #27199
#29404 added deprecation message for
--include-classic-administrators. This PR drops--include-classic-administratorsargument.Testing Guide