question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

azure-mgmt-sql unable to set administrator_type parameter

See original GitHub issue

I’ve just updated my libraries and I am now on azure-mgmt-sql 1.0.0. As there are some method changes in this library to what I had before, I’ve been updating my scripts and I cannot seem to set the “administrator_type” parameter using sql_client.server_azure_ad_administrators.begin_create_or_update(). I have tried all different permutations I can think of but I have not had any success.

No matter what I do, I get errors similar to the following:-

**File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py", line 213, in begin_create_or_update
    raw_result = self._create_or_update_initial(
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py", line 160, in _create_or_update_initial
    raise HttpResponseError(response=response, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: (InternalServerError) An unexpected error occured while processing the request. Tracking ID: '26605c15-12bb-4c9b-980f-7d9c58b253fd'**

Could you provide a brief code example of the correct format please? The docs don’t seem to be correct.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisbeckettcommented, Feb 11, 2021

I worked it out. The documentation is extremely unhelpful!

I added a variable for the parameter name –

admin_name = 'activeDirectory'

Then ran the command successfully –

sql_client.server_azure_ad_administrators.begin_create_or_update(group_name, server_name, admin_name, 
          ServerAzureADAdministrator(administrator_type=AdministratorType("ActiveDirectory"),login=azure_ad_admin_name, sid=azure_ad_user_sid, tenant_id=tenant))

0reactions
chrisbeckettcommented, Feb 11, 2021

Closing as I resolved this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managed Instance Administrators - Create Or Update
URI Parameters; Request Body; Responses; Examples; Definitions. PUT ... Invalid administrator type specified in properties.
Read more >
azure.mgmt.sql.models module - NET
Variables are only populated by the server, and will be ignored when sending a request. Parameters. desired_state (str or AutomaticTuningOptionModeDesired) – ...
Read more >
Create Azure SQL DB with ONLY AD Administrator
Invalid value given for parameter Login. Specify a valid parameter value. Now I'm a bit confused. Why can't I get rid of these?...
Read more >
Setting an Azure AD group to Azure SQL Database with ARM ...
Technically it is possible as per this link to set an Azure AD group as the SQL admins but I could not find...
Read more >
azure-mgmt-sql - PyPI
For a complete set of supported options, see the parameters accept in init documentation of azure-core. You can't import a version module anymore, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found