Metabase Sqlserver



Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase. The process account used to run ASP.NET must have read access to the IIS metabase (e.g. Analyze your Microsoft SQL Server data in Metabase Getting your data from Microsoft SQL Server to Metabase can be a pain. Managing pipelines for all your data sources just isn’t sustainable, but your reporting can’t be put on hold while you wait for IT or Engineering to get to your ticket. The simplest, fastest way to get business intelligence and analytics to everyone in your company:yum: - metabase/metabase.

  1. Metabase is the easy, open source way for everyone in the users’ company to ask questions and learn from data.Users can easily filter and group their data to find just what they are looking for, all without ever writing a line of sql or having to wait on a co-worker.
  2. Metabase webpage isn't working - internet settings problem? 5: April 16, 2021 The question name is modified. If the current page is not refreshed, the original question name will be displayed in the'Saved Questions' Bug reports. 2: April 16, 2021.
-->

ASP.NET session state supports several different storage options for session data. Each option is identified by a value in the SessionStateMode enumeration. The following list describes the available session state modes:

  • InProc mode, which stores session state in memory on the Web server. This is the default.

  • StateServer mode, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

  • SQLServer mode stores session state in a SQL Server database. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

  • Custom mode, which enables you to specify a custom storage provider.

  • Off mode, which disables session state.

You can specify which mode you want ASP.NET session state to use by assigning a SessionStateMode enumeration values to the mode attribute of the sessionState element in your application's Web.config file. Modes other than InProc and Off require additional parameters, such as connection-string values as discussed later in this topic. You can view the currently selected session state by accessing the value of the HttpSessionState.Mode property.

In-Process Mode

In-process mode is the default session state mode and is specified using the InProcSessionStateMode enumeration value. In-process mode stores session state values and variables in memory on the local Web server. It is the only mode that supports the Session_OnEnd event. For more information about the Session_OnEnd event, see Session-State Events.

Warning

If you enable Web-garden mode by setting the webGarden attribute to true in the processModel element of the application's Web.config file, do not use InProc session state mode. If you do, data loss can occur if different requests for the same session are served by different worker processes.

State Server Mode

StateServer mode stores session state in a process, referred to as the ASP.NET state service, that is separate from the ASP.NET worker process or IIS application pool. Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

To use StateServer mode, you must first be sure the ASP.NET state service is running on the server used for the session store. The ASP.NET state service is installed as a service when ASP.NET and the .NET Framework are installed. The ASP.Net state service is installed at the following location:

systemrootMicrosoft.NETFrameworkversionNumberaspnet_state.exe

To configure an ASP.NET application to use StateServer mode, in the application's Web.config file do the following:

  • Set the mode attribute of the sessionState element to StateServer.

  • Set the stateConnectionString attribute to tcpip=serverName:42424.

    Note

    To improve the security of your application when using StateServer mode, it is recommended that you protect your stateConnectionString value by encrypting the sessionState section of your configuration file. For details, see Encrypting Configuration Information Using Protected Configuration.

The following example shows a configuration setting for StateServer mode where session state is stored on a remote computer named SampleStateServer:

Note

Objects stored in session state must be serializable if the mode is set to StateServer. For information on serializable objects, see the SerializableAttribute class.

To use StateServer mode in a Web farm, you must have the same encryption keys specified in the machineKey element of your Web configuration for all applications that are part of the Web farm. For information on how to create machine keys, see article 313091, 'How to create keys by using Visual Basic .NET for use in Forms authentication,' in the Microsoft Knowledge Base at http://support.microsoft.com.

SQL Server Mode

SQLServer mode stores session state in a SQL Server database. Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

Note

Objects stored in session state must be serializable if the mode is SQL Server. For information on serializable objects, see the SerializableAttribute class.

To use SQLServer mode, you must first be sure the ASP.NET session state database is installed on SQL Server. You can install the ASP.NET session state database using the Aspnet_regsql.exe tool, as described later in this topic.

To configure an ASP.NET application to use SQLServer mode, do the following in the application's Web.config file:

  • Set the mode attribute of the sessionState element to SQLServer.

  • Set the sqlConnectionString attribute to a connection string for your SQL Server database.

    Note

    to improve the security of your application when using SQLServer mode, it is recommended that you protect your sqlConnectionString value by encrypting the sessionState section of your configuration file. For details, see Encrypting Configuration Information Using Protected Configuration.

The following example shows a configuration setting for SQLServer mode where session state is stored on a SQL Server named 'SampleSqlServer':

Note

Metabase Sqlserver

If you specify a trusted connection to your SQL Server in the configuration file using the sessionState element's sqlConnectionString attribute, the SessionStateModule will connect to SQL Server using SQL Server integrated security. The connection will be made using the ASP.NET process identity or the user credentials supplied for the identity configuration element, if they exist. You can specify that the IIS impersonated identity be used instead by specifying <identity impersonate='true' /> and setting the useHostingIdentity attribute of the sessionState configuration element to false. For more information on the ASP.NET process identity, see Configuring ASP.NET Process Identity and ASP.NET Impersonation.

To configure SQLServer mode for a Web farm, in the configuration file for each Web server, set the sessionState element's sqlConnectionString attribute to point to the same SQL Server database. The path for the ASP.NET application in the IIS metabase must be identical on all Web servers that share session state in the SQL Server database. For information on steps to resolve the issue when application paths differ between servers, see article 325056, 'PRB: Session State Is Lost in Web Farm If You Use SqlServer or StateServer Session Mode,' in the Microsoft Knowledge Base at http://support.microsoft.com.

Installing the Session State Database Using the Aspnet_regsql.exe Tool

To install the session state database on SQL Server, run the Aspnet_regsql.exe tool located in the systemrootMicrosoft.NETFrameworkversionNumber folder on your Web server. Supply the following information with the command:

  • Thename of the SQL Server instance, using the -S option.

  • The logon credentials for an account that has permission to create a database on SQL Server. Use the -E option to use the currently logged-on user, or use the -U option to specify a user ID along with the -P option to specify a password.

  • The -ssadd command-line option to add the session state database.

    By default, you cannot use the Aspnet_regsql.exe tool to install the session state database on SQL Server Express Edition. In order to run the Aspnet_regsql.exe tool to install a SQL Server Express Edition database, you must first enable the Agent XPs SQL Server option using Transact-SQL commands like the following:

    You must run these Transact-SQL commands for any instance of SQL Server Express Edition where the Agent XPs option is disabled.

By default, the Aspnet_regsql.exe tool will create a database named ASPState containing stored procedures that support SQLServer mode. Session data itself is stored in the tempdb database by default. You can optionally use the -sstype option to change the storage location of session data. The following table specifies the possible values for the -sstype option:

Option

Description

t

Stores session data in the SQL Server tempdb database. This is the default. If you store session data in the tempdb database, the session data is lost if SQL Server is restarted.

p

Stores session data in the ASPState database instead of in the tempdb database.

c

Stores session data in a custom database. If you specify the c option, you must also include the name of the custom database using the -d option.

For example, the following command creates a database named ASPState on a SQL Server instance named 'SampleSqlServer' and specifies that session data is also stored in the ASPState database:

aspnet_regsql.exe -S SampleSqlServer -E -ssadd -sstype p

Note

If you are running ASP.NET 1.0 or ASP.NET 1.1, you cannot use the Aspnet_regsql.exe tool to configure ASP.NET to store session state in a persistent SQL Server database. However, you can obtain scripts to store session state in a persistent database. For details, see article 311209, 'HOW TO: Configure ASP.NET for Persistent SQL Server Session State Management' in the Microsoft Knowledge Base at http://support.microsoft.com. As an alternative, Web servers running ASP.NET 1.0 or ASP.NET 1.1 can direct persistent session state to a SQL Server that has the ASP.NET 2.0 session state schema installed.

In SQLServer mode, you can configure several computers running SQL Server to work as a failover cluster, which is two or more identical computers running SQL Server that store data for a single database. If one computer running SQL Server fails, another server in the cluster can take over and serve requests without session-data loss. To configure SQL Server mode for a failover cluster, you must specify -sstype p when you execute the Aspnet_regsql.exe tool so that session state data is stored in the ASPState database instead of the tempdb database. Storing session state in the tempdb database is not supported for a SQL Server cluster. For more information about setting up SQL Server mode for a failover cluster, see article 323262, 'How to use ASP.NET session state SQL Server Mode in a failover cluster' in the Microsoft Knowledge Base at http://support.microsoft.com.

Custom Mode

Custom mode specifies that you want to store session state data using a custom session state store provider. When you configure your ASP.NET application with a Mode of Custom, you must specify the type of the session state store provider using the providers sub-element of the sessionState configuration element. You specify the provider type using an add sub-element and include both a type attribute that specifies the provider's type name and a name attribute that specifies the provider instance name. The name of the provider instance is then supplied to the customProvider attribute of the sessionState element to configure ASP.NET session state to use that provider instance for storing and retrieving session data.

The following example shows elements from a Web.config file that specify that ASP.NET session state use a custom session state store provider:

For more information on custom session state store providers, see Implementing a Session-State Store Provider.

Note

A custom session state store provider will access any secured resource, such as SQL Server, using the ASP.NET process identity or the user credentials supplied to the identity configuration element, if they exist. You can specify that the IIS impersonated identity be used instead by specifying <identity impersonate='true' /> and setting the useHostingIdentity attribute of the sessionState configuration element to false. For more information on the ASP.NET process identity, see Configuring ASP.NET Process Identity and ASP.NET Impersonation.

See Also

Metabase sql server timeout

Concepts

Reference

The purpose of this article is to help you understand how to connect GitHub to Metabase. To do that, you will first be introduced to the concept of data analytics, business intelligence, and the roles they can play within your organization. A brief overview will also be provided for the two main tools you will use in this article – GitHub and Metabase.

Metabase Timeout

Metabase sql server

At the end of this article, you will have a firm understanding of how to use Metabase as a business intelligence tool to monitor changes in your GitHub code repositories through the GitHub API and Hevo. You will also understand some of the benefits of using an easy to access business intelligence tool to lower the barrier of entering the gathered data insights so that non-technical staff will also be able to reap its benefits. This article assumes that the reader is familiar with the basic usage of Git and the command line.

Let’s see how this blog is structured for you:

What is Metabase?

Metabase is an open-source business intelligence tool that gives anyone access to data (typically a database), the ability to ask questions to their data and draw insights that may summarize the data. You can then present it in a new and digestible form or use graphs and charts to plot the statistics associated with that data. The main use of Metabase is as a data analytics/presentation layer over data stored in databases.

With Metabase, users can use a simple, intuitive user interface (UI), to run queries that return results that are clear and can be formatted in several ways. Some of the presentation options available are tables, line graphs, pie charts, bar charts, maps, etc. Another benefit of Metabase is that users must not be overly technical or skilled in interacting with databases using a declarative language like SQL to run queries. However, there is provision for power users who may want to run complex SQL queries as Metabase includes a SQL query engine that can be accessed directly from the UI.

For organizations that require access to data insights to all members of the organization, Metabase is a particularly good choice as dashboards can be created that show Key Performance Indicators (KPIs), metrics, and other information that the organization may want to track periodically. Once such a dashboard is built, the data it displays does not need to be manually updated to show the most current version as changes in the database to which Metabase is connected to, is automatically synchronized. It means that the data team will not need to respond to queries for the same kind of questions over and over again.

As Metabase is easy to use, members across the organization can be encouraged to explore their questions using Metabase and share their findings with their colleagues, team members, and across the organization. Metabase is open-source and freely available for anyone to use and host. The team behind Metabase also offers an enterprise solution for enterprises that may want to host Metabase on-premise to safeguard proprietary data or limit access to certain data and dashboards based on the privileges/access rights within the enterprise. This managed solution provides support services. However, it is important to note that Metabase can also be hosted on cloud platforms like AWS, GCP, and Azure, with the attendant technical known-how required to run and scale such deployments.

2 Easy Methods to Connect GitHub to Metabase

There are two convenient methods to connect your data from GitHub to Metabase:

  1. Connect GitHub to Metabase Manually
    To connect GitHub to Metabase manually, you will use an experimental Metabase HTTP driver that allows the use of a RESTful API as a data source. This method requires engineering skills and expertise.
  2. Connect GitHub to Metabase Using Hevo
    You can automate your data flow using Hevo. It is a fully automated platform and requires zero engineering skills from your side. It efficiently transfers GitHub data to Metabase for free.

What is GitHub?

In the world of software development, GitHub occupies a conspicuous position that shows its usefulness to the entire software development ecosystem and its clear market leader status. GitHub is a code hosting platform that offers built-in version control using Git, which is an open-source distributed version control system that is used for large and small projects. Git is used by all the major software companies, startups, and by any organization or individual that wants to track source code changes. Git is by far the most popular version control system in use today.

GitHub wraps Git and provides some additional features such as a hosted environment, advanced collaboration tools, and agile style process implementations that makes working on software development with a distributed team very efficient. Most open-source projects and enterprise projects are hosted on GitHub as it has both free and paid tiers. Like Git, which is the most popular version control system in the world, GitHub is the most popular Git enabled collaboration platform.

In this article, you will make use of GitHub’s API, which provides access to information about GitHub projects, users, repositories, issues, pull requests, teams, etc. For this specific example, you will use the user’s endpoint that gives information about the repositories owned by a user. A user, in this case, is an organization or individual that owns a GitHub user account.

What is Data Analytics?

Data analytics can be defined as the process of analyzing data in its raw form so that insights or conclusions can be made, which can then provide decision making. The importance of data analytics has grown in today’s world, which is increasingly data-driven. Data is being produced at phenomenal levels, and the information gleaned from this data can be the differentiator between a company and its competitors.

There are many kinds of data analytics, namely descriptive analytics, diagnostic analytics, predictive analytics, and prescriptive analytics. Descriptive analytics mainly deals with the summarization of historical data to better understand changes that have occurred over time. This article deals mainly with descriptive analytics using Metabase as the tool of choice. The other forms of analytics are beyond the scope of this article.

Benefits of Visualizing Data

As defined earlier, descriptive analytics is about summarizing historical data so that trends can be detected. It can be done most efficiently by leveraging visualization. Humans are visual creatures, and showing data using visualization techniques like charts, maps, or tables, makes it easier to reason data. Trends that are not visible while looking at hard numbers, suddenly pop off the page when they are put in visualizations. Therefore, an integral part of descriptive analytics is the visual presentation of the results of findings.

Metabase makes visualizing answers for the questions asked about your data, simple and straight-forward. You can choose from a wide selection of visualization tools that best describes your metric of interest. Below is an example of a dashboard created using Metabase that contains various visualizations.

Connect GitHub to Metabase Manually

Metabase was primarily built to support traditional databases like MySQL, PostgreSQL, SQL Server, in addition to cloud offerings like Amazon Athena, Google BigQuery, Snowflake, etc. as its data source. However, there are extensions by the community that provide access to other types of data sources. In this section of the tutorial, you are going to use the experimental Metabase HTTP Driver that allows the use of a RESTful API as a data source.

To connect GitHub to Metabase, you will use the HTTP driver to access the GitHub API and feed that in as a data source to Metabase. This section assumes that you have access to an installed Metabase instance, be that a local installation or a cloud-hosted installation. It is also assumed that you have a GitHub account because you will be querying the GitHub API as an authenticated user. GitHub API permits unauthenticated requests, but you should be aware that the limit on the number of requests per hour is significantly lower as compared to authenticated requests.

The first step to accomplish the aim of connecting GitHub to Metabase is to install the HTTP Driver. Since this is a community-supported solution and not an official Metabase driver, the steps required to achieve this are more.

Metabase Sqlite

Step 1: You will first clone the Metabase repository. It is assumed that you have Git installed. Fire up a terminal, and issue the following command:

Step 2: Next, change the directory to the folder in which you cloned the Metabase Git repository.

Step 3: Run the following command to install prerequisites for building drivers:

Step 4: Now, clone the HTTP Driver repository like so:

Step 5: Next, change the directory to the HTTP driver repository that you just cloned and run the following commands to build the HTTP driver:

Step 6: The last step of the set-up process is to copy the output of the build step which is a .jar file to a plugins folder that you will create within the Metabase directory and then you will restart Metabase. The commands to do so are shown below:

Step 7: The setup is now complete, and you are ready to start using the HTTP driver within Metabase. The HTTP driver currently supports only REST APIs that utilize JSON. To issue a query, within Metabase, use the “native” query editor. A sample query is shown below:

Step 8: Let us now construct a simple query that will hit the GitHub API for a particular user and list the public repositories associated with that user. For fun, we will use Metabase as the user. The full query is shown below:

If you do not have a GitHub account or do not want to issue the query as an authenticated GitHub user, you can use the simplified query below:

Metabase Sql Server

The sample results from the above query can be seen below:

With this setup, it is possible to try out other GitHub API endpoints, ask more questions from your GitHub data, and play around with the presentation styles.

Connect GitHub to Metabase Using Hevo

Hevo automates your data flow in minutes. It connects with a range of marketing applications and pulls data in easily. It provides a single source of truth for your marketing data. It makes sure that you have access to the most accurate and real-time data without any coding. It transfers GitHub data to any other data source for free.

You can connect GitHub to Metabase using the following steps:

  • Connect: Connect your GitHub data with Hevo just by providing the credentials.
  • Integrate: Integrate your data from multiple sources, store it in our No-Code Data Integration Platform, and make it analytics-ready.
  • Analyze: Connect and visualize your unified data in Metabase and derive actionable insights in minutes.

Let’s talk about some amazing features of Hevo:

  • Simple: Hevo offers a simple and intuitive user interface. It can be set-up in minutes. Hevo also has a minimal learning curve.
  • Fully Automated: Hevo can automate your data flow without writing any custom codes. It will detect any errors in the data.
  • Zero Maintenance: Hevo requires no maintenance from your side. Set-up once, and you are ready to go.
  • Data Transformations: Hevo provides a simple interface to clean, transform, and enrich your data before moving it to your desired destination.
  • Real-Time: Hevo provides data migration in real-time so that your data is analysis-ready always.
  • Secure: Hevo makes sure that your data is safe and secure by offering two-factor authentication and end-to-end encryption.

Excited to use Hevo? If yes, then signup for a 14-day free trial today.

Conclusion

You have come to the end of this article. In this article, you were introduced to two prominent tools used extensively by software development teams and organizations around the world – GitHub and Metabase.

You were also introduced to data analytics, particularly descriptive analytics, how it can be used to analyze data, and the visualization techniques adopted to present that data. Thereafter, you took a whirlwind tour of the steps involved in setting up Metabase to allow it to consume APIs as a data source. You then used GitHub API to connect GitHub data for analysis inside of Metabase. It requires a lot of steps to take in, especially the portion that dealt with connecting an HTTP driver to Metabase. You may be wondering whether there is a more convenient way of achieving all that has been discussed above, and the answer is that there is a solution. Hevo, an integrated analytics platform that can act as a data warehouse through which you can load your GitHub data and send them to Metabase for free. them through a modern, unified interface.

Give Hevo a try by signing up for a 14-day free trial today.

Share your experience of connecting GitHub to Metabase in the comment section below.