Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

Linux AZ CLI extension set Failed to find the latest version for the extension "AzurePolicyforLinux" #29848

Open n-morrison opened 2 months ago

n-morrison commented 2 months ago

Describe the bug

When Running the Command line with Correct Sub, Tenant, Res Grp, VM name works with windows powerShell, but does not work with Linux , even tried the Azure Cloud Shell. Attemping Run the following Command ( Sanitized details ) ( see Related Command )

Related command

az vm extension set --resource-group "EAST-DEV-RG" --vm-name "HOSTNAME926" --name "AzurePolicyforLinux" --publisher "Microsoft.GuestConfiguration.ConfigurationforLinux" --force-update --verbose;

Errors

Failed to find the latest version for the extension "AzurePolicyforLinux" Command ran in 1.632 seconds (init: 0.242, invoke: 1.389)

Issue script & Debug output

cli.knack.cli: Command arguments: ['vm', 'extension', 'set', '--resource-group', 'SANTIZED_RESC_GRP', '--vm-name', 'HOSTNAME926', '--name', 'AzurePolicyforLinux', '--publisher', 'Microsoft.GuestConfiguration.ConfigurationforLinux', '--force-update', '--verbose', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f0793944ae8>, <function OutputProducer.on_global_arguments at 0x7f079348ac80>, <function CLIQuery.on_global_arguments at 0x7f079322c158>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'vm': ['azure.cli.command_modules.vm'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: vm 0.208 55 289 cli.azure.cli.core: Total (1) 0.208 55 289 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 55 groups, 289 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : vm extension set cli.azure.cli.core: Command table: vm extension set cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f07921be2f0>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/SANITIZED_ACCT_NAME/.azure/commands/2024-09-04.16-09-34.vm_extension_set.12356.log'. az_command_data_logger: command args: vm extension set --resource-group {} --vm-name {} --name {} --publisher {} --force-update --verbose --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f0791d441e0>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f0791c8d950>, <function register_cache_arguments..add_cache_arguments at 0x7f0791c8da60>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f079348ad08>, <function CLIQuery.handle_query_parameter at 0x7f079322c1e0>, <function register_ids_argument..parse_ids_arguments at 0x7f0791c8d9d8>] cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ComputeManagementClient cli.azure.cli.core.auth.persistence: build_persistence: location='/home/SANITIZED_ACCT_NAME/.azure/msal_token_cache.json', encrypt=False cli.azure.cli.core.auth.binary_cache: load: /home/SANITIZED_ACCT_NAME/.azure/msal_http_cache.bin urllib3.util.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.us/SANTIZED_TENANT_ID/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/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.us/SANTIZED_TENANT_ID/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.us/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/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.us/SANTIZED_TENANT_ID/kerberos', 'tenant_region_scope': 'USGov', 'tenant_region_sub_scope': 'DODCON', 'cloud_instance_name': 'microsoftonline.us', 'cloud_graph_host_name': 'graph.microsoftazure.us', 'msgraph_host': 'graph.microsoft.us', 'rbac_url': 'https://pasff.usgovcloudapi.net'} cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.usgovcloudapi.net//.default',), kwargs={} cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.usgovcloudapi.net//.default',), kwargs={} msal.application: Cache hit an AT msal.telemetry: Generate or reuse correlation_id: 2c7a0880-e01f-45d1-9d75-47d386d22671 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.usgovcloudapi.net/subscriptions/SUBSCRIPTION_ID_SANTIZED/resourceGroups/SANTIZED_RESC_GRP/providers/Microsoft.Compute/virtualMachines/HOSTNAME926?$expand=instanceView&api-version=2022-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': 'fc6424ea-6b01-11ef-a76e-001dd80122d4' cli.azure.cli.core.sdk.policies: 'CommandName': 'vm extension set' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--resource-group --vm-name --name --publisher --force-update --verbose --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.38.2 (RPM) azsdk-python-azure-mgmt-compute/27.1.0 Python/3.6.8 (Linux-3.10.0-1160.119.1.el7.x86_64-x86_64-with-redhat-7.9-Maipo)' 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.usgovcloudapi.net:443 urllib3.connectionpool: https://management.usgovcloudapi.net:443 "GET /subscriptions/SUBSCRIPTION_ID_SANTIZED/resourceGroups/SANTIZED_RESC_GRP/providers/Microsoft.Compute/virtualMachines/HOSTNAME926?$expand=instanceView&api-version=2022-03-01 HTTP/1.1" 200 None 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: 'Transfer-Encoding': 'chunked' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Content-Encoding': 'gzip' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'Vary': 'Accept-Encoding' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/LowCostGetSubscriptionMaximum;23999,Microsoft.Compute/LowCostGetResource;34' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '10356728-a247-4017-b59f-926d006d9aa6' cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '5271' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'd01d2989-0d75-4802-8ffe-c1a77125a982' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'USDODCENTRAL:20240904T210935Z:d01d2989-0d75-4802-8ffe-c1a77125a982' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Wed, 04 Sep 2024 21:09:35 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: { "name": "HOSTNAME926", "id": "/subscriptions/SUBSCRIPTION_ID_SANTIZED/resourceGroups/SANTIZED_RESC_GRP/providers/Microsoft.Compute/virtualMachines/HOSTNAME926", "type": "Microsoft.Compute/virtualMachines", "location": "usgovvirginia", "tags": { "CKID": "316", "Environment": "DEVTEST", "ProjectName": "VA MPI", "VAAzureProgram": "SANTIZED_TAG", "VAECID": "SANTIZED_TAG", "SANTIZED_TAG_Environment": "DEV", "SANTIZED_TAG_Function": "PSIM Weblogic", "SANTIZED_TAG_SubComponent": "PSIM", "SANTIZED_TAG_Platform": "MVI", "SANTIZED_TAG_Role": "PWL", "OS": "Linux" }, "identity": { "type": "SystemAssigned", "principalId": "SANTIZED_PRINCL_ID", "tenantId": "SANTIZED_TENANT_ID" }, "properties": { "hardwareProfile": { "vmSize": "Standard_F4s_v2" }, "provisioningState": "Succeeded", "vmId": "SANTIZED_VM_ID", "storageProfile": { "osDisk": { "osType": "Linux", "name": "HOSTNAME926-osdisk-20201111-040542_OS", "createOption": "Attach", "caching": "ReadWrite", "managedDisk": { "storageAccountType": "StandardSSD_LRS", "id": "/subscriptions/SUBSCRIPTION_ID_SANTIZED/resourceGroups/SANTIZED_RESC_GRP/providers/Microsoft.Compute/disks/HOSTNAME926-osdisk-20201111-040542_OS" }, "deleteOption": "Detach", "diskSizeGB": 60 }, "dataDisks": [ { "lun": 0, "name": "HOSTNAME926-datadisk-002-20201111-040542", "createOption": "Attach", "caching": "None", "managedDisk": { "storageAccountType": "StandardSSD_LRS", "id": "/subscriptions/SUBSCRIPTION_ID_SANTIZED/resourceGroups/SANTIZED_RESC_GRP/providers/Microsoft.Compute/disks/HOSTNAME926-datadisk-002-20201111-040542" }, "deleteOption": "Detach", "diskSizeGB": 100, "toBeDetached": false } ] }, "networkProfile": {"networkInterfaces":[{"id":"/subscriptions/SUBSCRIPTION_ID_SANTIZED/resourceGroups/SANTIZED_RESC_GRP/providers/Microsoft.Network/networkInterfaces/HOSTNAME926-nic","properties":{"primary":true}}]}, "diagnosticsProfile": { "bootDiagnostics": { "enabled": true, "storageUri": "https://SANTIZED_STORAGE_URI.blob.core.usgovcloudapi.net/" } }, "instanceView": { "computerName": "HOSTNAME926.SANTIZED_DOMAIN", "osName": "redhat", "osVersion": "7.9", "vmAgent": { "vmAgentVersion": "2.10.0.8", "statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Ready", "message": "Guest Agent is running", "time": "2024-09-04T21:08:36+00:00" } ], "extensionHandlers": [ { "type": "Microsoft.Azure.Monitor.AzureMonitorLinuxAgent", "typeHandlerVersion": "1.29.4", "status": { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Ready", "message": "Plugin enabled" } }, { "type": "Microsoft.GuestConfiguration.ConfigurationforLinux", "typeHandlerVersion": "1.26.38", "status": { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Ready", "message": "Plugin enabled" } }, { "type": "Microsoft.Azure.RecoveryServices.VMSnapshotLinux", "typeHandlerVersion": "1.0.9220.0", "status": { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Ready", "message": "Plugin enabled" } } ] }, "disks": [ { "name": "HOSTNAME926-osdisk-20201111-040542_OS", "statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Provisioning succeeded", "time": "2024-04-26T19:04:52.4971084+00:00" } ] }, { "name": "HOSTNAME926-datadisk-002-20201111-040542", "statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Provisioning succeeded", "time": "2024-04-26T19:04:52.4971084+00:00" } ] } ], "bootDiagnostics": { "consoleScreenshotBlobUri": "https://SANTIZED_STORAGE_URI.blob.core.usgovcloudapi.net/bootdiagnostics-vaazvSANTIZED_TAGp-SANTIZED_VM_ID/HOSTNAME926.SANTIZED_VM_ID.screenshot.bmp", "serialConsoleLogBlobUri": "https://SANTIZED_STORAGE_URI.blob.core.usgovcloudapi.net/bootdiagnostics-vaazvSANTIZED_TAGp-SANTIZED_VM_ID/HOSTNAME926.SANTIZED_VM_ID.serialconsole.log" }, "extensions": [ { "name": "AzureMonitorLinuxAgent", "type": "Microsoft.Azure.Monitor.AzureMonitorLinuxAgent", "typeHandlerVersion": "1.29.4", "statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Provisioning succeeded", "message": "Plugin enabled" } ] }, { "name": "AzurePolicyforLinux", "type": "Microsoft.GuestConfiguration.ConfigurationforLinux", "typeHandlerVersion": "1.26.38", "statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Provisioning succeeded", "message": "enable succeeded" } ] } ], "hyperVGeneration": "V1", "statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Provisioning succeeded", "time": "2024-09-04T07:06:16.7539588+00:00" }, { "code": "PowerState/running", "level": "Info", "displayStatus": "VM running" } ] }, "timeCreated": "2022-11-08T21:11:00.5835963+00:00" }, "zones": [ "2" ], "resources": [ { "name": "AzureMonitorLinuxAgent", "id": "/subscriptions/SUBSCRIPTION_ID_SANTIZED/resourceGroups/SANTIZED_RESC_GRP/providers/Microsoft.Compute/virtualMachines/HOSTNAME926/extensions/AzureMonitorLinuxAgent", "type": "Microsoft.Compute/virtualMachines/extensions", "location": "usgovvirginia", "properties": { "autoUpgradeMinorVersion": true, "provisioningState": "Succeeded", "enableAutomaticUpgrade": true, "publisher": "Microsoft.Azure.Monitor", "type": "AzureMonitorLinuxAgent", "typeHandlerVersion": "1.27" } }, { "name": "AzurePolicyforLinux", "id": "/subscriptions/SUBSCRIPTION_ID_SANTIZED/resourceGroups/SANTIZED_RESC_GRP/providers/Microsoft.Compute/virtualMachines/HOSTNAME926/extensions/AzurePolicyforLinux", "type": "Microsoft.Compute/virtualMachines/extensions", "location": "usgovvirginia", "properties": { "autoUpgradeMinorVersion": true, "provisioningState": "Succeeded", "enableAutomaticUpgrade": true, "publisher": "Microsoft.GuestConfiguration", "type": "ConfigurationforLinux", "typeHandlerVersion": "1.0", "settings": {} } } ] } cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ComputeManagementClient urllib3.util.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.us/SANTIZED_TENANT_ID/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/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.us/SANTIZED_TENANT_ID/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.us/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/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.us/SANTIZED_TENANT_ID/kerberos', 'tenant_region_scope': 'USGov', 'tenant_region_sub_scope': 'DODCON', 'cloud_instance_name': 'microsoftonline.us', 'cloud_graph_host_name': 'graph.microsoftazure.us', 'msgraph_host': 'graph.microsoft.us', 'rbac_url': 'https://pasff.usgovcloudapi.net'} cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ComputeManagementClient urllib3.util.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.us/SANTIZED_TENANT_ID/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/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.us/SANTIZED_TENANT_ID/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.us/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.us/SANTIZED_TENANT_ID/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.us/SANTIZED_TENANT_ID/kerberos', 'tenant_region_scope': 'USGov', 'tenant_region_sub_scope': 'DODCON', 'cloud_instance_name': 'microsoftonline.us', 'cloud_graph_host_name': 'graph.microsoftazure.us', 'msgraph_host': 'graph.microsoft.us', 'rbac_url': 'https://pasff.usgovcloudapi.net'} cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.usgovcloudapi.net//.default',), kwargs={} cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.usgovcloudapi.net//.default',), kwargs={} msal.application: Cache hit an AT msal.telemetry: Generate or reuse correlation_id: 9fdbf218-1c92-4f98-9734-9f5a394e3a6f cli.azure.cli.core.sdk.policies: Request URL: 'https://management.usgovcloudapi.net/subscriptions/SUBSCRIPTION_ID_SANTIZED/providers/Microsoft.Compute/locations/usgovvirginia/publishers?api-version=2022-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': 'fc6424ea-6b01-11ef-a76e-001dd80122d4' cli.azure.cli.core.sdk.policies: 'CommandName': 'vm extension set' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--resource-group --vm-name --name --publisher --force-update --verbose --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.38.2 (RPM) azsdk-python-azure-mgmt-compute/27.1.0 Python/3.6.8 (Linux-3.10.0-1160.119.1.el7.x86_64-x86_64-with-redhat-7.9-Maipo)' 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.usgovcloudapi.net:443 urllib3.connectionpool: https://management.usgovcloudapi.net:443 "GET /subscriptions/SUBSCRIPTION_ID_SANTIZED/providers/Microsoft.Compute/locations/usgovvirginia/publishers?api-version=2022-03-01 HTTP/1.1" 200 None 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: 'Transfer-Encoding': 'chunked' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Content-Encoding': 'gzip' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'Vary': 'Accept-Encoding' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-served-by': '915101f3-55e2-4ef9-b537-baeb6efdd7e0_133610243191617130' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '39d05981-e70a-4d1e-acff-6cbf5cc2cbf4' cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '14993' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'a7867c32-2bc6-4d62-8c36-82bc0425c3c5' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'USDODCENTRAL:20240904T210936Z:a7867c32-2bc6-4d62-8c36-82bc0425c3c5' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Wed, 04 Sep 2024 21:09:36 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: [

] cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception: cli.azure.cli.core.util: Traceback (most recent call last): File "/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke cmd_result = self.invocation.execute(args) File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/vm/custom.py", line 1972, in set_extension version = _normalize_extension_version(cmd.cli_ctx, publisher, vm_extension_name, version, vm.location) File "/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/vm/custom.py", line 244, in _normalize_extension_version raise CLIError('Failed to find the latest version for the extension "{}"'.format(vm_extension_name)) knack.util.CLIError: Failed to find the latest version for the extension "AzurePolicyforLinux"

cli.azure.cli.core.azclierror: Failed to find the latest version for the extension "AzurePolicyforLinux" az_command_data_logger: Failed to find the latest version for the extension "AzurePolicyforLinux" cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f07921be510>] az_command_data_logger: exit code: 1 cli.main: Command ran in 1.970 seconds (init: 0.203, invoke: 1.767) telemetry.save: Save telemetry record of length 3193 in cache telemetry.check: Negative: The /home/SANITIZED_ACCT_NAME/.azure/telemetry.txt was modified at 2024-09-04 15:59:53.482831, which in less than 600.000000 s

Expected behavior

To update the Version from : "typeHandlerVersion": "1.26.38" to "typeHandlerVersion": "1.26.74"

Environment Summary

azure-cli 2.38.2

core 2.38.2 telemetry 1.0.6

Extensions: interactive 0.5.3

Dependencies: msal 1.18.0b1 azure-mgmt-resource 21.1.0b1

Python location '/bin/python3.6' Extensions directory '/home/ansible-common-acct/.azure/cliextensions'

Python (Linux) 3.6.8 (default, Oct 25 2023, 10:26:27) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

Additional context

Works with PowerShell Command: $resourceGroupName = "SANITZIED-RG" $vmName = "HOSTNAME925"

Set-AzVMExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name "AzurePolicyforLinux" -Publisher "Microsoft.GuestConfiguration" -Type "ConfigurationforLinux"

RequestId IsSuccessStatusCode StatusCode ReasonPhrase


                     True         OK            
azure-client-tools-bot-prd[bot] commented 2 months ago

Hi @n-morrison,

2.38.2 is not the latest Azure CLI(2.64.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 2 months ago

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

n-morrison commented 2 months ago

If Requested , I can Provide a Full Debug output. And if Direct Communications is needed, I will provide a full NON-Sanitized version. !!! NOT to be posted anywhere. !!!

n-morrison commented 2 months ago

Does not seem to be able to do Manual update on the RHEL 7 Server:

sudo az upgrade;
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Your current Azure CLI version is 2.38.2. Latest version available is None.
Please check the release notes first: https://docs.microsoft.com/cli/azure/release-notes-azure-cli
Do you want to continue? (Y/n): y
Loaded plugins: product-id, search-disabled-repos, subscription-manager, verify
rhel-7-server-ansible-2.9-rpms                                                                                                                                                                                   | 4.0 kB  00:00:00
rhel-7-server-extras-rpms                                                                                                                                                                                        | 3.4 kB  00:00:00
rhel-7-server-optional-rpms                                                                                                                                                                                      | 3.2 kB  00:00:00
rhel-7-server-rpms                                                                                                                                                                                               | 3.5 kB  00:00:00
rhel-7-server-satellite-client-6-rpms                                                                                                                                                                            | 3.8 kB  00:00:00
rhel-7-server-supplementary-rpms                                                                                                                                                                                 | 3.4 kB  00:00:00
rhel-server-rhscl-7-rpms                                                                                                                                                                                         | 3.5 kB  00:00:00
No packages marked for update
CLI upgrade failed or aborted.
n-morrison commented 2 months ago

Even the Latest version on Azure Cloud Shell also seems to have to have the Same issue, Here is the Version on CloudShell:

az --version;
azure-cli                         2.63.0 *

core                              2.63.0 *
telemetry                          1.1.0

Extensions:
ai-examples                        0.2.5
ml                                2.29.0
ssh                                2.0.5

Dependencies:
msal                              1.30.0
azure-mgmt-resource               23.1.1

Python location '/usr/bin/python3.9'
Extensions directory '/home/vhaisdmorrin0/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.19 (main, Jul 31 2024, 03:47:41) 
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal

You have 2 update(s) available. They will be updated with the next build of Cloud Shell.
n-morrison commented 2 months ago

Here is the DEBUG output from the Cloud Shell as well... Just the last 50+ lines:


cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
    raise ex
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 701, in _run_job
    result = cmd_copy(params)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/vm/custom.py", line 2152, in set_extension
    version = _normalize_extension_version(cmd.cli_ctx, publisher, vm_extension_name, version, vm.location)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/vm/custom.py", line 299, in _normalize_extension_version
    raise CLIError('Failed to find the latest version for the extension "{}"'.format(vm_extension_name))
knack.util.CLIError: Failed to find the latest version for the extension "AzurePolicyforLinux"

cli.azure.cli.core.azclierror: Failed to find the latest version for the extension "AzurePolicyforLinux"
az_command_data_logger: Failed to find the latest version for the extension "AzurePolicyforLinux"
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f39420f04c0>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 1.339 seconds (init: 0.165, invoke: 1.174)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 4070 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/bin/python3.9 /usr/lib/az/lib/python3.9/site-packages/azure/cli/telemetry/__init__.py /home/SANITZIED_USER/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.
n-morrison commented 2 months ago

I believe that it is Still a Bug since the cloud shell is up to the latest version that you recommended , and it still throws the Error as well, See my previous Post. Maybe it has something to do with us being in Azure Gov Cloud, but still a bug.