How to set a Custom Service Port
There are situations where altering the default service port becomes necessary (the default port is set to 50051) . This adjustment can be made in the configuration file located at "\..\APIS\appsettings.json". The modification is demonstrated in the snippet below.
appsettings.json:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
},
"Endpoints": {
"Grpc2": {
"Protocols": "Http2",
"Url": "http://localhost:50051" //Bare service port to change
}
}
}
}
Additionally, it's necessary to update the corresponding port parameter in the Apis Management Studio which is an xml file within AMS configuration folder called "ioc.xml".
ioc.xml:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
.
.
.
<component id="apis">
<parameters>
<forceRemote>false</forceRemote>
<backupAddress>127.0.0.1:50051</backupAddress> //Corresponding service port to change
</parameters>
</component>
.
.
.
</configuration>