How do I add custom headers to the Identity server? I am using sxp/sitecore-id6:10.2.0-ltsc2019 image for the identity server. The Invoke-XdtTransform.ps1 we use on CM does not work as the id image does not have PowerShell. Is there any way I can add a transform to the web.config file on the identity service?

  • Did you check this ? sitecore.stackexchange.com/questions/32091/… Oct 26, 2023 at 6:20
  • @VikrantPunwatkar, I need to add transforms to the web.config file in the id container. I don't think I can add that in the project. Nov 6, 2023 at 11:05
  • You may not need to include that to project, but can keep it in source control. And you need to trigger that logic to transform web config to desired values. Entrypoint in Docker file of Identity server can be used to do so and place modified web config in container. Nov 15, 2023 at 6:31

1 Answer 1


Create a file named CustomIdentityServerTransform.xml with your header changes.

Copy this file into the Identity Server image:`FROM sxp/sitecore-id6:10.2.0-ltsc2019

COPY CustomIdentityServerTransform.xml C:/inetpub/wwwroot/identityserver Apply the transform during the image build:WORKDIR C:/inetpub/wwwroot/identityserver RUN .\TransformWebConfig.ps1 -ConfigPath 'C:\inetpub\wwwroot\identityserver\web.config' -TransformFile 'C:\inetpub\wwwroot\identityserver\CustomIdentityServerTransform.xml' -OutputPath 'C:\inetpub\wwwroot\identityserver\web.config' Build the Docker image:docker build -t your-custom-identity-server-image:tag . Run the container:docker run -d -p 44001:80 your-custom-identity-server-image:tag `

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.