TechEd - Windows Communication Foundation (WCF): Managing WCF Services
This session, by Shy Cohen was about managing services created with WCF. WCF offers a lot of options out-of-the-box to monitor what is happening with the services you created and deployed. WCF is highly configurable and that includes how to setup monitoring and tracing. WCF comes with a tool to manage all this, the WCF Configuration Editor. Some options to see what is happening are:
- WMI Provider. The WMI provider exposes information to any WMI compatible tool, such as MOM, Tivoli and OpenView). WMI is also accessible by PowerShell and CIM Studio. Or you can roll your own by using WMI. Logging can be switched on and off without having to restart the services.
- Performance Monitors. WCF comes with a number of built-in counters at service, end-point and operations level. Things like operations per second, messages sent/received, etc. And of course, you can add your own. These are also exposed through the WMI provider. So you can always check these.
- Tracing and logging. WCF offers you 5 levels of tracing, each level providing you with more detail. These messages are available during development as well as in production. Sensitive information, such as user names and passwords are not logged, so don't worry about that. You can even view the SOAP messages that come in and are sent out.
Governance is not included, but WCF does provide the following options to allow you to build that your self:
- List all running services.
- Check if policies for all services are the same.
Shy Cohen listed the following best practices for manageability at the end of the session:
- Use configuration rather than code.
- Identify business requirements for logging/counters/etc. at design time
- Implement a standard, basic management interface for all your services.
- Discover interfaces through WMI
- Provide API's for querying the state of your service
- Use the Duplex capabilities of WCF to notify clients of the service state.
- Turn WMI on and
- Create PowerShell commandlets for discovery, health monitoring and remediation
- Define a health model for your service. What is acceptable, what isn't.
On the security side:
- Protect log files created by the services from unwanted access.
- Be careful with granting access to WMI. A lot can be discovered from WMI.
You can visit Shy Cohen's web site for all slides and code from this session.