Walkthrough: Subscription Management Interface Deployment on a Remote Server

For Internet-based notification applications, you typically deploy subscription management interfaces on an existing Internet Information Services (IIS) Web server.

This scenario shows how to deploy an ASP.NET-based subscription management interface on a remote IIS server. This scenario requires a domain account that your subscription management interface uses to connect to Microsoft SQL Server. The procedures in this topic show you how to create this login account and grant the necessary permissions.

Prerequisites

Before you deploy an ASP.NET-based subscription management interface, verify that all prerequisites are met:

  • You have installed Microsoft Windows, added the IIS component, and enabled ASP.NET. See your Windows documentation for instructions.

  • You (or your domain administrator) have created a domain account used by the ASP.NET-based interface. This is required to allow the interface on the remote server to connect to SQL Server using Windows Authentication. In this walkthrough, the domain account is called DOMAIN\WebApp.

    Note

    You can use SQL Server Authentication. However, Microsoft recommends Windows Authentication.

  • You have added the application to IIS, but have not yet configured security for the application.

  • You have already deployed the instance of Notification Services, which creates the instance and application databases on the database server.

  • TCP/IP or the named pipes network protocol is enabled on the Database Engine. In SQL Server 2005, these network protocols are disabled by default. For more information, see SQL Server Surface Area Configuration.

IIS Server Tasks

Perform the following steps on the Web server.

Step 1: Install the Notification Services Client Components

  1. Install the Notification Services client components.

    For more information about installing components, see Installing SQL Server Notification Services.

Step 2: Register the Instance

  1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2005, point to Notification Services, and then click Notification Services Command Prompt to open a Notification Services Command Prompt window.

  2. Type the following command to register the instance:

    nscontrol register -nameinstanceName-serverdatabaseServer

  3. Leave the Command Prompt window open for the next procedure.

Step 3: Configure Security for ASP.NET-based Applications

  1. Open the Machine.config file. This file should be located at %windir%\Microsoft.NET\Framework\vn.n.nnnn\CONFIG.

  2. Locate the processModel element. This element has several attributes, including userName and password.

  3. Set the userName value to DOMAIN\WebApp and the password value to the password for this account. The element should look like this:

    <processModel
        ...
        userName="DOMAIN\WebApp"
        password="aspnet_password"
        ...
    />
    
  4. Save the Machine.config file.

  5. Grant the DOMAIN\WebApp account Full Control to the %windir%Microsoft.NET\Framework\vn.n.nnnn\Temporary ASP.NET Files folder.

    For more information on granting permissions to folders, see your Windows documentation.

  6. Restart IIS to apply the changes.

Database Server Tasks

You must grant SQL Server and database permissions to the DOMAIN\WebApp account. If you have SQL Server workstation components installed on the non-hosted event provider server, you can perform these steps on that server.

Grant SQL Server and Database Permissions

  1. Open a Command Prompt window.

  2. Type the following command to create a SQL Server login for the DOMAIN\WebApp account:

    sqlcmd -E -S databaseServer -Q "CREATE LOGIN [DOMAIN\WebApp] FROM WINDOWS;"

  3. Type the following command to grant the DOMAIN\WebApp account access to the instance database and to add the account to the NSSubscriberAdmin database role:

    sqlcmd -E -SdatabaseServer-Q "USEinstanceDatabase;

    **    CREATE USER [DOMAIN\WebApp];**

    **    EXEC sp_addrolemember N'NSSubscriberAdmin', N'DOMAIN\WebApp';"**

  4. If you have separate databases for applications, type the following command to grant the DOMAIN\WebApp account access to an application database and to add the account to the NSSubscriberAdmin database role:

    sqlcmd -E -S databaseName -Q "USE applicationDatabase;

    **    CREATE USER [DOMAIN\WebApp];**

    **    EXEC sp_addrolemember N'NSSubscriberAdmin', N'DOMAIN\WebApp';"**

    If the instance hosts multiple applications, repeat this step for each application database.

You should now be able to use the subscription management application to manage subscribers and subscriptions for the instance of Notification Services.

Troubleshooting

If you cannot manage subscribers and subscriptions, check the status of the instance by running the following command from the Notification Services command prompt:

nscontrol status-name instanceName

Verify that subscriber and subscription management are enabled. For more information, see Viewing the Status of Instances, Applications, and Components.

Also check the Windows Application log for errors. For more information, see Troubleshooting Notification Services.

See Also

Concepts

Deploying an Instance of Notification Services
Deploying a Non-Hosted Event Provider

Other Resources

Deploying Notification Services

Help and Information

Getting SQL Server 2005 Assistance