-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
{Identity} az identity
: Upgrade api-version 2023-01-31 for managed identity
#25418
Conversation
Identity |
The name "MSI" has been deprecated long ago. We should consider renaming it to "managed identity": https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
|
az identity
: Upgrade MSI version 2023-01-31az identity
: Upgrade api-version 2023-01-31 for managed identity
def _msi_list_resources_client(cli_ctx, **_): | ||
return _msi_client_factory(cli_ctx, api_version='2021-09-30-preview').user_assigned_identities |
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.
Please add a comment to explain why we need to specify the ad-hoc api-version
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.
Ad-hoc API version can leads to scripts/trim_sdk.py
script failure.
It should be declared at
azure-cli/src/azure-cli-core/azure/cli/core/profiles/_shared.py
Lines 411 to 428 in 085dacc
AD_HOC_API_VERSIONS = { | |
ResourceType.MGMT_NETWORK: { | |
'appservice_network': '2020-04-01', | |
'appservice_ensure_subnet': '2019-02-01' | |
}, | |
ResourceType.MGMT_CONTAINERREGISTRY: { | |
# src/azure-cli/azure/cli/command_modules/acr/_client_factory.py:8 | |
'VERSION_2019_05_01_PREVIEW': "2019-05-01-preview", | |
'VERSION_2019_06_01_PREVIEW': "2019-06-01-preview", | |
'VERSION_2020_11_01_PREVIEW': "2020-11-01-preview", | |
'VERSION_2021_08_01_PREVIEW': "2021-08-01-preview", | |
'VERSION_2022_02_01_PREVIEW': "2022-02-01-preview", | |
}, | |
ResourceType.MGMT_CONTAINERSERVICE: { | |
# src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_custom.py:50 | |
'ManagedClusterAddonProfile': '2020-03-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.
Hi @jiasli, declaration has been added here. Could you please review this change?
|
||
|
||
def _msi_list_resources_client(cli_ctx, **_): | ||
return _msi_client_factory(cli_ctx, api_version='2021-09-30-preview').user_assigned_identities |
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.
Please use the latest available api-version
return _msi_client_factory(cli_ctx, api_version='2021-09-30-preview').user_assigned_identities | |
return _msi_client_factory(cli_ctx, api_version='2022-01-31-preview').user_assigned_identities |
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.
Hi @isolenov,
we CLI use the api-version 2022-01-31-preview
before upgrading and it supports listAssociatedResources
command. Could you please help to confirm which version (2022-01-31-preview
or 2021-09-30-preview
) should be used for listAssociatedResources
command?
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.
@yanzhudd @zhoxing-ms please use latest preview version 2022-01-31-preview
for listAssociatedResources
…-09-30-preview to 2022-01-31-preview
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.
Ad-hoc API version should be forbidden unless declared.
58ba8f4
@jiasli Since there is a breaking change in the new version of MSI (a command is not supported), ad-hoc api version here is used for avoiding the breaking change. And we have discussed with the service team, and it seems this approach work the best. The declaration for the ad-hoc api version is added, could you please help to review this change? |
…identity (Azure#25418) * upgrade msi version * fix tests and support listAssociatedResources commands by using multi-api package * fix tests and linter check * reslove tests * change api-version used for listAssociatedResources command from 2021-09-30-preview to 2022-01-31-preview * fix credential scan * fix credential scan * add declaration for ad-hoc API version
ResourceType.MGMT_MSI: { | ||
'user_assigned_identities': '2022-01-31-preview', |
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.
It's recommended to add a comment showing where 2022-01-31-preview
is used, like L425.
In this case, it'll be
# src/azure-cli/azure/cli/command_modules/identity/_client_factory.py:18
Related command
az identity
Description
MSI version 2023-01-31 is released.
Close: #25380
Testing Guide
History Notes
{Identity}
az identity
: Upgrade api-version 2023-01-31 of managed identity for commands exceptaz identity list-resources
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.