by Eldert Grootenboer | Apr 9, 2016 | BizTalk Community Blogs via Syndication
This is the fourth post in my series on Integration of Things. In this post, we will use Entity Framework Code First to set up an Azure Sql database, which will later on be filled with the data we receive from our Service Bus Queue. As we will want to access this database from multiple projects, we will add it to the DataTypes Class Library we created in the previous blogpost. The code for this blogpost can be found here.
First we will create an empty database in Azure.
As we will be using Entity Framework Code First we need to install the NuGet package for this library.
Using code first we define the layout of our tables in our code, so let’s add a class in the DataTypes project representing the table which will hold the error and warning data we are going to receive from the Service Bus Queue. Note the data annotations, this will specify the schema for our database.
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Eldert.IoT.Data.DataTypes
{
[Table("ErrorAndWarning")]
public class ErrorAndWarning
{
// By specifying the name ID, entity framework will know this should be an auto-incrementing PK
public int ID { get; set; }
[StringLength(50)]
public string ShipName { get; set; }
public string Message { get; set; }
public DateTime CreatedDateTime { get; set; }
}
}
|
The next step is to create a class which inherits from the DbContext class, which will be used as the context for communication with our database.
using System.Data.Entity;
namespace Eldert.IoT.Data.DataTypes
{
public class IoTDatabaseContext : DbContext
{
public IoTDatabaseContext() : base("name=IoTDatabaseContext")
{
}
public virtual DbSet ErrorAndWarningsEntries { get; set; }
}
}
|
To be able to communicate with the database in Azure we will have to add a connection string to the App.config. The connection string to be used can be found in the Azure portal in the properties of the database we just created.
<connectionStrings>
<add name="IoTDatabaseContext" connectionString="Server=tcp:yourserver.database.windows.net,1433;Database=yourdatabase;User ID=yourname@yourserver;Password={your_password_here};Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" providerName="System.Data.SqlClient">
</connectionStrings>
|
All code we need is now in place, we will now go and enable migrations on our project. Migrations are the way of EF Code First to update our database when we make changes to our code. Open the Package Manage Console in Visual Studio (can be found under View, Other Windows), make sure the current project is set as default project, and enter the command Enable-Migrations.
After enabling the migrations, we have to create an initial migration which will scaffold the setup of the table we just created. On the Package Manager Console, enter the command Add-Migration CreateErrorAndWarningTable, and wait for scaffolding to be finished. Once done, you will find a new class in the Migrations folder with the code which will create our database.
We now have set up our connection to our database, the first time an application uses this library to access the database the table will be created. In my next blogpost I will show how we can use an Azure WebJob to process data from Service Bus Queues and use this library to save the data to our Azure SQL database.
Code
by community-syndication | Apr 8, 2016 | BizTalk Community Blogs via Syndication
Microsoft Integration Product team announced yesterday on their monthly webcast (that you can see it here) some of the new features that are now available in Logic Apps like: “Run” any trigger now HTTP Webhook in Designer SQL Azure Connector now supports Store Procedures Azure Functions Integration and a few other features In this my […]
Blog Post by: Sandro Pereira
by Jeroen | Apr 8, 2016 | BizTalk Community Blogs via Syndication
The Problem:
After configuring a brand new BizTalk 2013R2 production environment and requesting the needed firewall exclusions to the security department, we were unable to send messages to Azure ServiceBus using the SB-Messaging adapter in BizTalk 2013R2 (using ACS authentication). We found the following warning in the EventLog:
The adapter “SB-Messaging” raised an error message. Details “System.ServiceModel.EndpointNotFoundException: The X.509 certificate CN=servicebus.windows.net is not in the trusted people store. The X.509 certificate CN=servicebus.windows.net chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority.
The Solution:
Thanks to this post on StackOverflow I was able to fix the problem by “auto installing” the missing certificate.
The following steps solved our problem:
- Configure the company web proxy needed for internet connectivity on the server used by BizTalk for ServiceBus connectivity
- Use a .NET console test application to send/receive a dummy message to an Azure ServiceBus test queue
- Remove the web proxy config
- Repeat on every server
- Test using the BizTalk SB-Messaging Adapter
After using the console test application, we got the following info message in the eventlog:
Small sidenote regarding the .NET console test application, make sure you use the “AutoDetect” connectivity mode:
1
|
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
|
by Jeroen | Apr 8, 2016 | BizTalk Community Blogs via Syndication
The Problem:
After configuring a brand new BizTalk 2013R2 production environment and requesting the needed firewall exclusions to the security department, we were unable to send messages to Azure ServiceBus using the SB-Messaging adapter in BizTalk 2013R2 (using ACS authentication). We found the following warning in the EventLog:
The adapter “SB-Messaging” raised an error message. Details “System.ServiceModel.EndpointNotFoundException: The X.509 certificate CN=servicebus.windows.net is not in the trusted people store. The X.509 certificate CN=servicebus.windows.net chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority.
The Solution:
Thanks to this post on StackOverflow I was able to fix the problem by “auto installing” the missing certificate.
The following steps solved our problem:
- Configure the company web proxy needed for internet connectivity on the server used by BizTalk for ServiceBus connectivity
- Use a .NET console test application to send/receive a dummy message to an Azure ServiceBus test queue
- Remove the web proxy config
- Repeat on every server
- Test using the BizTalk SB-Messaging Adapter
After using the console test application, we got the following info message in the eventlog:
Small sidenote regarding the .NET console test application, make sure you use the “AutoDetect” connectivity mode:
1
|
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
|
by community-syndication | Apr 7, 2016 | BizTalk Community Blogs via Syndication
This is a temporary post that was not deleted. Please delete this manually. (7279a178-00a7-4b13-a5fb-a6bcebd7f0b0 – 3bfe001a-32de-4114-a6b4-4005b770f6d7)
The post Temporary Post Used For Theme Detection (b597ec8c-78cd-4aa7-93da-63512cd1400b – 3bfe001a-32de-4114-a6b4-4005b770f6d7) appeared first on BizTalk360 Blog.
Blog Post by: Rajeshkumar Kandhasamy
by community-syndication | Apr 7, 2016 | BizTalk Community Blogs via Syndication
Wanted to make sure everyone was aware of the upcoming INTEGRATE 2016 event in London next month. This is the premier integration conference for anyone who is working in the Microsoft Integration platform space. Hosted by Microsoft partner BizTalk 360, this conference is geared towards addressing the challenges of modern day integration and digital transformation….
Blog Post by: BizTalk Team
by community-syndication | Apr 7, 2016 | BizTalk Community Blogs via Syndication
In the sequence of my last two post (here and here) and following the same topic, in order to finalize it, let’s talk about the last option and see how we can accomplish the same goal but this type configuring the Send Handler for existing static Send Ports in your environment. Well, the two previous […]
Blog Post by: Sandro Pereira
by community-syndication | Apr 5, 2016 | BizTalk Community Blogs via Syndication
Another handy new feature for CTP1 is the ability to make the same configuration change to multiple hosts/host instances at the same time. This removes chances of errors/inconsistencies occuring and speeds up the process. In this post I wanted to show you how it works. In the BizTalk admin console, you can expand out Platform…
Blog Post by: BizTalk Team
by community-syndication | Apr 5, 2016 | BizTalk Community Blogs via Syndication
Following the topic from my previous post, when we are configuring/optimizing a new environment, if some features are installed like EDI features or RosettaNet Accelerator, if we create different or dedicated host and host instances for each functionality, for example a host instance for receive, send, process (orchestrations), tracking and so on; of course then […]
Blog Post by: Sandro Pereira
by community-syndication | Apr 4, 2016 | BizTalk Community Blogs via Syndication
As happens almost every year on this day (my birthday), I always try to write a post for the BizTalk community something like a gift/present to the community today will be automate the task of configuring default Dynamic Send ports handlers using PowerShell. Since BizTalk Server 2013 we have available a new feature: Configurable Dynamic […]
Blog Post by: Sandro Pereira