diff --git a/src/azure-cli-core/azure/cli/core/_util.py b/src/azure-cli-core/azure/cli/core/_util.py
index c194599bc..379152887 100644
--- a/src/azure-cli-core/azure/cli/core/_util.py
+++ b/src/azure-cli-core/azure/cli/core/_util.py
@@ -94,21 +94,27 @@ def get_json_object(json_string):
 
 
 def get_file_json(file_path, throw_on_empty=True):
+    content = read_file_content(file_path)
+    if not content and not throw_on_empty:
+        return None
+    return json.loads(content)
+
+
+def read_file_content(file_path, allow_binary=False):
     from codecs import open as codecs_open
-    # always try 'utf-8-sig' first, so that BOM in WinOS won't cause trouble.
-    for encoding in ('utf-8-sig', 'utf-8', 'utf-16', 'utf-16le', 'utf-16be'):
+    # Note, always put 'utf-8-sig' first, so that BOM in WinOS won't cause trouble.
+    for encoding in ['utf-8-sig', 'utf-8', 'utf-16', 'utf-16le', 'utf-16be']:
         try:
             with codecs_open(file_path, encoding=encoding) as f:
-                text = f.read()
-
-            if not text and not throw_on_empty:
-                return None
-
-            return json.loads(text)
+                return f.read()
+        except UnicodeDecodeError:
+            if allow_binary:
+                with open(file_path, 'rb') as input_file:
+                    return input_file.read()
+            else:
+                raise
         except UnicodeError:
             pass
-        except Exception as ex:
-            raise CLIError("File '{}' contains error: {}".format(file_path, str(ex)))
 
     raise CLIError('Failed to decode file {} - unknown decoding'.format(file_path))
 
diff --git a/src/azure-cli-core/azure/cli/core/application.py b/src/azure-cli-core/azure/cli/core/application.py
index e651a2c8a..72b282d16 100644
--- a/src/azure-cli-core/azure/cli/core/application.py
+++ b/src/azure-cli-core/azure/cli/core/application.py
@@ -13,7 +13,7 @@ from azure.cli.core._output import CommandResultItem
 import azure.cli.core.extensions
 import azure.cli.core._help as _help
 import azure.cli.core.azlogging as azlogging
-from azure.cli.core._util import todict, truncate_text, CLIError
+from azure.cli.core._util import todict, truncate_text, CLIError, read_file_content
 from azure.cli.core._config import az_config
 
 import azure.cli.core.telemetry as telemetry
@@ -237,19 +237,13 @@ class Application(object):
 
     @staticmethod
     def _load_file(path):
-        try:
-            if path == '-':
-                content = sys.stdin.read()
-            else:
-                try:
-                    with open(os.path.expanduser(path), 'r') as input_file:
-                        content = input_file.read()
-                except UnicodeDecodeError:
-                    with open(os.path.expanduser(path), 'rb') as input_file:
-                        content = input_file.read()
-            return content[0:-1] if content[-1] == '\n' else content
-        except:
-            raise CLIError('Failed to open file {}'.format(path))
+        if path == '-':
+            content = sys.stdin.read()
+        else:
+            content = read_file_content(os.path.expanduser(path),
+                                        allow_binary=True)
+
+        return content[0:-1] if content and content[-1] == '\n' else content
 
     def _handle_builtin_arguments(self, **kwargs):
         args = kwargs['args']

"@file support": should handle the BOM on file loading
Otherwise, using `@<parameter-file>` will return an invalid json string for the command to use. Since json file is the main file type, so the core layer should handle it.
CLI already have [the logic](https://github.com/Azure/azure-cli/blob/master/src/azure-cli-core/azure/cli/core/_util.py#L91) to handle BOM, so we just need to incorporate the same mechanism to [here](https://github.com/Azure/azure-cli/blob/master/src/azure-cli-core/azure/cli/core/application.py#L244) 

diff --git a/src/azure-cli-core/azure/cli/core/tests/test_application.py b/src/azure-cli-core/azure/cli/core/tests/test_application.py
index 42f09f10f..2142b0515 100644
--- a/src/azure-cli-core/azure/cli/core/tests/test_application.py
+++ b/src/azure-cli-core/azure/cli/core/tests/test_application.py
@@ -87,13 +87,21 @@ class TestApplication(unittest.TestCase):
         f = tempfile.NamedTemporaryFile(delete=False)
         f.close()
 
+        f_with_bom = tempfile.NamedTemporaryFile(delete=False)
+        f_with_bom.close()
+
         with open(f.name, 'w+') as stream:
             stream.write('foo')
 
+        from codecs import open as codecs_open
+        with codecs_open(f_with_bom.name, encoding='utf-8-sig', mode='w+') as stream:
+            stream.write('foo')
+
         cases = [
             [['bar=baz'], ['bar=baz']],
             [['bar', 'baz'], ['bar', 'baz']],
             [['bar=@{}'.format(f.name)], ['bar=foo']],
+            [['bar=@{}'.format(f_with_bom.name)], ['bar=foo']],
             [['bar', '@{}'.format(f.name)], ['bar', 'foo']],
             [['bar', f.name], ['bar', f.name]],
             [['bar=name@company.com'], ['bar=name@company.com']],

python scripts/dev_setup.py
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc libssl-dev libffi-dev
3.5
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
adal==1.2.7
applicationinsights==0.10.0
argcomplete==1.8.0
astroid==1.4.9
attrs==22.2.0
autopep8==1.2.4
azure-batch==1.1.0
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli&subdirectory=src/azure-cli
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_acr&subdirectory=src/command_modules/azure-cli-acr
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_acs&subdirectory=src/command_modules/azure-cli-acs
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_appservice&subdirectory=src/command_modules/azure-cli-appservice
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_batch&subdirectory=src/command_modules/azure-cli-batch
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_cloud&subdirectory=src/command_modules/azure-cli-cloud
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_component&subdirectory=src/command_modules/azure-cli-component
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_configure&subdirectory=src/command_modules/azure-cli-configure
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_container&subdirectory=src/command_modules/azure-cli-container
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_context&subdirectory=src/command_modules/azure-cli-context
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_core&subdirectory=src/azure-cli-core
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_feedback&subdirectory=src/command_modules/azure-cli-feedback
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_iot&subdirectory=src/command_modules/azure-cli-iot
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_keyvault&subdirectory=src/command_modules/azure-cli-keyvault
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_network&subdirectory=src/command_modules/azure-cli-network
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_nspkg&subdirectory=src/azure-cli-nspkg
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_profile&subdirectory=src/command_modules/azure-cli-profile
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_redis&subdirectory=src/command_modules/azure-cli-redis
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_resource&subdirectory=src/command_modules/azure-cli-resource
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_role&subdirectory=src/command_modules/azure-cli-role
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_sql&subdirectory=src/command_modules/azure-cli-sql
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_storage&subdirectory=src/command_modules/azure-cli-storage
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_taskhelp&subdirectory=src/command_modules/azure-cli-taskhelp
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_utility_automation&subdirectory=scripts
-e git+https://github.com/Azure/azure-cli.git@62dab24154f910ff7f3ef2b6b3783945b58e9098#egg=azure_cli_vm&subdirectory=src/command_modules/azure-cli-vm
azure-common==1.1.4
azure-core==1.24.2
azure-graphrbac==0.30.0rc6
azure-keyvault==0.1.0
azure-mgmt-authorization==0.30.0rc6
azure-mgmt-batch==2.0.0
azure-mgmt-compute==0.32.1
azure-mgmt-containerregistry==0.1.1
azure-mgmt-dns==0.30.0rc6
azure-mgmt-iothub==0.2.1
azure-mgmt-keyvault==0.30.0
azure-mgmt-network==0.30.0
azure-mgmt-nspkg==3.0.2
azure-mgmt-redis==1.0.0
azure-mgmt-resource==0.30.2
azure-mgmt-sql==0.2.0
azure-mgmt-storage==0.31.0
azure-mgmt-trafficmanager==0.30.0rc6
azure-mgmt-web==0.30.1
azure-nspkg==3.0.2
azure-storage==0.33.0
certifi==2021.5.30
cffi==1.15.1
charset-normalizer==2.0.12
colorama==0.3.7
coverage==4.2
cryptography==40.0.2
flake8==3.2.1
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
isodate==0.7.0
jeepney==0.7.1
jmespath==0.10.0
keyring==23.4.1
lazy-object-proxy==1.7.1
mccabe==0.5.3
mock==1.3.0
msrest==0.4.29
msrestazure==0.4.34
nose==1.3.7
oauthlib==3.2.2
packaging==21.3
paramiko==2.0.2
pbr==6.1.1
pep8==1.7.1
pluggy==1.0.0
py==1.11.0
pyasn1==0.5.1
pycodestyle==2.2.0
pycparser==2.21
pyflakes==1.3.0
Pygments==2.1.3
PyJWT==2.4.0
pylint==1.5.4
pyOpenSSL==16.1.0
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.9.0.post0
PyYAML==3.11
requests==2.27.1
requests-oauthlib==2.0.0
scp==0.15.0
SecretStorage==3.3.3
six==1.10.0
sshtunnel==0.4.0
tabulate==0.7.5
tomli==1.2.3
typing-extensions==4.1.1
urllib3==1.16
vcrpy==1.10.3
wrapt==1.16.0
zipp==3.6.0

name: azure-cli
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - adal==1.2.7
      - applicationinsights==0.10.0
      - argcomplete==1.8.0
      - astroid==1.4.9
      - attrs==22.2.0
      - autopep8==1.2.4
      - azure-batch==1.1.0
      - azure-common==1.1.4
      - azure-core==1.24.2
      - azure-graphrbac==0.30.0rc6
      - azure-keyvault==0.1.0
      - azure-mgmt-authorization==0.30.0rc6
      - azure-mgmt-batch==2.0.0
      - azure-mgmt-compute==0.32.1
      - azure-mgmt-containerregistry==0.1.1
      - azure-mgmt-dns==0.30.0rc6
      - azure-mgmt-iothub==0.2.1
      - azure-mgmt-keyvault==0.30.0
      - azure-mgmt-network==0.30.0
      - azure-mgmt-nspkg==3.0.2
      - azure-mgmt-redis==1.0.0
      - azure-mgmt-resource==0.30.2
      - azure-mgmt-sql==0.2.0
      - azure-mgmt-storage==0.31.0
      - azure-mgmt-trafficmanager==0.30.0rc6
      - azure-mgmt-web==0.30.1
      - azure-nspkg==3.0.2
      - azure-storage==0.33.0
      - cffi==1.15.1
      - charset-normalizer==2.0.12
      - colorama==0.3.7
      - coverage==4.2
      - cryptography==40.0.2
      - flake8==3.2.1
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isodate==0.7.0
      - jeepney==0.7.1
      - jmespath==0.10.0
      - keyring==23.4.1
      - lazy-object-proxy==1.7.1
      - mccabe==0.5.3
      - mock==1.3.0
      - msrest==0.4.29
      - msrestazure==0.4.34
      - nose==1.3.7
      - oauthlib==3.2.2
      - packaging==21.3
      - paramiko==2.0.2
      - pbr==6.1.1
      - pep8==1.7.1
      - pip==9.0.1
      - pluggy==1.0.0
      - py==1.11.0
      - pyasn1==0.5.1
      - pycodestyle==2.2.0
      - pycparser==2.21
      - pyflakes==1.3.0
      - pygments==2.1.3
      - pyjwt==2.4.0
      - pylint==1.5.4
      - pyopenssl==16.1.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - pyyaml==3.11
      - requests==2.27.1
      - requests-oauthlib==2.0.0
      - scp==0.15.0
      - secretstorage==3.3.3
      - setuptools==30.4.0
      - six==1.10.0
      - sshtunnel==0.4.0
      - tabulate==0.7.5
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.16
      - vcrpy==1.10.3
      - wrapt==1.16.0
      - zipp==3.6.0
prefix: /opt/conda/envs/azure-cli

src/azure-cli-core/azure/cli/core/tests/test_application.py::TestApplication::test_expand_file_prefixed_files
src/azure-cli-core/azure/cli/core/tests/test_application.py::TestApplication::test_application_register_and_call_handlers src/azure-cli-core/azure/cli/core/tests/test_application.py::TestApplication::test_list_value_parameter
src/azure-cli-core/azure/cli/core/application.py src/azure-cli-core/azure/cli/core/_util.py
src/azure-cli-core/azure/cli/core/application.py src/azure-cli-core/azure/cli/core/_util.py