Since elastic query is only possible with username+password, and the error message says that to create Entra ID accounts, you must be logged in with an Entra ID account, it seems that you lose.
How to create user in remote database using elastic query ?
I am trying to use elastic query to connect to remote database and create user there. I have used total three ways to create Database scope credentials:
Using SQL users:
CREATE
DATABASE
SCOPED CREDENTIAL ElasticDBQueryCred
WITH
IDENTITY
=
'<username>'
,
SECRET =
'<password>'
;
Using Service principle:
CREATE
DATABASE
SCOPED CREDENTIAL ElasticDBQueryCredSPN
WITH
IDENTITY
=
'<SPN_ID>'
,
SECRET =
'<SPN_SECRETE>'
;
__
Using entra ID:__
CREATE
DATABASE
SCOPED CREDENTIAL ElasticDBQueryCredAAD
WITH
IDENTITY
=
'<admin_entra_id>'
;
In all three cases above, I am getting the same error:
*SQL Error [33159] [S0001]: Principal 'entraID_of_user
' could not be created. Only connections established with Active Directory accounts can create other Active Directory users.
*
Is there a way to connect to a remote database and create a user on the remote database using an elastic query?