Can't create an external table - azure

I created a Synapse SQL Pool without issues, like the previous that is in production with the same configurations, apparently.
In this new SQL Pool when I try to create an external table I receive this error:
Error:
Failed to execute query. Error: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
I just revised the firewall rules, configurations and some of Microsoft`s documents without success.

Related

The connection to the sink database is failed. Detailed error message is: Login failed for user '<token-identified principal>'AzureSynapse Link forSQL

I'm trying to create an Azure Synapse Link for Azure SQL Database, using the steps from here:
https://learn.microsoft.com/en-us/azure/synapse-analytics/synapse-link/connect-synapse-link-sql-database
After I create the link connection and I want to start it I receive the following error:
The connection to the sink database is failed. Detailed error message is: Login failed for user ''.
ConnectionToAzureDB
LinkConnection
Also I have configurated the Azure SQL database to use ADD Auth. The connection to the Azure Database seems to be working.
My user ( used to create the Synapse workspace is Subscription Owner)
The user is also owner of the storage account.
I added the SQL Managed Identity as Storage Blob Data Contributor
Did anyone else got this error and manage to fix it?
There are certain limitations while connecting SQL Database to Synapse Link as per document:
When setting up your workspace, users must select "Disable Managed Virtual Network" and "Allow connections from any IP addresses."
A link connection cannot be enabled by Azure Synapse link for SQL if the database owner does not have a mapped log in. it will cause to get error.The (ALTER AUTHORIZATION command can be used to workaround this problem by changing the database owner to an user.)
With fewer than 100 DTUs, the Free, Basic, or Standard tiers do not allow Azure Synapse Link for SQL.
With is limitation I tried to Connect SQL Database to Synapse Link and able to connect without error:
I was trying to create a Synapse Link service with On Premises SQL Server and getting following error
Failed to enable Synapse Link on the source due to 'Failed to enable the source database: Some internal error happened due to 'Calling internal service failed: Failed to execute non query on change publisher with status code 400 and error Fail to non-query change publisher with error: 'sqlErrorCode - 22301; exceptionCode - TransferServiceUnknowError; error - A database operation failed with the following error: 'Could not update the metadata. The failure occurred when executing the command '(null)'. The error/state returned was 15517/1: 'Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.'. Use the action and error to determine the cause of the failure and resubmit the request.'; detailedError - A database operation failed with the following error: 'Could not update the metadata. The failure occurred when executing the command '(null)'. The error/state returned was 15517/1: 'Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.'. Use the action and error to determine the cause of the failure and resubmit the request.'
I resolved by by changing the corresponding database user to 'sa' and it works.
use [YourCorrespondingDatabase] EXEC sp_changedbowner 'sa'

Azure SQL unavailable to Web App intermittently

I have a webapp running in Azure. It uses a Azure MSSQL database set to Standard S0: 10 DTUs performance. The backend is written in dot net core 3.1. The app works fine when I visit it.
Checking my logs I found a few of these, they happen weeks apart at odd times.
Microsoft.Data.SqlClient.SqlException (0x80131904): 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. (provider: TCP Provider, error: 35 - An internal exception was caught)
This error has me wondering if some random user is unable to access the site because the SQL server won't respond.
Any suggestions as to what this might be about?
Or suggestions as to what I should try doing?
Update 1: As a response to comment regarding retry. I actually have implemented retry on the connection (.net core entity framework) using this code.
services.AddDbContext<ApplicationDbContext>(
options =>
{
options.UseSqlServer(connectionString, sqlOptions =>
{
sqlOptions.EnableRetryOnFailure(
maxRetryCount: 10,
maxRetryDelay: TimeSpan.FromSeconds(10),
errorNumbersToAdd: null
);
});
options.EnableSensitiveDataLogging(true);
},
ServiceLifetime.Transient
);

Azure Blob Source Error: The remote server returned an error: (400) Bad Request

I have created Data Flow Task in SSIS and configured Blob storage container.My request to process from Azure Blob to SQL server.I am getting "The remote server returned an error: (400) Bad Request" exception while executing SSIS.
I have verified the connectivity and access in Azure.
execution error
No debug error
#Meena
You need to add two Key to windows registry
To use TLS 1.2, add a REG_DWORD value named SchUseStrongCrypto with data 1 under the following two registry keys.
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft.NETFramework\v4.0.30319
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v4.0.30319
This works.
Just from your second screenshot, you get the error in progress but the data flow works well and the data have been load to SQL Server successfully, am I right?
I tried the same SSIS package(Load data from Blob to SQL Server) but has no error. Please try delete and reset the Azure Blob Source.
Test the connection when we create the source:
Azure Blob Source editor:
Progress:
Just from your progress error, we can not find which cause the 400 bed request error. But We can try re-create the source again to check if it will happen again. And most of all, the data flow task works well and all the data loaded to SQL Server correctly.

"Failed to connect to: we.frontend.clouddatahub.net" error while registering Integration Runtime of Azure Data Factory

This is what I followed to setup IR.
In the final step of Registering Azure Data factory self hosted intergration runtime, we need to provide the Authentication Key. then the installation is making a call to internet. Isn't this strange as the VM could be in a private network?
If the VM is not connected to internet and it gets this error then what to do? "Failed to connect to: we.frontend.clouddatahub.net"
This is the error I get
Failed to execute the command ' -Key xxx'. Error message: Microsoft.DataTransfer.DIAgentClient.HostServiceException: Failed to get service token from ADF service with key xxxx and time cost is: 3.0786307 seconds, the error code is: UnexpectedFault, activityId is: xxx and detailed error message is An error occurred while sending the request.
The underlying connection was closed: An unexpected error occurred on a send.
Authentication failed because the remote party has closed the transport stream.
The issue seems to be disabled remote access. How can I enable it? Dmgcmd -era 8060 is not working.
I have also a related issue logged as another VM works and this fails
Even if you have some private network where the communication can go without any restrictions between your data sources and your integration runtime, the integration runtime application needs to be able to communicate with the Azure data factory services as well. Try whitelisting the IPs for your region in the networking settings of your Azure VM or in your firewall - according to this:
https://learn.microsoft.com/sv-se/azure/data-factory/azure-integration-runtime-ip-addresses

Error 19 - Physical connection error

A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable) - occurs intermittently, using hybrid connector to connect to on-premise database from Azure API
I try connecting to SQL database in on-premise sever from app service resource (Web API). Configured classic hybrid connection end point to on-premise db.
Root Cause :
In SQL database, there is a property 'Auto Close' in Options tab, which is set to TRUE by default.
When Azure Service(API) establishes connection to SQL server. Azure tries to maintain the same connection pool and try to reuse and reconnect to it.
As we have set 'Auto Close as TRUE', the SQL database clears the existing connection after sometime. Whereas Azure tries to reconnect with the earlier connection which has already been cleared by SQL database. This results in 'Physical Connection is not usable - error 19'.
SOLUTION:
In SQL db, go to database properties. Navigate to 'OPTIONS' page and expand automatic tab and set 'AUTO CLOSE' property as 'FALSE'.
Make sure you restart Azure app and your database server to ensure no old connections are used.
PROBLEM SOLVED.
NOTE : This is one of the reason (which happened to me).
Another useful method to get rid of this error is to use RETRY LOGIC of Entity Framework 1.1.0
services.AddDbContext<DbContext>(options => options.UseSqlServer('yourconnectionstring',
sqlServerOptionsAction: sqlOptions =>
{
sqlOptions.EnableRetryOnFailure(
maxRetryCount: 5,
maxRetryDelay: TimeSpan.FromSeconds(30),
errorNumbersToAdd: new List<int>() { 19 });
}));
In Retry logic, error 19 is not included. So you have to pass the error code 19 to set retry logic for error code 19.
It seems you need to add a retry logic to your Web API as explained here. The "Physical connection is not usable" error may be caused by transient errors as explained on this Microsoft documentation.
"Transient fault errors typically manifest as one of the following error messages from your client programs:+
•Database on server is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of
•Database on server is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of . (Microsoft SQL Server, Error: 40613)
•An existing connection was forcibly closed by the remote host.
•System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)
•An connection attempt to a secondary database failed because the database is in the process of reconfguration and it is busy applying new pages while in the middle of an active transation on the primary database."

Resources