Friday, April 27, 2012

Install MDS on the Extranet

Hi,
I had to install MDS portal on the extranet (DMZ) and MDS database on the intranet. Here are some of the issues that I encountered.

Setup

DomainA (Intranet/Internal) ServerA SqlServer 2008 R2/2012
Firewall Firewall rule to let sql connection through. No Federated Domain
DomainB (Extranet/DMZ) ServerB IIS 7.5 make sure that IIS and WCF is installed correctly

Creating the database

Since I can't use Current User - Integrated Security I have to switch to SQL Server Account. Make sure that you create a sql login user with sufficient rights to create the database.

Creating Website

Everything works fine until you try to connect the database to the portal. You will get the following error:
Service Account Failure User or Role '(null)' does not exist in this database.
No problem you have to go the web.config file and add the settings manually. In this example I have added 2 sites dev and test
...
...    <masterDataServices>
        <instance virtualPath="" siteName="MDS_MTN_DEV" connectionName="MDS1" serviceName="MDS1" />
        <instance virtualPath="" siteName="MDS_MTN_TEST" connectionName="MDS2" serviceName="MDS2" />
    </masterDataServices>
    <connectionStrings>
        <add name="MDS1" connectionString="Data Source=[ServerNameOrServerIP];Initial Catalog=mds;User Id=[username];Password=[password];Connect Timeout=60" />
        <add name="MDS2" connectionString="Data Source=[ServerNameOrServerIP];Initial Catalog=mds_test;User Id=[username];Password=[password];Connect Timeout=60" />
    </connectionStrings>
...
...    
    <service behaviorConfiguration="mdsWsHttpBehavior" name="MDS1">
        <endpoint binding="wsHttpBinding" bindingConfiguration="mdsWsHttpBinding"
         bindingNamespace="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09"
         contract="Microsoft.MasterDataServices.Services.ServiceContracts.IService" />
        <endpoint address="bhb" binding="basicHttpBinding" bindingConfiguration="mdsBasicHttpBinding"
         bindingNamespace="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09"
         contract="Microsoft.MasterDataServices.Services.ServiceContracts.IService" />
       </service>
       <service behaviorConfiguration="mdsWsHttpBehavior" name="MDS2">
        <endpoint binding="wsHttpBinding" bindingConfiguration="mdsWsHttpBinding"
         bindingNamespace="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09"
         contract="Microsoft.MasterDataServices.Services.ServiceContracts.IService" />
        <endpoint address="bhb" binding="basicHttpBinding" bindingConfiguration="mdsBasicHttpBinding"
         bindingNamespace="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09"
         contract="Microsoft.MasterDataServices.Services.ServiceContracts.IService" />
       </service>
...
...
If you close and reopen Master Data Services Configuration Manager and go the website you will see that the website is now connected to the database.

Testing the MDS Portal

When viewing an entity in explorer you may get the following errors:
IE8 Error Message [HttpWebRequest_WebException_RemoteServer] Arguments: NotFound Debugging resource strings are unavaialble. Often the key and argumetns provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/linkid=1066638&Version5.0.61118.08&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer
IE9 The remote server returned an error: NotFound.

Testing the MDS Service

Check Authorization on the Portal and Service in IIS Portal – Windows Authentication Enabled Service – Anonymous Authentication Enabled and Windows Authentication Enabled You may need to do an IISRESET. http://localhost/service/service.svc
Error Message for Anonymous Authentication not enabled Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.  Error Message for Windows Authentication not enabled Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service.
Error Message: The HttpsGetEnabled property of ServiceMetadataBehavior is set to true and the HttpsGetUrl property is a relative address, but there is no https base address.  Either supply an https base address or set HttpsGetUrl to an absolute address.
Change the web.config file to the following if only using http httpsGetEnabled="false"
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false"/>
After all that it works!!!