Installing the .NET Contextual Image Delivery proxy module
To make Contextual Image Delivery work on your .NET Web site containing the API (RESTful) Server Role, install a proxy module that forwards requests to the Contextual Image Delivery microservice.
Procedure
- Access your installation media and navigate to the folder Content Delivery\roles\.
- Navigate to the folder cid\proxy\dotnet\bin\.
- Copy the contents of this folder to the bin\ folder of your .NET web application.
- In the root folder of your .NET web application, open Web.config for editing.
- Within the
system.webServersection, within themodulessection, add the followingaddelement:<add name="ContextualImageProxyModule" type="Sdl.Web.Context.Image.Proxy.ContextualImageProxyModule" /> - In the
appSettingssection, ensure the presence of the followingaddelements if you have authentication set up:<add key="oauth-client-id" value="USERNAME" /> <add key="oauth-client-secret" value="PASSWORD" /> <add key="oauth-enabled" value="true" />where USERNAME and PASSWORD are the credentials for accessing the Contextual Image Delivery microservice. You can find valid credentials in the Ambient Data Framework configuration file, cd_ambient_conf.xml, of the Discovery Service. USERNAME must be a user who assumes the
cdrole; by default, that user is calledcduser. Note also that the value ofClientSecretmust be an encrypted value. - In the same section, ensure the presence of the following
addelements:<add key="discovery-service-uri" value="http://DSHOST:DSPORT/discovery.svc/" /> <add key="cid-service-proxy-pattern" value="PATTERN" />where:- DSHOST identifies the host server on which the Discovery Service is running
- DSPORT identifies the port on which the Discovery Service is running (8082 by default)
- PATTERN specifies a particular URL on which to filter, for example,
/cid*. If Contextual Image Delivery should match everything, you can omit the lastaddelement.
- If you installed the Contextual Image Delivery microservice properly, the Contextual Image Delivery Capability is registered and can therefore be found through the Discovery Service. If, for some reason, you failed to do so, you can make the service directly discoverable by adding the following
addelement (not a recommended approach):<add key="cid-service-uri" value="http://CIDHOST:CIDPORT/cid" />where:- CIDHOST identifies the host server on which the Contextual Image Delivery microservice is running
- CIDPORT identifies the port on which the Contextual Image Delivery microservice is running (8088 by default)
- Save and close Web.config.
- Restart the web application.