Azure Broker Service and SqlTableDependency - asp.net-mvc

I am trying to use SqlTableDependency in an MVC application, but I get the following error:
"Invalid object name 'sys.login_token'."
The connection string used by SqlTableDependency is correct as I also use it for the entire application.

To enable SQL SERVER Service Broker on Azure, you need to have a SQL Managed Instance Object instead of SQL Database on Azure. to more detail take a look at this link.

Related

Azure website to connect with databases on-premises as well as on azure

I want to publish my website on to azure, but the database should be on-premises for each client. One default database, however, should be on Azure too. In my asp.net MVC website, after my connection with default database is established, then I change the connection string based on the credentials entered by the user on login screen. This user database would be present at the client.
Do I simply change the connection string in web.config or do I need to set it up as follows?
I read this article that looks familiar to my scenario
https://learn.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections
Should I follow this article directly or do I need to create "cloud service deployment" as mentioned in this article?
The SO thread you referred for cloud service deployment is very old.
Go ahead with Hybrid connections. Read best practices.

Store UmbracoIdentity data in SQL Server

I have implemented Umbraco using UmbracoIdentity for membership and everything was going fine until I deployed my solution to an Azure Web App. On azure I am getting permission errors because UmbracoIdentity is using a SQL Server CE database stored in the App_Data folder.
For reference the error I am getting is:
Exception type: SqlCeException
There is a file sharing violation. A different process might be using the file. [ ...\wwwroot\App_Data\UmbracoIdentity.sdf ]
My Umbraco data is being stored in an SQL database and I would like to store my UmbracoIdentity membership data here as well. I would appreciate any help in how to setup SQL Server as the user store for membership data.
You need to implement the IExternalLoginStore.cs interface and then configure the application to use it. It should be fairly simple to implement as you can use the SQL Server CE implementation as an example. I've done one for Azure Table Storage - you can check the Readme at https://github.com/alindgren/UmbracoIdentity.AzureLoginStore to get an idea of how to configure the app to use a custom external login store (which for me was the least obvious part).

Web API and Entity Framework user name issue

All,
I have a ASP.NET Web API project that is making a REST call to my service layer in another project. The service project's data access is via Entity Framework 4.3. The connection string in the web.config files is set to use Integrated Security.
What is happening is, the name of the server, "server A", is being passed to the service layer, and failing authentication against SQL Server. There isn't a user account named "server A."
More specifically this is what the architecture looks like
jquery file making an api controller via POST to a method within the API controller
API controller method references the service layer DLL, and calls a method within the service class
The service class is calling a method in a repository class that uses DbContext to connect to SQl Server 2008 table.
Is there something specific I need to be doing when using the Web API framework in order to pass the correct user name down to EF?
Any help would be appreciated.
Derek
The problem is double hop impersonation. You can read about it by this link.
But i'm not sure that such impersonation is possible via REST. I recommend you use database via special account, not integrated security.

Store connection string in service configuration for WCF Data Service

I've got one class library project that contains an EF model that points to a SQL Azure database. I also have another Azure WCF Web Role project that contains a WCF Data Service exposing the data in my SQL Azure DB as a OData service. Right now I have the connection string stored in the web.config of the WCF Web Role project.
What I'd like to do is make this a configuration, so move it over to the service configuration files so I can change the connection string if necessary (putting it in the web.config seems shortsighted).
The problem I'm having is how to wire the OData service up to not use the web.config connection string but instead use one from the configuration.
RoleEnvironment.GetConfigurationSettingValue(NameofSetting);
???

Differences between ADOMD.net and Analysis Services OLE DB Provider (especially regarding authentication)

I'm attempting to connect to a SQL Server Analysis Services cube on a remote server which is not connected to the domain I'm connected to.
I can connect to the cube with Excel after providing username and password. Now I'm trying to connect to the same cube via code.
Unsuccessful connection via AdomdConnection
Using ADOMD.net (AdomdConnection) for SQL Server 2008 R2 I try to connect with this connection string:
Data Source=SRV1;Initial Catalog=Name of Cube;User Id=RemoteAccount;Password=***
This connection fails on the Open method of the connection. Interestingly the "user id" and "password" properties are allowed, because if the syntax was wrong you get a KeyNotFoundException.
Successful connection via OleDbConnection
I can successfully connect if I use OleDbConnection instead and the following connection string (copied from the Excel connection):
Provider=MSOLAP.4;Persist Security Info=True;User ID=SRV1;Password=***;Initial Catalog=Name of Cube;Data Source=SRV1;
So my questions are:
Can someone explain this behaviour? I thought AdomdConnection just used OleDB underneath?
Is there a way to connect to a SSAS
instance with AdomdConnection using
username and password?
Are there any
further differences between
AdomdConnection and OleDbConnection?
All downloads are available here.
I'm using the AdomdConnection succesfully with the username / password keys, but the difference is that I'm connecting to a HTTP data source. The solution I'm using is that I tunnel OLAP traffic over HTTP via IIS 7 as described in MSDN. The user name and password are then impersonated by IIS to Windows credentials.
Note: Disable Anonymous and Windows Authentication in IIS. I only got it working with Basic Authentication. For enhanced security, use SSL.
If you cannot connect the cube with excel, then you cannot connect it with the code.
The difference between ADOMD.Net and OleDb connection is that, the OleDb MSOLAP provider can be used to send MDX, DAX and DMX queries to an Analysis Services database. The result can only be a scalar or a table, so you cannot use an MDX query returning results on more than two axes. When you use a DAX query, the result will always fit well in a table, you can use a DataReader class to get the result.
We prefer mainly ADOMD.NET on OleDb due to the presenceConnection bug which hasn't been resolved.
In order to connect to SSAS instance with ADOMD.NET we need to add the following line in web.config file ( After creation of console application in Visual studio 2012)
Since we will be using Windows authentication to connect to Microsoft Analysis Services 2005, this addition of line in the web.config file is required to impersonate a user having access to the Analysis Services.
We need to configure the IIS server by creating a new application pool.
Following MSDN link will give other parameters of the ADOMD.NET connection String.
https://msdn.microsoft.com/en-us/library/microsoft.analysisservices.adomdclient.adomdconnection.connectionstring

Resources