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

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

@larsontim12

Description

@larsontim12

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

Activity

eiximenis

eiximenis commented on Apr 19, 2017

@eiximenis
Contributor

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

larsontim12 commented on Apr 19, 2017

@larsontim12
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

andrelmp commented on Apr 19, 2017

@andrelmp
Contributor

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

CESARDELATORRE

CESARDELATORRE commented on Apr 19, 2017

@CESARDELATORRE
Contributor

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.

changed the title [-]Seperate Database[/-] [+][QUESTION] How to use an external SQL Server machine?[/+] on Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @CESARDELATORRE@andrelmp@eiximenis@larsontim12

        Issue actions

          [QUESTION] How to use an external SQL Server machine? · Issue #172 · dotnet-architecture/eShopOnContainers