Host the API Server on Azure



The CData API Server gives you the tools you need to securely connect to live data from cloud applications, mobile devices, and business intelligence tools. The API Server is a lightweight Web application that produces OData feeds for 80+ relational, nonrelational, cloud, and on-premises data sources. The API Server can be hosted on any Windows .NET server such as IIS or Azure. This article will show you how to deploy the API Server to Azure in 3 simple steps.

  1. In the Azure management console, click Add -> Web + Mobile -> Web App and enter the URL for the API Server.
  2. Copy the files in the www folder into the wwwroot directory.

    Azure provides several ways to upload files. Use the following information to connect over FTP:

    • Username: Use the Deployment / FTP User value.
    • Password: Use the password you defined in your deployment credentials. If you have not already created a new password, you can do so by clicking Deployment Credentials in the App Development setting of the settings blade for your app.
    • Host: Use the FTPS Host Name value.
  3. Connect to your data source. See the "Getting Started" chapter in the API Server help for a guide to setting the required connection properties and allowing access to tables.

Persist Configuration to an Azure SQL Database

You can persist schemas, settings, and logs to an Azure SQL database. Add an AppDb entry like the following to the configuration node in your Web.config:

<configuration>
 <connectionStrings>
<add name="AppDb" connectionString="Server=tcp:abcdef123.database.windows.net,1433;Database=mydb;User ID=MyUser@abcdef123;Password=MyPassword;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.SQLClient" />
</connectionStrings>

You can get the connection string by clicking Show Connection Strings from the dashboard for your database. Use the ADO.NET connection string.

Troubleshooting

If you get an error during deployment, details about the error may not be visible due to ASP.NET security policy. The first troubleshooting step is often to add the following property to your Web.config and redeploy:

<system.web>
  <customErrors mode="Off" />
  ...
</system.web>

You can then access the full stack trace, containing the error message.

  • Server Error in '/' Application: To resolve this error, comment out the following property in your Web.config and then redeploy:

    <compilation tempDirectory=''/>
 
 
Downloads