-
Is it possible to set the listening TCP ports for service (instead of defaults 5000/5001) ? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
While there are no specific configuration options in Data API builder at the moment, since it is a regular .NET Core application, you can use the With PowerShell, for example, you can do something like: $env:ASPNETCORE_URLS="http://localhost:8080;https://localhost:8081" if you are on Linux, instead: export ASPNETCORE_URLS="http://localhost:8080;https://localhost:8081" and the start Data API builder as usual via dab start and it will be listening on port 8080 and 8081 |
Beta Was this translation helpful? Give feedback.
-
You can also modify the appsetting.json file with custom Kestrel endpoint settings to override the default ports per https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-6.0#configureiconfiguration {
"Logging": {
"LogLevel": {
"Default": "Error",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://localhost:6543"
}
}
}
} |
Beta Was this translation helpful? Give feedback.
-
From a terminal window, I will try and find the LaunchSettings.json file is it in System32?
Alistair Colville
Director
***@***.***
t:
e:
w:
01983 882874
***@***.******@***.***>
https://www.colvillecare.co.uk<https://www.colvillecare.co.uk/>
From: Sean Leonard ***@***.***>
Sent: Wednesday, January 3, 2024 12:03 AM
To: Azure/data-api-builder ***@***.***>
Cc: Alistair Colville ***@***.***>; Comment ***@***.***>
Subject: Re: [Azure/data-api-builder] Is it possible to change listening ports? (Discussion #1425)
How are you launching DAB? If your are using VSCode, you may need change the launchSettings.json file.
—
Reply to this email directly, view it on GitHub<#1425 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AX5G2HQS74U2ZDIX7UMXMIDYMSN2RAVCNFSM6AAAAAAWX2KASSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSOJYGIYTE>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
I followed the example for on-prem
Overview to Azure data API builder | Microsoft Learn<https://learn.microsoft.com/en-us/azure/data-api-builder/overview-to-data-api-builder?tabs=azure-sql#run-data-api-builder-on-premises>
so to run I just type” dab start”
I will see if I can track down those files and have a look.
Alistair Colville
Director
***@***.***
t:
e:
w:
01983 882874
***@***.******@***.***>
https://www.colvillecare.co.uk<https://www.colvillecare.co.uk/>
From: Sean Leonard ***@***.***>
Sent: Wednesday, January 3, 2024 4:19 PM
To: Azure/data-api-builder ***@***.***>
Cc: Alistair Colville ***@***.***>; Comment ***@***.***>
Subject: Re: [Azure/data-api-builder] Is it possible to change listening ports? (Discussion #1425)
Do you use dotnet run to launch DAB from the terminal? System32 should not be touched for changing DAB configuration. Here are the two files that are applicable to port/ip in the DAB project:
* https://github.com/Azure/data-api-builder/blob/main/src/Service/Properties/launchSettings.json
* https://github.com/Azure/data-api-builder/blob/main/src/Service/appsettings.json
In addition, here is the documentation for various hosting options of asp.net projects (which DAB is an asp.net project). You may benefit from hosting DAB with one of these mechanisms which their own specific ways of configuring host settings:
* https://learn.microsoft.com/aspnet/core/host-and-deploy/?view=aspnetcore-6.0
—
Reply to this email directly, view it on GitHub<#1425 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AX5G2HXV5TXXEEG3UVP7AMDYMWAF3AVCNFSM6AAAAAAWX2KASSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DAMBUGYZTC>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
Many thanks, that is all running now.
Alistair Colville
Director
***@***.***
t:
e:
w:
01983 882874
***@***.******@***.***>
https://www.colvillecare.co.uk<https://www.colvillecare.co.uk/>
From: Claudio Galletti ***@***.***>
Sent: Wednesday, January 3, 2024 5:12 PM
To: Azure/data-api-builder ***@***.***>
Cc: Alistair Colville ***@***.***>; Comment ***@***.***>
Subject: Re: [Azure/data-api-builder] Is it possible to change listening ports? (Discussion #1425)
Thank you @yorek<https://github.com/yorek> (Ciao Davide !), great suggestions.
If you run run from Powershell something like:
$env:ASPNETCORE_URLS="http://$($env:ComputerName):8080;https://$($env:ComputerName):8081<http://$($env:ComputerName):8080;https:/$($env:ComputerName):8081>"
dab start
You end with a network accessible endpoint on all of your IPv4/v6 addresses.
So if you want to host multiple "Db-Api" pairs on a single machine, you just have to run multiple instances of Powershell with different ASPNETCORE_URLS env variable for each process.
—
Reply to this email directly, view it on GitHub<#1425 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AX5G2HSJ4PHIPXE73IQLYQTYMWGNTAVCNFSM6AAAAAAWX2KASSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DAMBVGE4DA>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
I just wanted to contribute another method to the above using a .env file, although you lose the extra security of an environment variable. C:\ContactsAPI\.env .env CreateCert.ps1 |
Beta Was this translation helpful? Give feedback.
While there are no specific configuration options in Data API builder at the moment, since it is a regular .NET Core application, you can use the
ASPNETCORE_URLS
variable to set the desired listening address and ports, as explained here:https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-6.0#url-prefixes-1
With PowerShell, for example, you can do something like:
if you are on Linux, instead:
and the start Data API builder as usual via
and it will be listening on port 8080 and 8081