错误消息“错误请求”是什么意思?意思是在创建 azsphere 租户时
我正在尝试在 powershell 中创建 azsphere 租户。登录到 azsphere CLI 后,我运行以下命令:
azsphere 租户创建 --name MyTenant --force-additional
我确认并收到错误消息:
由于参数无效,命令失败。检查您提供的值并重试。 Azure Sphere 安全服务发送了以下消息:错误请求
我尝试使用另一个租户名称并在线查找问题,但没有任何成功
编辑:当我使用 --debug 和 --verbose 参数运行命令时,我获得了有关的其他信息错误。我将把所有信息粘贴到这里。
cli.azure.cli.core.sdk.policies: Request URL: 'https://prod.core.sphere.azure.net/v2/tenants/create'
cli.azure.cli.core.sdk.policies: Request method: 'POST'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'Client-SDK': 'azsphere_v2'
cli.azure.cli.core.sdk.policies: 'Client-SDK-Version': '22.02'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'Content-Length': '34'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '554eede3-9f9e-11ec-8137-3868938df738'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'azsdk-python-sphere-publicapi/0.4.3 Python/3.8.9 (Windows-10-10.0.22000-SP0)'
cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: {"TenantFriendlyName": "MyTenant"}
urllib3.connectionpool: https://prod.core.sphere.azure.net:443 "POST /v2/tenants/create HTTP/1.1" 400 132
cli.azure.cli.core.sdk.policies: Response status: 400
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Date': 'Wed, 09 Mar 2022 11:44:37 GMT'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies: 'Content-Length': '132'
cli.azure.cli.core.sdk.policies: 'Request-Context': 'appId='
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies: 'api-supported-versions': '2.0'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: "Exception of type 'Azure.Sphere.Services.PublicApi.Service.Handlers.Implementation.HandlerExceptionWithHttpStatusCode' was thrown."
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 "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
File "D:\a\_work\1\s\azsphere-cli\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\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azext_sphere_cloudmanagement/tenant/custom.py", line 94, in create_tenant
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azext_sphere_cloudmanagement/tenant/custom.py", line 106, in create_tenant_request
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/async_wrapper.py", line 73, in wrapped_operation
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/publicapi/operations/_tenants_operations.py", line 142, in create
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Bad Request'
Content: "Exception of type 'Azure.Sphere.Services.PublicApi.Service.Handlers.Implementation.HandlerExceptionWithHttpStatusCode' was thrown."
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 712, in _run_job
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azext_sphere_cloudmanagement/_exception_handler.py", line 192, in tenant_create_exception_handler
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/cloud_exception_handler.py", line 148, in cloud_exception_handler
knack.util.CLIError: Command failed due to invalid parameters. Check the values you provided and try again.
The Azure Sphere Security Service sent the following message: Bad Request
cli.azure.cli.core.azclierror: Command failed due to invalid parameters. Check the values you provided and try again.
The Azure Sphere Security Service sent the following message: Bad Request
az_command_data_logger: Command failed due to invalid parameters. Check the values you provided and try again.
The Azure Sphere Security Service sent the following message: Bad Request
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03B125C8>, <function CompleterCache.invalidate_cache at 0x043B2610>]
az_command_data_logger: exit code: 1
cli.__main__: Azure Sphere Utility version 22.02.3.34006
cli.__main__: Command ran in 9.497 seconds (init: 1.297, invoke: 8.200)
I am trying to create a azsphere tenant in powershell. After I have logged into azsphere CLI I run the command:
azsphere tenant create --name MyTenant --force-additional
I confirm and get the error message:
Command failed due to invalid parameters. Check the values you provided and try again. The Azure Sphere Security Service sent the following message: Bad Request
I have tried to use another tenant name and looked up the problem online without any succes
Edit: When I run the command with --debug and --verbose parameters I get additional information about the error. I will paste all the information here.
cli.azure.cli.core.sdk.policies: Request URL: 'https://prod.core.sphere.azure.net/v2/tenants/create'
cli.azure.cli.core.sdk.policies: Request method: 'POST'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'Client-SDK': 'azsphere_v2'
cli.azure.cli.core.sdk.policies: 'Client-SDK-Version': '22.02'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'Content-Length': '34'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '554eede3-9f9e-11ec-8137-3868938df738'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'azsdk-python-sphere-publicapi/0.4.3 Python/3.8.9 (Windows-10-10.0.22000-SP0)'
cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: {"TenantFriendlyName": "MyTenant"}
urllib3.connectionpool: https://prod.core.sphere.azure.net:443 "POST /v2/tenants/create HTTP/1.1" 400 132
cli.azure.cli.core.sdk.policies: Response status: 400
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Date': 'Wed, 09 Mar 2022 11:44:37 GMT'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies: 'Content-Length': '132'
cli.azure.cli.core.sdk.policies: 'Request-Context': 'appId='
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies: 'api-supported-versions': '2.0'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: "Exception of type 'Azure.Sphere.Services.PublicApi.Service.Handlers.Implementation.HandlerExceptionWithHttpStatusCode' was thrown."
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 "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
File "D:\a\_work\1\s\azsphere-cli\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\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azext_sphere_cloudmanagement/tenant/custom.py", line 94, in create_tenant
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azext_sphere_cloudmanagement/tenant/custom.py", line 106, in create_tenant_request
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/async_wrapper.py", line 73, in wrapped_operation
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/publicapi/operations/_tenants_operations.py", line 142, in create
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Bad Request'
Content: "Exception of type 'Azure.Sphere.Services.PublicApi.Service.Handlers.Implementation.HandlerExceptionWithHttpStatusCode' was thrown."
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 712, in _run_job
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azext_sphere_cloudmanagement/_exception_handler.py", line 192, in tenant_create_exception_handler
File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/cloud_exception_handler.py", line 148, in cloud_exception_handler
knack.util.CLIError: Command failed due to invalid parameters. Check the values you provided and try again.
The Azure Sphere Security Service sent the following message: Bad Request
cli.azure.cli.core.azclierror: Command failed due to invalid parameters. Check the values you provided and try again.
The Azure Sphere Security Service sent the following message: Bad Request
az_command_data_logger: Command failed due to invalid parameters. Check the values you provided and try again.
The Azure Sphere Security Service sent the following message: Bad Request
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03B125C8>, <function CompleterCache.invalidate_cache at 0x043B2610>]
az_command_data_logger: exit code: 1
cli.__main__: Azure Sphere Utility version 22.02.3.34006
cli.__main__: Command ran in 9.497 seconds (init: 1.297, invoke: 8.200)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转到使用 sdk 下载
的命令提示符并从那里进行设置,然后
azspheretenant create --name MyTenant
将起作用。这对我有用
Go to command prompt downloaded with sdk and setup from there
then the
azsphere tenant create --name MyTenant
will work. It worked for me