Questions tagged [azure-sql-server]

548 questions
3
votes
1 answer

Login failed for user ''. Token is expired when using Azure Function app and Azure SQL Service using Managed Identity

I am using a function app which is service bus triggered. It connects to Azure SQL Server using Managed Identity. The connection is created using the following code. new SqlConnection(this.ConnectionString) { //…
3
votes
5 answers

VNet Integration For Azure Web App and Azure SQL Server

I have an Azure Web App and an Azure SQL Server, both in the same subscription. Both of them are connected to the same VNet Subnet as shown in the below snapshots. The SQL Server is configured not to Allow Azure Resources and Services to access the…
3
votes
1 answer

Azure SQL Database sys.fn_get_audit_file or sys.fn_xe_file_target_read_file troubles

I'm having troubles on a Azure SQL Database where i'm trying to read DB Audit logs. Both procedures sys.fn_get_audit_file or sys.fn_xe_file_target_read_file sould be able to read a file. But whatever I do i'm getting blank tables.But, even if I…
Harry Leboeuf
  • 723
  • 12
  • 30
3
votes
1 answer

In Azure SQL Server can the AD Admin which is also a Service Principal run a query on the master database?

Given: An Azure SQL Server - MyAzureSqlServer A Service Principal - MyServicePrincipal The Service Principal is configured as the AD Admin of the Azure SQL Server. (Azure Portal and Az Powershell module do not allow it, but Azure CLI and the REST…
mark
  • 59,016
  • 79
  • 296
  • 580
3
votes
2 answers

Retrieve definition of Sequence object in SQL Server

How can I get the definition of any Sequence objects in SQL Server? For instance if I want to get the definition of View/Function/Procedure I would use below query SELECT OBJECT_DEFINITION(tab.OBJECT_ID) FROM SYS.OBJECTS tab WHERE tab.[type] =…
user1941025
  • 541
  • 6
  • 21
3
votes
1 answer

How to aggregate and Join or Union into flat Json object with arrays?

I have data that looks like: Customers Table CustomerId CustomerName CustomerEmail ------------------------------------------ 1 Ben Ben@gmail.com 2 Robert Robert@gmail.com 3 Paul …
ttugates
  • 5,818
  • 3
  • 44
  • 54
3
votes
2 answers

Azure Function App not able to access Azure SQL server- saying Client IP need to be added in SQL Server

Getting below exception when my Azure Function App tries to connect with Azure SQL Server. Cannot open server 'my-sql-sever' requested by the login. Client with IP address '52.165.228.212' is not allowed to access the server. To enable access, use…
3
votes
3 answers

Restore Azure SQL Database LTR back-up via the Portal after deleting the original Azure SQL Server

I can't find a straight answer to this question so hoping someone here came across this. As the LTR backups are tied to the subscription there should be a way to restore a backup even if the original SQL Server that hosted the database is…
Florin D. Preda
  • 1,358
  • 1
  • 11
  • 25
3
votes
1 answer

Using AzureDevOps Build Agent for Secure Azure SQL Database connection from App Service using a managed identity

My struggle is specifically with fully automating things with the AzureDevOps build agent in the default configuration. I'm trying to use the App Service Managed Identity…
3
votes
2 answers

Running SQL Server database locally when using Azure-specific functionality?

I'm looking into migrating a project using on-premises SQL Server to SQL Azure. The database has cross-database dependencies, where some views reference another database on the same server, which is not supported by SQL Azure. I've successfully…
Mun
  • 14,098
  • 11
  • 59
  • 83
3
votes
1 answer

How to configure mail on Azure SQL Database

We are moving from Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64) to Microsoft SQL Azure (RTM) - 12.0.2000.8 Previously we send mail from database mail if a particular table have not updated in a particular time interval. But i tried to do…
3
votes
1 answer

convert one column to json

Using Azure SQLServer I'm trying to convert only one column to json format. The data is in a nvarchar field. Using For Json Auto will convert all fields and all rows. What I need is just to convert only one column. By converting to json what I…
Kamran
  • 1,258
  • 1
  • 16
  • 28
3
votes
5 answers

Cannot use Azure SQL with Azure DevOps Server 2019 - (Azure Government)

I have been struggling to get my DevOpsServer 2019-RC1 installation to see my Azure SQL Server My DevOpsServer install is on an Azure VM, as recommended I have implemented everything from the below documentation regarding the set up of an MSI for…
Gvazzana
  • 583
  • 1
  • 8
  • 21
3
votes
1 answer

How to check Instant File Initialization is enabled or not in Azure SQL Server

I want to check Instant File Initialization is enabled or not in Azure SQL Server. I have tried like this: exec xp_readerrorlog 0, 1, N'Database Instant File Initialization' but I got an error: Could not find stored procedure 'xp_readerrorlog'. I…
Chanukya
  • 5,833
  • 1
  • 22
  • 36
3
votes
1 answer

SQL DELETE is taking too much time

I have an Azure SQL server (standard tier, S3) with tables. I have a specific query that takes very long time to be executed: DELETE FROM MyTable WHERE ID=@ID This table has 150K rows. The delete query takes +-10 minutes. I tried to understand…