Open Blackbaud-JasonBodnar opened 1 month ago
Thank you for your feedback. Tagging and routing to the team member best able to assist.
@Blackbaud-JasonBodnar
the
UsernamePasswordCredential credential = new UsernamePasswordCredentialBuilder()
.clientId(clientId)
.username(username)
.password(password)
.build()
part is to authorize the client to connect to https://management.azure.com, not about SQL server. Therefore, you should never use SQL name/password on this.
Please see below https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/resourcemanager#authentication and more advanced below https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
Hi @Blackbaud-JasonBodnar. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
... part is to authorize the client to connect to https://management.azure.com, not about SQL server. Therefore, you should never use SQL name/password on this.
Please see below https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/resourcemanager#authentication and more advanced below https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
I've looked at those several times but they're not very clear. Are you saying there's no way to call SqlServerManager.authenticate()
with SQL name and password? If so, what is the appropriate way to create a database in a sql server in a headless environment? I need to create and then delete a database as part of our build pipeline in order to run tests so there will never be any kind of user interaction, only either a password or some kind of password-like key.
... part is to authorize the client to connect to https://management.azure.com, not about SQL server. Therefore, you should never use SQL name/password on this. Please see below https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/resourcemanager#authentication and more advanced below https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
I've looked at those several times but they're not very clear. Are you saying there's no way to call
SqlServerManager.authenticate()
with SQL name and password? If so, what is the appropriate way to create a database in a sql server in a headless environment? I need to create and then delete a database as part of our build pipeline in order to run tests so there will never be any kind of user interaction, only either a password or some kind of password-like key.
What I mean is the SqlServerManager.authenticate()
is the authentication for the management of all resources relates to the Azure Microsoft SQL server (that is, all the APIs here https://learn.microsoft.com/rest/api/sql/operation-groups?view=rest-sql-2021-11-01), include create/delete an SQL database
You can use "service principal" for the authentication, see https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#authenticate-service-principals
The "SQL name and password" is only for you to connect to that SQL server (probably to SQL database within it). https://learn.microsoft.com/azure/azure-sql/database/logins-create-manage?view=azuresql#existing-logins-and-user-accounts-after-creating-a-new-database, via maybe ODBC
Query/Question I've created a SQL Server in Azure with a Server admin login and password. I'm trying to automate the creation of databases for multiple projects as part of a gradle plugin and task that will be used as part of our build system. I can't find an example of how to do this with the Java SDK. I tried:
Where
clientId
= the Resource id from the Properties page of my SQL server andusername
andpassword
are the server admin login password I provided when creating the SQL server.I get the following error:
Why is this not a Bug or a feature Request? I would assume that this is possible but there's no example online that I can find.
Setup (please complete the following information if applicable):
Library/Libraries: com.azure.resourcemanager:azure-resourcemanager-sql:2.41.0, com.azure:azure-identity:1.13.1
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report