{
    "id": "ba51cef5-c56a-4d59-9cf3-6c0b52064369",
    "name": "Configure Audit for an Azure SQL Database",
    "slug": "configure-audit-for-an-azure-sql-database",
    "status": "published",
    "lab_type": "azure",
    "is_sample": false,
    "duration_in_seconds": 1200,
    "metadata": {},
    "session": null,
    "company": "a491bc32-c056-4946-9169-cc053387bada",
    "created": "2020-08-11T12:14:08.405495Z",
    "modified": "2023-10-03T18:58:59.752578Z",
    "is_beta": false,
    "lab_objectives": [],
    "main_learning_area": null,
    "learning_areas": [],
    "categories": [],
    "tags": [],
    "difficulty": null,
    "is_web_access": false,
    "is_lab_experience": false,
    "is_featured": false,
    "cve": null,
    "severity": null,
    "year": null,
    "classification": null,
    "is_trackable": false,
    "cpe_credits": null,
    "is_skill_check": false,
    "external_url": "https://portal.azure.com/",
    "solution_video": "cf733c00-d4bf-4599-9d6b-b364b1cacb9b",
    "explanation_video": null,
    "description": "# Task: Configure Audit for an Azure SQL Database\n\n## Video: Data Auditing in Azure\n\n**Estimated time:** 15 minutes\n\n## Goal\n\nIn this task you will provision an Azure SQL database and server.  You will configure auditing at the server and database level and confirm that activity is audited.\n\n## Pre-requisites\n\n1. Azure subscription\n\n## Requirements\n\n1. Provision an Azure SQL Database and server\n2. Configure auditing for the database and server\n3. Interact with the database\n4. Verify that activity is audited\n\n---\n\n## Requirement 1: Provision an Azure SQL Database and server\n\nFor this requirement you must provision an Azure sql database in a new resource group named **task-sqlaudit**. You will also provision a storage account to hold the audit data.\n\n- Use the following settings for the Azure SQL database:\n\n  |Setting|Value|\n  |---|---|\n  |Resource group|**&lt;New -> task-sqlaudit&gt;**|\n  |Database name|**Production**|\n  |Server|**&lt;New -> unique name&gt;**|\n  |Admin login|**student**|\n  |Password|**&lt;strong password&gt;**|\n  |Allow Azure services...|**Checked**|\n  |Compute + Storage|**Basic**|\n\n- Provision a storage account in the **task-sqlaudit** resource group.\n\n## Requirement 2: Configure auditing for the database and server\n\nFor this requirement you will configure auditing for the **Production** database and its server.  You will configure auditing to be written to the storage account provisioned in requirement 1. You will set retention to 10 days.\n\n## Requirement 3: Interact with the database\n\nFor this requirement you will log into the SQL server and interact with the database using the sqlcmd command line tool. You will create a table, add data and drop a table.\n\n- Use cloud shell to establish a sqlcmd session with the **Production** database and its server:\n\n  ```bash\n  sqlcmd -S <your server FQDN> -d Production -U student -P <your password>\n  ```\n\n- Within **sqlcmd** create a table\n\n  ```sql\n  CREATE TABLE dbo.test(id INT, content VARCHAR(20));\n  go\n  ```\n\n- Within **sqlcmd** add data to the table\n\n  ```sql\n  INSERT INTO dbo.test(id, content) VALUES (1,'One');\n  INSERT INTO dbo.test(id, content) VALUES (2,'Two');\n  go\n  ```\n\n- Within **sqlcmd** drop the table\n\n  ```sql\n  DROP TABLE dbo.test;\n  go\n  ```\n\n- Exit **sqlcmd**:\n\n  ```sql\n  exit\n  ```\n\n## Requirement 4: Verify that activity is audited\n\nFor this requirement you will return to the Azure portal and verify that the activity from requirement 3 has been logged for both the database and the server.\n\nHint: Return to the **Audit** view of the database blade to view the audit logs.\n\n## Clean up\n\n- Delete the **task-sqlaudit** resource group.\n\n## Solution\n\nHaving trouble completing this task?  View the demonstration video to see how to do it.",
    "description_html": "<h1>Task: Configure Audit for an Azure SQL Database</h1>\n<h2>Video: Data Auditing in Azure</h2>\n<p><strong>Estimated time:</strong> 15 minutes</p>\n<h2>Goal</h2>\n<p>In this task you will provision an Azure SQL database and server.  You will configure auditing at the server and database level and confirm that activity is audited.</p>\n<h2>Pre-requisites</h2>\n<ol>\n<li>Azure subscription</li>\n</ol>\n<h2>Requirements</h2>\n<ol>\n<li>Provision an Azure SQL Database and server</li>\n<li>Configure auditing for the database and server</li>\n<li>Interact with the database</li>\n<li>Verify that activity is audited</li>\n</ol>\n<hr />\n<h2>Requirement 1: Provision an Azure SQL Database and server</h2>\n<p>For this requirement you must provision an Azure sql database in a new resource group named <strong>task-sqlaudit</strong>. You will also provision a storage account to hold the audit data.</p>\n<ul>\n<li>Use the following settings for the Azure SQL database:</li>\n</ul>\n<table>\n<thead>\n<tr>\n<th>Setting</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Resource group</td>\n<td><strong>&lt;New -&gt; task-sqlaudit&gt;</strong></td>\n</tr>\n<tr>\n<td>Database name</td>\n<td><strong>Production</strong></td>\n</tr>\n<tr>\n<td>Server</td>\n<td><strong>&lt;New -&gt; unique name&gt;</strong></td>\n</tr>\n<tr>\n<td>Admin login</td>\n<td><strong>student</strong></td>\n</tr>\n<tr>\n<td>Password</td>\n<td><strong>&lt;strong password&gt;</strong></td>\n</tr>\n<tr>\n<td>Allow Azure services...</td>\n<td><strong>Checked</strong></td>\n</tr>\n<tr>\n<td>Compute + Storage</td>\n<td><strong>Basic</strong></td>\n</tr>\n</tbody>\n</table>\n<ul>\n<li>Provision a storage account in the <strong>task-sqlaudit</strong> resource group.</li>\n</ul>\n<h2>Requirement 2: Configure auditing for the database and server</h2>\n<p>For this requirement you will configure auditing for the <strong>Production</strong> database and its server.  You will configure auditing to be written to the storage account provisioned in requirement 1. You will set retention to 10 days.</p>\n<h2>Requirement 3: Interact with the database</h2>\n<p>For this requirement you will log into the SQL server and interact with the database using the sqlcmd command line tool. You will create a table, add data and drop a table.</p>\n<ul>\n<li>Use cloud shell to establish a sqlcmd session with the <strong>Production</strong> database and its server:</li>\n</ul>\n<pre class=\"codehilite\"><code class=\"language-bash\">sqlcmd -S &lt;your server FQDN&gt; -d Production -U student -P &lt;your password&gt;</code></pre>\n\n<ul>\n<li>Within <strong>sqlcmd</strong> create a table</li>\n</ul>\n<pre class=\"codehilite\"><code class=\"language-sql\">CREATE TABLE dbo.test(id INT, content VARCHAR(20));\ngo</code></pre>\n\n<ul>\n<li>Within <strong>sqlcmd</strong> add data to the table</li>\n</ul>\n<pre class=\"codehilite\"><code class=\"language-sql\">INSERT INTO dbo.test(id, content) VALUES (1,'One');\nINSERT INTO dbo.test(id, content) VALUES (2,'Two');\ngo</code></pre>\n\n<ul>\n<li>Within <strong>sqlcmd</strong> drop the table</li>\n</ul>\n<pre class=\"codehilite\"><code class=\"language-sql\">DROP TABLE dbo.test;\ngo</code></pre>\n\n<ul>\n<li>Exit <strong>sqlcmd</strong>:</li>\n</ul>\n<pre class=\"codehilite\"><code class=\"language-sql\">exit</code></pre>\n\n<h2>Requirement 4: Verify that activity is audited</h2>\n<p>For this requirement you will return to the Azure portal and verify that the activity from requirement 3 has been logged for both the database and the server.</p>\n<p>Hint: Return to the <strong>Audit</strong> view of the database blade to view the audit logs.</p>\n<h2>Clean up</h2>\n<ul>\n<li>Delete the <strong>task-sqlaudit</strong> resource group.</li>\n</ul>\n<h2>Solution</h2>\n<p>Having trouble completing this task?  View the demonstration video to see how to do it.</p>",
    "tasks": "",
    "tasks_html": "",
    "published_date": "2020-06-23T22:52:37Z",
    "solutions": "",
    "solutions_html": "",
    "flags": [],
    "min_points_to_pass": null,
    "access_type": "default",
    "user_status": "unstarted",
    "user_lab_status": null,
    "user_status_modified": null,
    "user_flags": []
}