Setting Forms Authentication upon Deployment

Hi,

We are trying to deploy the same code to two different websites: one Windows authenticated and one Forms. We are effectively copying the Nuget package up twice but the problem we have is that in the process steps we only have the option to set Anonymous, Basic and Windows authentication.

Even if we set the authentication to Forms in the web.config it does not set IIS.

Is there any way we can set one installation to Forms?

Any help much appreciated.

Hi Andy,

Thanks for getting in touch.

For the site you wish to use Forms authentication, set the IIS Authentication mode to Anonymous, and enable Forms authentication in your web.config.

Forms authentication is an ASP.NET setting, it isn’t actually one of the IIS Authentication modes. IIS just exposes it. When you enable it via IIS, it is actually setting the value in the web.config file located at the site root.

You will always need anonymous enabled as well as Forms.

Please let me know if this resolves your issue, or if any further questions.

Regards,
Michael

Hi Michael,

That works a treat. Many thanks for that.

Andy

No problem Andy. I’m glad it helped.

Happy Deploying!

Have similar issue, but we have different authentication/forms@name on staging and production, so need somehow change it. Seems that transformation files are not applied while promoting application because there is no transformation files inside generated nuget package

Hi,

Thanks for reaching out!

How are you generating this nuget package? If you are doing it using Octopack, you’re gonna have to set the “Build Action” property of the transform files to “content” from Visual Studio(see example). That’ll force Octopack to include such files during the packaging process.

Regards,
Dalmiro