Azure Database SQL Server Job Agent

This page shows how to write Terraform and Azure Resource Manager for Database SQL Server Job Agent and write them securely.

azurerm_mssql_job_agent (Terraform)

The SQL Server Job Agent in Database can be configured in Terraform with the resource name azurerm_mssql_job_agent. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are supported:

  • name - (Required) The name which should be used for this Elastic Job Agent. Changing this forces a new Elastic Job Agent to be created.

  • location - (Required) The Azure Region where the Elastic Job Agent should exist. Changing this forces a new Elastic Job Agent to be created.

  • database_id - (Required) The ID of the database to store metadata for the Elastic Job Agent. Changing this forces a new Elastic Job Agent to be created.


  • tags - (Optional) A mapping of tags which should be assigned to the Database.

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Elastic Job Agent.

Explanation in Terraform Registry

Manages an Elastic Job Agent.

Tips: Best Practices for The Other Azure Database Resources

In addition to the azurerm_mariadb_firewall_rule, Azure Database has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

azurerm_mariadb_firewall_rule

Ensure database firewalls do not permit public access

It is better to restrict IP address ranges that can access the database by firewall rules. If both start_ip_address and end_ip_address are set to 0.0.0.0, it blocks connections from the Internet and accepts connections from all Azure datacenter IP addresses.

risk-label

azurerm_mariadb_server

Ensure that access to Azure SQL Database is restricted

It is better to disable public access to the database to avoid unwilling communications with unknown services if not required.

risk-label

azurerm_mssql_database_extended_auditing_policy

Ensure to configure retention periods of database auditing to enough duration

It is better to configure retention periods of database auditing to enough duration. It would be better to set greater than at least 90 days.

risk-label

azurerm_mssql_server

Ensure to enable auditing on Azure SQL databases

It is better to enable auditing on Azure SQL databases. It helps you maintain regulatory compliance, monitor the activities indicating unexpected incidents or suspected security violations.

risk-label

azurerm_mssql_server_security_alert_policy

Ensure to configure at least one email address for threat alerts

It is better to configure at least one email address for threat alerts. SQL Server is able to send alerts for threat detection via emails and it could support us to notice the incident on time.

risk-label

azurerm_mysql_firewall_rule

Ensure database firewalls do not permit public access

It is better to restrict IP address ranges that can access the database by firewall rules. If both start_ip_address and end_ip_address are set to 0.0.0.0, it blocks connections from the Internet and accepts connections from all Azure datacenter IP addresses.

risk-label

azurerm_mysql_server

Ensure to disable public access to database

It is better to disable public access to the database to avoid unwilling communications with unknown services if not required.

risk-label

azurerm_postgresql_firewall_rule

Ensure database firewalls do not permit public access

It is better to restrict IP address ranges that can access the database by firewall rules. If both start_ip_address and end_ip_address are set to 0.0.0.0, it blocks connections from the Internet and accepts connections from all Azure datacenter IP addresses.

risk-label

azurerm_postgresql_server

Ensure to disable public access to database

It is better to disable public access to the database to avoid unwilling communications with unknown services if not required.

risk-label

azurerm_sql_firewall_rule

Ensure database firewalls do not permit public access

It is better to restrict IP address ranges that can access the database by firewall rules. If both start_ip_address and end_ip_address are set to 0.0.0.0, it blocks connections from the Internet and accepts connections from all Azure datacenter IP addresses.

risk-label

azurerm_sql_server

Ensure to enable auditing on Azure SQL databases

It is better to enable auditing on Azure SQL databases. It helps you maintain regulatory compliance, monitor the activities indicating unexpected incidents or suspected security violations.

Review your Azure Database settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Microsoft.Sql/servers/jobAgents (Azure Resource Manager)

The servers/jobAgents in Microsoft.Sql can be configured in Azure Resource Manager with the resource name Microsoft.Sql/servers/jobAgents. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

azure.com_sql-jobs_2017-03-01-preview.json#L190
                      "type": "Microsoft.Sql/servers/jobAgents"
                    },
                    {
                      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/jobAgent2",
                      "location": "southeastasia",
                      "name": "jobAgent2",
ListJobAgentsByServer.json#L15
                        "type":"Microsoft.Sql/servers/jobAgents",
                        "location": "southeastasia",
                        "sku": {
                            "name": "Agent",
                            "capacity": 100
                        },
ListJobAgentsByServer.json#L15
                        "type":"Microsoft.Sql/servers/jobAgents",
                        "location": "southeastasia",
                        "sku": {
                            "name": "Agent",
                            "capacity": 100
                        },
ListJobAgentsByServer.json#L15
                        "type":"Microsoft.Sql/servers/jobAgents",
                        "location": "southeastasia",
                        "sku": {
                            "name": "Agent",
                            "capacity": 100
                        },
CreateOrUpdateJobAgent.json#L20
                "type":"Microsoft.Sql/servers/jobAgents",
                "location":"southeastasia",
                "properties":{
                    "databaseId":"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
                }
            }
CreateOrUpdateJobAgent.json#L20
                "type":"Microsoft.Sql/servers/jobAgents",
                "location":"southeastasia",
                "properties":{
                    "databaseId":"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
                }
            }
ListJobAgentsByServer.json#L15
                        "type":"Microsoft.Sql/servers/jobAgents",
                        "location": "southeastasia",
                        "sku": {
                            "name": "Agent",
                            "capacity": 100
                        },
CreateOrUpdateJobAgentMin.json#L20
                "type": "Microsoft.Sql/servers/jobAgents",
                "location": "southeastasia",
                "sku": {
                    "name": "Agent",
                    "capacity": 100
                },
CreateOrUpdateJobAgent.json#L20
                "type":"Microsoft.Sql/servers/jobAgents",
                "location":"southeastasia",
                "properties":{
                    "databaseId":"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"
                }
            }
CreateOrUpdateJobAgentMin.json#L20
                "type": "Microsoft.Sql/servers/jobAgents",
                "location": "southeastasia",
                "sku": {
                    "name": "Agent",
                    "capacity": 100
                },

Frequently asked questions

What is Azure Database SQL Server Job Agent?

Azure Database SQL Server Job Agent is a resource for Database of Microsoft Azure. Settings can be wrote in Terraform.