Given the following iis web.config
<sessionState customProvider="Foo" mode="Custom" timeout="90">
<providers>
<add name="FooProvider" type="Redis"/>
</providers>
</sessionState>
How would you change the values of <add name="FooProvider..
with appcmd?
I'm able to change the <sessionState customProvider>
appcmd.exe set config 'mycompany/mysite' -section:system.web/sessionState -customProvider:"bar" -timeout:90
But I don't know how to change <add name="FooProvider"
to <add name="BarProvider"
I can delete the provider, and I can add a provider, however because I'm using CHEF to automate this, I need a way that is idempotent and can be run multiple times in a row.
Delete provider
appcmd set config 'mycompany/mysite' -section:system.web/sessionState /-"providers.[name='RedisSessionStateStoreProvider']
Create provider
appcmd set config 'mycompany/mysite' -section:system.web/sessionState /+"providers.[type='Redis',name='RedisSessionStateStoreProvider']"
Clear provider
appcmd clear config 'mycompany/mysite' -section:system.web/sessionState /providers
How can I modify the value of a provider without deleting and recreating it?