0

该命令非常普通:

az sql server ad-admin create --display-name 'some group' --object-id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' --resource-group my-group --server my-server

该命令在我在终端中运行时有效,而其他 az 命令在脚本中运行,但是当脚本到达这一行时 - 无论我将它放在哪里 - 我都会收到以下错误消息。

有任何想法吗?

ERROR: create_or_update() missing 1 required positional argument: 'parameters'
2020-04-09T22:11:13.3286506Z Traceback (most recent call last):
2020-04-09T22:11:13.3287125Z   File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
2020-04-09T22:11:13.3287519Z     cmd_result = self.invocation.execute(args)
2020-04-09T22:11:13.3288177Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 608, in execute
…2020-04-09T22:11:13.3294117Z     return …T22:11:13.3294770Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 493, in default_command_handler
2020-04-09T22:11:13.3295184Z     return op(**command_args)
2020-04-09T22:11:13.3295845Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/sql/custom.py", line 2074, in server_ad_admin_set
2020-04-09T22:11:13.3296258Z     properties=kwargs)
2020-04-09T22:11:13.3296834Z TypeError: create_or_update() missing 1 required positional argument: 'parameters'
4

2 回答 2

0

在不同的行中尝试这些命令。它可能会修复错误,或者可以帮助您确定哪个命令具体有错误。

az sql server ad-admin create --display-name 'some group' 
az sql server ad-admin create --object-id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' 
az sql server ad-admin create --resource-group my-group
az sql server ad-admin create --server my-server
于 2020-12-18T16:43:32.847 回答
0

您也可以尝试删除 ' 和 ' 并在命令名称和值之间添加 =。

这是一种方法:

az sql server ad-admin create --display-name=some group --object-id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group=my-group --server=my-server
于 2020-12-18T16:50:52.167 回答