Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[QUESTION] How to use an external SQL Server machine? #172

Closed
larsontim12 opened this issue Apr 19, 2017 · 4 comments
Closed

[QUESTION] How to use an external SQL Server machine? #172

larsontim12 opened this issue Apr 19, 2017 · 4 comments
Labels

Comments

@larsontim12
Copy link

Would it be possible to have this not use the docker SQL server database and have it point to an existing one? I am trying to have it point to an existing 2014 SQL Server and each service comes up on its own and works fine but I can't get the docker solution to run it keeps saying that it can't find the sqlserver. I changed all of the connection strings to point to the SQL Server in the docker file but still no luck. Any pointers would be greatly appreciated.

Thanks,
Tim

@eiximenis
Copy link
Contributor

eiximenis commented Apr 19, 2017

Hi!
You need to change the connection strings in the docker compose files.
Look at the file "docker-compose.override.yml" file and you'll see something like:

catalog.api:
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=http://0.0.0.0:5101
      - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word

@larsontim12
Copy link
Author

I tried that and it hasn't worked. In the connection string I changed sql.data to servername\SQLEXPRESS along with the database userid and password. It still says it can not find the database. I don't know if it is because it is running in a unix container and the SQL server is on my local.

@andrelmp
Copy link
Contributor

Open SQL ports on your firewall, enable TCP connections then update connection string to server=tcp:10.0.75.1\sqlexpress

@CESARDELATORRE
Copy link
Collaborator

CESARDELATORRE commented Apr 19, 2017

Also, if you don't want to use an IP but a server name, you can add this convenient entry at the Docker Compose override file, pointing to the external server (your dev machine or any SQL Server):
docker-compose.override.yml

...
ordering.api:
...
   extra_hosts:
         - "CESARDLSURFBOOK:10.0.75.1"

Then, you could use that server name in the connection string instead of the IP.

@CESARDELATORRE CESARDELATORRE changed the title Seperate Database [QUESTION] How to use an external SQL Server machine? Apr 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants