0

the command is pretty vanilla:

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

The command works when i run it in a terminal, and other az commands run in the script, but when the script hits this line - no matter where i place it - i get the following error message.

Any ideas?

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'
Kam
  • 340
  • 2
  • 12
  • Thanks for the response but i found the solution was simpler than that. I'm not as clever as i thought i was. I needed to do an apt update -y && apt upgrade. My linux distro wasnt upto date. The update may have updated my az cli which fixed it but i find updating fixes this issue – Kam Dec 18 '20 at 17:59

2 Answers2

0

Try these commands in different lines. It might fix the error or can help you identify which command has the error(s) specifically.

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
Nirmal
  • 57
  • 1
  • 8
0

You can also try removing ' and ' and add = in between command name and value.

Here is one approach:

az sql server ad-admin create --display-name=some group --object-id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group=my-group --server=my-server
Nirmal
  • 57
  • 1
  • 8