Review the Azure SQL administrator login name

Review the Azure SQL administrator login name and protect the account with strong authentication and restricted access.

Description

For a new Azure SQL logical server, choose an admin_username that meets Azure’s restrictions and your naming policy. Once the server exists, this login name is fixed.

Potential impact

A common name such as admin makes the administrator login easy to guess. Exposed credentials can give someone administrative access.

Remediation

Supply a strong, unique password from a secret store. Restrict administrative connections and review sign-in records. Use separate accounts with limited database permissions for routine work. To require MFA for administrators, have them sign in with Entra identities and enforce MFA for Azure SQL through Conditional Access.

Examples

mylogin illustrates a new server login. Provide an available server name in sql_server_name and the stored password in sql_admin_password.

Before

yaml
- name: Create the SQL server
  azure_rm_sqlserver:
    resource_group: myResourceGroup
    name: "{{ sql_server_name }}"
    location: westus
    admin_username: admin
    admin_password: "{{ sql_admin_password }}"

After

yaml
- name: Create the SQL server
  azure_rm_sqlserver:
    resource_group: myResourceGroup
    name: "{{ sql_server_name }}"
    location: westus
    admin_username: mylogin
    admin_password: "{{ sql_admin_password }}"

References