简体   繁体   English

创建 azsphere 租户时出现错误消息“错误请求”是什么意思

[英]What does the error message "bad request" mean while creating a azsphere tenant

I am trying to create a azsphere tenant in powershell.我正在尝试在 powershell 中创建一个 azsphere 租户。 After I have logged into azsphere CLI I run the command:登录 azsphere CLI 后,我运行以下命令:

azsphere tenant create --name MyTenant --force-additional azsphere 租户创建 --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 Azure Sphere 安全服务发送了以下消息:错误请求

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.编辑:当我使用 --debug 和 --verbose 参数运行命令时,我会得到有关错误的其他信息。 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)

Go to command prompt downloaded with sdk and setup from there转到使用 sdk 下载的命令提示符并从那里进行设置

then the azsphere tenant create --name MyTenant然后azsphere tenant create --name MyTenant

will work.将工作。 It worked for me它对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure部署:创建Web作业计划时出错(400错误请求) - Azure deployment: Error while creating webjob schedule (400 Bad Request) 在 Azure 逻辑应用程序中连接 Outlook 时出错。 错误详细信息:租户 guid &#39;***&#39; 的租户不存在 - Error while connecting outlook in azure logic apps. Error details : The tenant for tenant guid '***' does not exist 这个错误对 nodejs 配置中的 MSAL 意味着什么? - What does this error mean with MSAL in nodejs configuration? 此Azure部署错误是什么意思? - What does this Azure deployment error mean? Microsoft 帐户、租户、订阅是什么意思? - What do you mean by Microsoft Account, Tenant, Subscription? 尝试从DocumentDb删除文档时出现错误的请求错误 - Bad request error while trying to delete a document from DocumentDb MobileServiceInvalidOperationException:错误:错误的请求 - MobileServiceInvalidOperationException: Error: Bad request 使用Azure时,PowerShell脚本中的含义是什么? - what does ' mean in powershell script while working with azure? PutBlock错误:远程服务器将文件上传到Azure时返回错误:(400)错误的请求 - PutBlock Error: The remote server returned an error: (400) Bad Request while uploading file to Azure ADF 说“TaskQueueId”存在“错误设置值”是什么意思? - What does it mean when ADF says there was an "Error setting value" to "TaskQueueId"?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM