Source: Azure/azure-cli#32105 (by @clemensv)
Affected extension: stream-analytics (src/stream-analytics/)
<<UNTRUSTED:issue-32105>>
Title
Invalid escape characters cause runtime warnings with stream-analytics extension
Body
Describe the bug
At runtime, I get the following python warnings when using the stream-analytics CLI extensions. Theer are stray backslashes in the code that cause it.
Related command
az stream-analytics
Errors
'''
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\models_stream_analytics_management_client_enums.py:30: SyntaxWarning: invalid escape sequence '\ '
"""Authentication Mode. Valid modes are ConnectionString\ , Msi and 'UserToken'.
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_inputs_operations.py:369: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_outputs_operations.py:371: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_functions_operations.py:371: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
'''
Issue script & Debug output
az stream-analytics job list -g nonexisting --debug pwsh 11:34:50
cli.knack.cli: Command arguments: ['stream-analytics', 'job', 'list', '-g', 'nonexisting', '--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 0x00000190908A4540>, <function OutputProducer.on_global_arguments at 0x0000019090E35940>, <function CLIQuery.on_global_arguments at 0x0000019090E8F880>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'stream-analytics': ['azext_stream_analytics']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
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: stream-analytics 0.058 9 47 C:\Users\clemensv.azure\cliextensions\stream-analytics
cli.azure.cli.core: Total (1) 0.058 9 47
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 : stream-analytics job list
cli.azure.cli.core: Command table: stream-analytics job list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x0000019093615120>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\clemensv.azure\commands\2025-09-12.11-35-22.stream-analytics_job_list.58008.log'.
az_command_data_logger: command args: stream-analytics job list -g {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x0000019093656660>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x00000190936CC9A0>, <function register_cache_arguments..add_cache_arguments at 0x00000190936CCB80>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x00000190936CCC20>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x0000019090E359E0>, <function CLIQuery.handle_query_parameter at 0x0000019090E8F920>, <function register_ids_argument..parse_ids_arguments at 0x00000190936CCA40>]
az_command_data_logger: extension name: stream-analytics
az_command_data_logger: extension version: 1.0.0
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\models_stream_analytics_management_client_enums.py:30: SyntaxWarning: invalid escape sequence '\ '
"""Authentication Mode. Valid modes are ConnectionString\ , Msi and 'UserToken'.
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_inputs_operations.py:369: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_outputs_operations.py:371: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_functions_operations.py:371: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=StreamAnalyticsManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='C:\Users\clemensv\.azure\msal_token_cache.bin', encrypt=True
cli.azure.cli.core.auth.binary_cache: load: C:\Users\clemensv.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: Initializing with Entra authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47
msal.authority: openid_config("https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/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/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/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/72f988bf-86f1-41af-91ab-2d7cd011db47/
... [truncated, original was 15541 chars]
Comments
Thank you for opening this issue, we will look into it.
Comment by @github-actions[bot]
Here are some similar issues that might help you. Please check if they can solve your problem.
Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)
Solution 1:
Please report this to Azure/azure-sdk-for-python#38618
Ref: Azure/azure-cli#28829 (comment)
Reference:
Solution 2:
If anyone is looking for a workaround, I also had the errors with python 3.12 - downgrading to 3.10 fixed them.
Reference:
Solution 3:
brew reinstall python fixed it for me.
Reference:
Powered by issue-sentinel
Comment by @microsoft-github-policy-service[bot]
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @atpham256.
<<END:issue-32105>>
Source: Azure/azure-cli#32105 (by @clemensv)
Affected extension:
stream-analytics(src/stream-analytics/)<<UNTRUSTED:issue-32105>>
Issue #32105 (by @clemensv)
Title
Invalid escape characters cause runtime warnings with stream-analytics extension
Body
Describe the bug
At runtime, I get the following python warnings when using the stream-analytics CLI extensions. Theer are stray backslashes in the code that cause it.
Related command
az stream-analytics
Errors
'''
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\models_stream_analytics_management_client_enums.py:30: SyntaxWarning: invalid escape sequence '\ '
"""Authentication Mode. Valid modes are
ConnectionString\ ,Msiand 'UserToken'.C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_inputs_operations.py:369: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_outputs_operations.py:371: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_functions_operations.py:371: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
'''
Issue script & Debug output
az stream-analytics job list -g nonexisting --debug pwsh 11:34:50
cli.knack.cli: Command arguments: ['stream-analytics', 'job', 'list', '-g', 'nonexisting', '--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 0x00000190908A4540>, <function OutputProducer.on_global_arguments at 0x0000019090E35940>, <function CLIQuery.on_global_arguments at 0x0000019090E8F880>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'stream-analytics': ['azext_stream_analytics']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
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: stream-analytics 0.058 9 47 C:\Users\clemensv.azure\cliextensions\stream-analytics
cli.azure.cli.core: Total (1) 0.058 9 47
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 : stream-analytics job list
cli.azure.cli.core: Command table: stream-analytics job list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x0000019093615120>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\clemensv.azure\commands\2025-09-12.11-35-22.stream-analytics_job_list.58008.log'.
az_command_data_logger: command args: stream-analytics job list -g {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x0000019093656660>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x00000190936CC9A0>, <function register_cache_arguments..add_cache_arguments at 0x00000190936CCB80>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x00000190936CCC20>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x0000019090E359E0>, <function CLIQuery.handle_query_parameter at 0x0000019090E8F920>, <function register_ids_argument..parse_ids_arguments at 0x00000190936CCA40>]
az_command_data_logger: extension name: stream-analytics
az_command_data_logger: extension version: 1.0.0
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\models_stream_analytics_management_client_enums.py:30: SyntaxWarning: invalid escape sequence '\ '
"""Authentication Mode. Valid modes are
ConnectionString\ ,Msiand 'UserToken'.C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_inputs_operations.py:369: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_outputs_operations.py:371: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
C:\Users\clemensv.azure\cliextensions\stream-analytics\azext_stream_analytics\vendored_sdks\streamanalytics\operations_functions_operations.py:371: SyntaxWarning: invalid escape sequence '\ '
properties to include in the response, or "\ *" to include all properties. By default, all
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=StreamAnalyticsManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='C:\Users\clemensv\.azure\msal_token_cache.bin', encrypt=True
cli.azure.cli.core.auth.binary_cache: load: C:\Users\clemensv.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: Initializing with Entra authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47
msal.authority: openid_config("https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/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/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/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/72f988bf-86f1-41af-91ab-2d7cd011db47/
... [truncated, original was 15541 chars]
Comments
Comment by @yonzhan
Thank you for opening this issue, we will look into it.
Comment by @github-actions[bot]
Here are some similar issues that might help you. Please check if they can solve your problem.
Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)
Solution 1:
Please report this to Azure/azure-sdk-for-python#38618
Ref: Azure/azure-cli#28829 (comment)
Reference:
Solution 2:
If anyone is looking for a workaround, I also had the errors with python 3.12 - downgrading to 3.10 fixed them.
Reference:
Solution 3:
brew reinstall pythonfixed it for me.Reference:
Powered by issue-sentinel
Comment by @microsoft-github-policy-service[bot]
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @atpham256.
<<END:issue-32105>>