Azure / azure-cli

Azure Command-Line Interface
MIT License
3.98k stars 2.96k forks source link

az appconfig kv list fails with "'str' object has no attribute 'get'" when "--resolve-keyvault" is set to true in azure cli 2.58.0 #28519

Closed GABRIELNGBTUC closed 5 months ago

GABRIELNGBTUC commented 6 months ago

Describe the bug

On newer versions of the Azure CLI, using az appconfig kv list while resolving the keyvault references values fails when it did not happen in older versions (tested on 2.49.0 and 2.57.0 successfully)

Related command

az appconfig kv list --name "name" --auth-mode login --key "*" --label "label" --resolve-keyvault true

Errors

'str' object has no attribute 'get'

Issue script & Debug output

cli.knack.cli: Command arguments: ['appconfig', 'kv', 'list', '--name', 'xxx', '--auth-mode', 'login', '--key', '*', '--label', 'xxx', '--resolve-keyvault', 'true', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. Enable VT mode. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x037809D8>, <function OutputProducer.on_global_arguments at 0x03AA7AC8>, <function CLIQuery.on_global_arguments at 0x03AC9898>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'appconfig': ['azure.cli.command_modules.appconfig'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: appconfig 0.007 9 47 cli.azure.cli.core: Total (1) 0.007 9 47 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: Total (0) 0.000 0 0 cli.azure.cli.core: Loaded 9 groups, 47 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : appconfig kv list cli.azure.cli.core: Command table: appconfig kv list cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x04811758>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'D:\Users\GNGANDUB.azure\commands\2024-03-07.08-14-59.appconfig_kv_list.17532.log'. az_command_data_logger: command args: appconfig kv list --name {} --auth-mode {} --key {} --label {} --resolve-keyvault {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x0481D398>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x04850A78>, <function register_cache_arguments..add_cache_arguments at 0x04850AC8>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x03AA7B18>, <function CLIQuery.handle_query_parameter at 0x03AC98E8>, <function register_ids_argument..parse_ids_arguments at 0x04850A28>] cli.azure.cli.core.commands.client_factory: Getting management service client client_type=AppConfigurationManagementClient cli.azure.cli.core.auth.persistence: build_persistence: location='D:\Users\GNGANDUB\.azure\msal_token_cache.bin', encrypt=True cli.azure.cli.core.auth.binary_cache: load: D:\Users\GNGANDUB.azure\msal_http_cache.bin urllib3.uxxx.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None) msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/xxx/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/xxx/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/xxx/kerberos', 'tenant_region_scope': 'EU', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'} msal.application: Broker enabled? None cli.azure.cli.core.commands.client_factory: Getting management service client client_type=AppConfigurationManagementClient urllib3.uxxx.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None) msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/xxx/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/xxx/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/xxx/kerberos', 'tenant_region_scope': 'EU', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'} msal.application: Broker enabled? None cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={} cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={} msal.application: Cache hit an AT msal.telemetry: Generate or reuse correlation_id: 9b696284-fb68-4bb1-be80-9bb9754384a1 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxx/providers/Microsoft.AppConfiguration/configurationStores?api-version=2023-03-01' cli.azure.cli.core.sdk.policies: Request method: 'GET' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '68588620-dc52-11ee-a57c-6c240884d1a0' cli.azure.cli.core.sdk.policies: 'CommandName': 'appconfig kv list' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--name --auth-mode --key --label --resolve-keyvault --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.58.0 (MSI) azsdk-python-core/1.28.0 Python/3.11.7 (Windows-10-10.0.19045-SP0)' cli.azure.cli.core.sdk.policies: 'Authorization': '' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: This request has no body urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxx/providers/Microsoft.AppConfiguration/configurationStores?api-version=2023-03-01 HTTP/1.1" 200 1331 cli.azure.cli.core.sdk.policies: Response status: 200 cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Content-Length': '1331' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11991' cli.azure.cli.core.sdk.policies: 'Link': '</subscriptions/xxx/providers/Microsoft.AppConfiguration/configurationStores?api-version=2023-03-01&$skipToken=xxx>; rel="next"' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'fd52cd35-b199-40c6-aa8d-10aa7c9baff0' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '3bcd69e8-8169-4e15-8b85-59df4d1bbcfb' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'FRANCESOUTH:20240307T071500Z:3bcd69e8-8169-4e15-8b85-59df4d1bbcfb' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 07 Mar 2024 07:14:59 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"value":[{"type":"Microsoft.AppConfiguration/configurationStores","location":"westeurope","identity":{"type":"SystemAssigned","principalId":"c2e3b748-01da-41b2-9df7-d1011b0e5deb","tenantId":"xxx"},"properties":{"provisioningState":"Succeeded","creationDate":"2023-06-06T12:46:48+00:00","endpoint":"https://xxx.azconfig.io","encryption":{"keyVaultProperties":null},"privateEndpointConnections":null,"publicNetworkAccess":"Enabled","disableLocalAuth":true,"softDeleteRetentionInDays":0,"enablePurgeProtection":false},"sku":{"name":"free"},"systemData":{"createdBy":"xxx","createdByType":"User","createdAt":"2023-06-06T12:46:48+00:00","lastModifiedBy":"xxx","lastModifiedByType":"User","lastModifiedAt":"2024-01-11T11:28:01+00:00"},"id":"/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.AppConfiguration/configurationStores/xxx","name":"xxx","tags":{"Project":"xxx","Owner":"xxx"}}],"nextLink":"https://management.azure.com/subscriptions/xxx/providers/Microsoft.AppConfiguration/configurationStores?api-version=2023-03-01&$skipToken=xxx"} cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxx/providers/Microsoft.AppConfiguration/configurationStores?api-version=2023-03-01&$skipToken=xxx' cli.azure.cli.core.sdk.policies: Request method: 'GET' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '68588620-dc52-11ee-a57c-6c240884d1a0' cli.azure.cli.core.sdk.policies: 'CommandName': 'appconfig kv list' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--name --auth-mode --key --label --resolve-keyvault --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.58.0 (MSI) azsdk-python-core/1.28.0 Python/3.11.7 (Windows-10-10.0.19045-SP0)' cli.azure.cli.core.sdk.policies: 'Authorization': '' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: This request has no body urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxx/providers/Microsoft.AppConfiguration/configurationStores?api-version=2023-03-01&$skipToken=xxx HTTP/1.1" 200 28 cli.azure.cli.core.sdk.policies: Response status: 200 cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Content-Length': '28' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11990' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '86b661a0-39f6-4ead-997d-e8aa811848b3' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'e3adbda7-3d14-4d59-a62a-859c7ce6b06e' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'FRANCESOUTH:20240307T071500Z:e3adbda7-3d14-4d59-a62a-859c7ce6b06e' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 07 Mar 2024 07:15:00 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"value":[],"nextLink":null} urllib3.uxxx.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None) msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/xxx/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/xxx/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/xxx/kerberos', 'tenant_region_scope': 'EU', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'} msal.application: Broker enabled? None cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://xxx.azconfig.io/.default',), kwargs={} cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://xxx.azconfig.io/.default',), claims=None, kwargs={} msal.application: Cache hit an AT msal.telemetry: Generate or reuse correlation_id: 10936ffa-fdf3-4aef-9940-8b015aab9324 urllib3.connectionpool: Starting new HTTPS connection (1): xxx.azconfig.io:443 urllib3.connectionpool: https://xxx.azconfig.io:443 "GET /kv?key=%2A&label=xxx&api-version=1.0&$Select= HTTP/1.1" 200 None urllib3.uxxx.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None) msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/xxx/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/xxx/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/xxx/kerberos', 'tenant_region_scope': 'xxx', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'} msal.application: Broker enabled? None cli.azure.cli.core.azclierror: Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appconfig/_kv_helpers.py", line 818, in __resolve_secret File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/keyvault/_client_factory.py", line 250, in data_plane_azure_keyvault_secret_client File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/keyvault/_client_factory.py", line 265, in _prepare_data_plane_azure_keyvault_client AttributeError: 'str' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 664, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 731, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 701, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 334, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appconfig/keyvalue.py", line 737, in list_key File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appconfig/_kv_helpers.py", line 331, in read_kv_from_config_store File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appconfig/_kv_helpers.py", line 827, in resolve_secret knack.uxxx.CLIError: 'str' object has no attribute 'get'

cli.azure.cli.core.azclierror: 'str' object has no attribute 'get' az_command_data_logger: 'str' object has no attribute 'get' cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x04811898>]

Expected behavior

The command display all the key-values matching the filters with the keyvault references replaced by their underlying values

Environment Summary

azure-cli 2.58.0

core 2.58.0 telemetry 1.1.0

Extensions: aks-preview 2.0.0b1 azure-devops 0.26.0 connectedk8s 1.5.1 databricks 0.10.0 logicapp 0.1.2 reservation 0.3.0 resource-graph 2.1.0 ssh 1.1.6

Dependencies: msal 1.26.0 azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'D:\Users\GNGANDUB.azure\cliextensions'

Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:13:08) [MSC v.1937 32 bit (Intel)]

and

azure-cli 2.58.0

core 2.58.0 telemetry 1.1.0

Dependencies: msal 1.26.0 azure-mgmt-resource 23.1.0b2

Python location '/opt/az/bin/python3' Extensions directory '/home/gngandub/.azure/cliextensions'

Python (Linux) 3.11.7 (main, Feb 29 2024, 02:09:26) [GCC 12.2.0]

Additional context

No response

azure-client-tools-bot-prd[bot] commented 6 months ago
Hi @GABRIELNGBTUC Find similar issue https://github.com/Azure/azure-cli/issues/14501.
Issue title Struggling to assign policy to resource group with parameters.
Create time 2020-07-23
Comment number 3

Please confirm if this resolves your issue.

yonzhan commented 6 months ago

Thank you for opening this issue, we will look into it.

albertofori commented 6 months ago

Hi @GABRIELNGBTUC ,

Thank you for reaching out and letting us know of this regression. We recently merged in a fix this issue in PR #28515 . Per the release milestone, this should be available in the next release, i.e., cli version 2.59.0 on April 2, 2024.

In the meantime, in order to avoid any blocking issues, I would recommend using cli version 2.57.0, which should work as expected.

Kindly let me know if this works for you.

Thanks!

cveld commented 6 months ago

All our azure pipelines now break. We have added pip3 install azure-cli==2.57.0 to workaround the issue. But this adds many seconds to our pipeline duration. Any other suggestions? Would be great if you could release a 2.58.1 patch.

albertofori commented 6 months ago

@cveld I see how having to install the CLI version every time could add delays to your pipeline task. To get some context, could you please tell me which pipeline task you are running the azure cli commands with currently? I want to see if there are any workarounds we can have in the near term without you having to change your pipeline substantially.

bobpaulin-wildfork commented 6 months ago

We're hitting this as well. 2.58.0 is the default on your Azure Devops managed VMs saying it's broken until 4/2 is a pretty long time for the 'ubuntu-latest' to remain broken. Please provide a workaround

- task: AzureCLI@2
        displayName: Azure CLI
        inputs:
          azureSubscription: WFF-Retail-SP-Prod-connection
          scriptType: bash
          scriptLocation: inlineScript
          inlineScript: |
            az appconfig kv list ....
cveld commented 6 months ago

@albertofori We use task AzureCLI@2

albertofori commented 6 months ago

@cveld due to this limitation of Azure pipelines where we cannot pin a given version of the CLI, it seems your current workaround is the best way to do this without having to run multiple commands to get the unresolved reference and resolve them with manual calls to keyvault.

albertofori commented 6 months ago

We're hitting this as well. 2.58.0 is the default on your Azure Devops managed VMs saying it's broken until 4/2 is a pretty long time for the 'ubuntu-latest' to remain broken. Please provide a workaround

- task: AzureCLI@2
        displayName: Azure CLI
        inputs:
          azureSubscription: WFF-Retail-SP-Prod-connection
          scriptType: bash
          scriptLocation: inlineScript
          inlineScript: |
            az appconfig kv list ....

@bobpaulin-wildfork My apologies for this. Since you are using the Azure CLI pipeline task, I had wanted to know if @cveld's workaround of running pip3 install azure-cli==2.57.0 works for you.

albertofori commented 5 months ago

The latest version of azure cli 2.59.0 should be out and pipeline failures for this issue should not recur as the pipelines pull in the latest changes. Feel free to reopen this issue if this error persists. BTW, in an attempt to open a feature request for specifying cli version in AzureCli pipeline task, I came across an already existing enhancement request to the pipeline-tasks team for this.

Please feel free to upvote this so it could be, perhaps, prioritized.