How to change connection string to different SQL databse on Azure Portal?

Anonymous
2020-06-19T22:10:58.573+00:00

I have Web app and Web API both deployed on Azure. Now there is a SQL database on Azure, which is consumed by the App. Where to find those connection string to change the server name to new one?
I tried API's configuration setting, where connection string is empty. How to update those? Any ideas would be really helpful.
Thanks.

Azure SQL Database
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,229 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ronen Ariely 15,096 Reputation points
    2020-06-20T03:21:16.597+00:00

    Good day Arc,

    I did not understood anything from your description. Can please try to elaborate it a bit more. Try to explain step by step what should be the behavior

    In the meantime maybe this will help:

    If you need to know what is the connection string to your azure database, then navigate toi the databse in the portal (open the portal in the SQL logical Server list -> Click on the server -> scroll down and click on the database which you want to connect)

    Next, on the left menu click on "Connection String" option: The windows that opened will include several connection strings to your database.

    In fact, you do not need all this since you can simply use the bellow connection string and replace the relevant information with your.

    Using SQL authentication us the bellow:

    Server=tcp:<server name>.database.windows.net,1433;Initial Catalog=<database name>;Persist Security Info=False;User ID=<your user name>;Password=<your password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

    Using Active Directory user:

    Server=tcp:<server name>.database.windows.net,1433;Initial Catalog=<database name>;Persist Security Info=False;User ID=<your_username>;Password=<your_password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Password";

    Using Active Directory integrated authentication

    Server=tcp:<server name>.database.windows.net,1433;Initial Catalog=<database name>;Persist Security Info=False;User ID=<your_username>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Integrated";

    How to change connection string to different SQL databse on Azure Portal

    Simply change the information in the connection string as I present above or use the portal to find the connection string to your database

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2020-06-22T13:28:09.78+00:00

    Hello @pituach

    Good morning! Thank you very much for the response, this is really helpful. And I am sorry for the confusing question.
    So, the thing is I have a SQL server X in the Azure portal and X has two SQL database in it, my application uses X's connection strings through the key vault which has a secret value which is the same connection string.
    But now, our team is migrating everything to different SQL server Y, which I am not able to see on Azure Portal and moreover, those connection string's value are not editable both on SQL server list on Azure portal or in the Key Vault. I am not sure, that might be the access issue and should I need to create an instance of new server Y? Hope this would be good to understand.
    Please let me know if I need to provide more details.
    Thanks,