Setting Azure Redis SessionState provider for sub webconfig - azure

My web app have two webconfig file like this
root
|
|-subsystem
|web.config
web.config
Almost system had config use azure session ok, but my sub system cannot store session to azure. always null
I had copy same connection setting for sub webconfig file, but not work.
can you give me some advice

The root cause is IIS version.
With dev environment IIS express not store session to redis. But my server with IIS 8.5 , it work!

Related

How can I copy all IIS setting, configurations, application pools from one IIS box to another?

I have an IIS box on windows server 2012 and I want to mirror image the same settings, application pools, web sites and other configurations in another server that is also windows server 2012.
How Can I do that?
Is there any possibility to automate this process as I have to do this process very repetitively?
To Backup and Restore IIS configuration to Another Server you could try below steps:
1)if you configured the certificate with old iis site you need to Backup (export) of IIS certificates.
2)open the command prompt as administrator and create IIS configuration backup on the first server by using below command:
cd c:\Windows\system32\inetsrv
appcmd add backup srviis1-backup-2019
srviis1-backup-2019 this is a backup folder name.
After the command has been executed, a folder with your backup name appears in c:\Windows\system32\inetsrv\backup. Here is its contents for my simple website:
administration.config
applicationHost.config
MBSchema.xml
MetaBase.xml
redirection.config
3)Copy the backup folder to the same directory c:\windows\system32\backup on another server.
To display the list of all available backups, run the following command:
appcmd list backup
4)Recover IIS configuration from this backup:
appcmd restore backup srviis1-backup-2019
The list of restrictions and important issues:
The same IIS version has to be used on both servers
If any application pool is run not from the integrated accounts, they
have to be available on another server as well
Before recovery, you should export and migrate all current
certificates to the new server
I found a really genuine and effective way of migrating IIS(complete web application with all settings). It does not depend on IIS version also.
There is an API web deploy api that we can use to do this. We can do this using command line arguments or an IIS extension is also available for the same that will ease your IIS migration.
It can migrate
IIS Websites
Application Pools
Server certificates
Settings of application pools
Settings of websites
Authentication modes
MIME types
Directory Browsing
Output caching
Web binaries
And other related stuff and iis settings can be migrated using web deploy.
Go through https://www.microsoft.com/en-us/download/details.aspx?id=39277
and download web deploy for your IIS.

How to setup iis in Azure web app service with Net Core 2 app?

I develop simple Web Api on Net Core 2 and add Angular app to it (inside wwwroot folder) and publish it from my VS 2017 IDE to Azure Web App Service. All work fine, but when I reload page of my app in browser, server can't find route. So It often happens when iis not setup for SPA, It's described in https://angular.io/guide/deployment, I must configure the server to return the application's host page (index.html) when asked for a file that it does not have. How I can setup server node of iis in Azure Web App Service (web.config in Net Core 2 was deleted).
I am afraid you cannot achieve this.
Cause: Azure App Services runs IIS so it behaves mostly the same as local IIS, routing requests using a native module called AspNetCoreModule. So, it needs your published web.config file. Even though you deleted the web.config file, Azure would also generate a new web.config file to be used.(Though I don't understand why you delete the web.config file)
Solution:
Even you can upload the web.config file to Azure again, I'm afraid of that it will be ignored and doesn't work. So, I suggest you redeploy your website which contains web.config file to Azure and configure it well.
Additional: Azure Web App service is a kind of PaaS. So, if you want to install IIS manually, you can choose to host your website on a Windows Azure VM.

How to secure config file while hosting a web service on a public domain

I currently have a web service which I would like to host publicly but my company policy is against exposing the web.config file outside of our company firewall. Is there a way where I can host my web service on a public server securely?
Thanks to how IIS works, your web.config file won't be accessible from outside your application. You won't be able to get to it by just browsing directly to it unless you manually allow that action such as enabling directory browsing etc.
The web.config file is more an IIS config than anything else, as it merely configured the IIS environment to run the application as you intend it to.
You have nothing to worry about

InProc SessionState not working on one server

I have InProc SessionState enabled for my MVC appplication
<system.web>
...
<sessionState mode="InProc" cookieless="false" timeout="180" />
...
<system.web>
I have four independent VM's (Dev, Test, UAT & Prod) and unfortunately it does not work on one of them, e.g TempData is not passed between redirects.
I have checked...
IIS machine.config
IIS web.config
Applcation's web.config
Application pool settings
and they are all the same (alllowing for differences in connection strings etc)
Anything else I can check or any ideas as to what might be going on?
My dev and test environments are using the machine names whereas we have configured CNAMEs for the UAT environment as the end users are interacting with the server.
The problem was the hostname of the server... reporting_uat.xxx.com
As this contains an underscorre, IE will not store cookies, see Issue with Session and Cookie in Internet Explorer for websites containing underscore

Manually change web server domain for IIS

I'm having a bit of an issue with an IIS web application. I copied all the application files from the server, registered the DLL files, set up my DB server locally and now I'm trying to run the application locally, on my machine. The thing is that the app checks the server domain name when you log in and my corporate domain name is not in the list of "allowed" domains so the logging in fails.
Could I edit some IIS application config file(s) to make it look like the web server is actually under a different domain name? I want to keep my machine, overall, in the current domain.
I don't think that you can change the config files in the IIS.

Resources