> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/iam/appsec2-azure-7.md).

# Azure SQL servers which doesn't have Azure Active Directory admin configured misconfiguration detect

## Rule Details

|                        |                               |
| ---------------------- | ----------------------------- |
| Cortex AppSec Rule ID  | APPSEC2\_AZURE\_7             |
| Category - Subcategory | IAM - Authentication Policies |
| Provider               | AZURE                         |
| Severity               | LOW                           |
| Framework              | Terraform, Terraform Plan     |

## Impact

Use Azure Active Directory Authentication for authentication with SQL Database. Azure Active Directory authentication is a mechanism to connect to Microsoft Azure SQL Database and SQL Data Warehouse by using identities in Azure Active Directory (Azure AD). With Azure AD authentication, identities of database users and other Microsoft services can be managed in one central location. Central ID management provides a single place to manage database users and simplifies permission management.

* It provides an alternative to SQL Server authentication.
* Helps stop the proliferation of user identities across database servers.
* Allows password rotation in a single place.
* Customers can manage database permissions using external (AAD) groups.
* It can eliminate storing passwords by enabling integrated Windows authentication and other forms of authentication supported by Azure Active Directory.
* Azure AD authentication uses contained database users to authenticate identities at the database level.
* Azure AD supports token-based authentication for applications connecting to SQL Database.
* Azure AD authentication supports ADFS (domain federation) or native user/password authentication for a local Azure Active Directory without domain synchronization.
* Azure AD supports connections from SQL Server Management Studio that use Active Directory Universal Authentication, which includes Multi-Factor Authentication (MFA). MFA includes strong authentication with a range of easy verification options -- phone call, text message, smart cards with pin, or mobile app notification.

## How to Fix

*Resource:* azurerm\_resource\_group, azurerm\_sql\_server, azurerm\_sql\_active\_directory\_administrator

* *Arguments:* server\_name (of azurerm\_sql\_active\_directory\_administrator) \[source,go]

***

***

data "azurerm\_client\_config" "current" {}

resource "azurerm\_resource\_group" "example" { name = "example-resources" location = "West Europe" }

resource "azurerm\_sql\_server" "sql\_server\_good" { name = "mysqlserver" resource\_group\_name = azurerm\_resource\_group.example.name location = azurerm\_resource\_group.example.location version = "12.0" administrator\_login = "4dm1n157r470r" administrator\_login\_password = "4-v3ry-53cr37-p455w0rd" }

resource "azurerm\_sql\_active\_directory\_administrator" "example" {

* server\_name = azurerm\_sql\_server.sql\_server\_good.name resource\_group\_name = azurerm\_resource\_group.example.name login = "sqladmin" tenant\_id = data.azurerm\_client\_config.current.tenant\_id object\_id = data.azurerm\_client\_config.current.object\_id }

***

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/iam/appsec2-azure-7.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
