Can we connect SQL Server with Azure notification hub? - sql-server

I have connected to Azure notification hub with mobile devices.
Now my task is to trigger messages from SQL Server to Azure notification hub, so that messages will be sent to mobile devices.

I would create an Azure Logic App that allows you to link an SQL Server table as a trigger. You can then go down the root of having another trigger (Azure Function for instance) that triggers the notification hub. You may find a connector for that by the way.

Related

ASP NET Core application with SQL Server (local) database published on Azure platform

I have created an ASP.NET Core MVC application and published it directly via VS 2022 to Azure. It includes EF and Identity.
What is the best approach to also connect the database with data?
I have connected the database, but that didn't work as expected. All the data is missing
You can deploy your local database to Azure and connect with Web application.
I deploy My local database which is having SQL server authentication by following below procedure:
I selected the database and right click on it I go to below option:
Clicked on Deploy Database to Microsoft Azure SQL Database.
Connected to the Azure database server By clicking on connect option.
Image for reference:
It connected successfully.
Image for reference:
Summary of operation:
I click on finish. The operation started and completed successfully.
Image for reference:
My database is deployed to azure SQL database successfully.
Image for reference:
In this way we can deploy Local database to Azure SQL database.
Connecting to application:
Create web application go to publish page of that
From the View menu, select SQL Server Object Explorer.
At the top of SQL Server Object Explorer, click the Add SQL Server button.
In connect dialog box expand your azure node and connect to the database with username and password
Add client IP
database connected successfully.
In this way you can connect with azure SQL database.

What are the benefits of using Azure Service Connector to connect an App Service with an SQL Database?

I have a .NET app deployed as a Web App App Service on Azure. I connect from the app with two Azure SQL Databases in the same Resource Group.
For one of them, I have created a connection with the App service by Service Connector and for the other I wrote the connection string from hand. Both connection seem to work just fine.
My questions are: What can Service Connector do for me? Does it maybe allow me to get rid of having to add the IP of my app as a server firewall rule?
I read quite a bit of Microsoft documentation and didn't find a description of the actual benefits.
What can Service Connector do for me?
Service Connector makes easy and simple to establish and maintain connections between services.
Service Connectors helps us to connect multiple servers together.
We can use service Connector either from Azure Portal , Azure CLI or even from Visual Studio to create connections.
It is like an Extension Resource provider which reduces the manual configuration and maintenance difficulties.
From Visual Studio
Right click on the Project folder => Add => Connected Service
Add a service dependency => search for Azure SQL Database and select => click on next => select the DB, create one if you don't have and continue with next steps.
It provides an option to store Connection string in Azure Key Vault.
From Azure App Service
Does it maybe allow me to get rid of having to add the IP of my app as a server firewall rule?
Service connector reduces the manual configuration. It will enable the permission for us to make the connection and configures the network settings.
If service connector detects that we are using firewall in our application, it keeps IP of our Compute Service into the allowed list.

How do I make this web service call fault tolerant?

We have a WinForms desktop app that connects to a remote server to pull some data. The remote server hosts a web service on a standard IIS website that queries a SQL Server database installed on the same machine. Today, if the remote server is under maintenance or not available our end-user cannot retrieve the necessary data.
Now I am requested to make this feature fault-tolerant. Here are my questions:
Should I ask for another remote server that runs the same web service and move the DB to a third remote server? So the two web services can connect to the same DB?
Should I consider moving the web service logic to the WinForms desktop app and connect directly to a remote DB paying a first-class 99.99% availability service?
Do AWS or Azure provide a ready-to-use solution that fulfills my requirements?
Is there any other option I didn't consider?

Service Broker Enable Azure SQL

I'm trying to publish my web application (ASP.NET MVC) to Azure.
When I developed the system locally I used SQL Server as the database server.
Here I'm trying to use Azure SQL.
I want to enable Service Broker on the Azure database but it won't let me do it. I got an error that.
The operation cannot be performed on database "dbrngls" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group.
Is there any other way to do this in Azure SQL?
This is the code I tried to do to enable Broker
ALTER DATABASE [dbrngls] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE
Service broker is not available for Azure SQL Database, you'd need an Azure SQL Managed Instance.

Connect to Internal SQL database from Azure Web Application

I'm trying to build a webservice that talks to a SQL database hosted on a server in our internal network. The service is hosted by Azure as a Web App. Is there a good way of doing this? Do I have to use Azure Sql databases, and if I do, is there a way to have the Azure database act as a proxy for our internal database?
There are already rules permitting connections to the ports on our database server, so I don't think that's the problem. I see a lot of questions regarding connecting to Azure hosted sql databases, but nothing about connecting Azure web apps to other kinds of databases.
The error occurs when I try to call a stored procedure (via generated entity framework code) and is as follows:
Error occurred: System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
Our database is configured to allow remote connections, so what I'm guessing the Web App is having difficulty connecting to our vpn.
Please let me know if you need any additional information.
Thanks,
Josh
You can leverage Azure Hybrid Connections which is a feature of App service. Within App Service, Hybrid Connections can be used to access application resources in other networks. It provides access from your app to an application endpoint and uses Azure Relay service to connect to on-premise.
Check out the below link for more details :
https://learn.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections
First option is to look on azure app service hybrid connection but for you to do that you should have Windows server 2012 or above.
Azure App Service Hybrid
Azure App Service hybrid connection is good if you are pulling small amount of data.
If you are pulling large amount of data or your SQL server version is below server 2012 you have two options:
Azure Site to Site VPN
Azure SQL Data Sync
Azure SQL DB Sync is a feature that available on Azure SQL database. You can create a Azure SQL database on azure and sync your on-premise SQL database or SQL database table to Azure SQL database and you can connect your application to Azure SQL database instead of connecting to on-premise database server. This will increase your performance of your application.
We ended up adding the application to an Azure Virtual network that allowed connections to our on-prem servers. The remaining difficulties were due the wrong port numbers being open.
What was very helpful in debugging this was the Kudu console in Azure, under Advanced tools -> console. There you can run commands from the machine hosting your application like ping, or the below:
sqlcmd -S tcp:servername,1433 -U Username -d databasename -P password -q "SELECT * FROM tablename"

Resources