<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Elastic Job agent Archives - AzureOps</title>
	<atom:link href="https://azureops.org/articles/category/azure/elastic-job-agent/feed/" rel="self" type="application/rss+xml" />
	<link>https://azureops.org/articles/category/azure/elastic-job-agent/</link>
	<description>Notable things about Cloud, Data and DevOps.</description>
	<lastBuildDate>Sun, 09 Feb 2025 06:53:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/azureops.org/wp-content/uploads/2021/04/cropped-android-chrome-512x512-1.png?fit=32%2C32&#038;ssl=1</url>
	<title>Elastic Job agent Archives - AzureOps</title>
	<link>https://azureops.org/articles/category/azure/elastic-job-agent/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">190208641</site>	<item>
		<title>Create Elastic Jobs Using Azure Elastic Jobs Manager</title>
		<link>https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/</link>
		
		<dc:creator><![CDATA[Kunal Rathi]]></dc:creator>
		<pubDate>Fri, 08 Mar 2024 17:35:06 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Elastic Job agent]]></category>
		<category><![CDATA[Azure Elastic Jobs Manager]]></category>
		<category><![CDATA[AzureDevOps]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Visual studio extension]]></category>
		<guid isPermaLink="false">https://azureops.org/?p=7233</guid>

					<description><![CDATA[<p>Microsoft Azure offers Azure Elastic Job agent as a managed service, enabling efficient scheduling of T-SQL workloads on Azure SQL Databases. Similar to the SQL Server Agent job Wizard in SQL Server Management Studio, Azure Elastic Jobs Manager streamlines job deployment oversight with a Visual Studio extension, allowing seamless management from your desktop. This article demonstrates creating elastic jobs using Azure Elastic Jobs Manager, highlighting its resemblance to the SQL Server Agent job in management capabilities.</p>
<p>The post <a href="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/">Create Elastic Jobs Using Azure Elastic Jobs Manager</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="">Microsoft Azure offers <a href="https://learn.microsoft.com/en-us/azure/azure-sql/database/elastic-jobs-overview?view=azuresql" target="_blank" rel="noreferrer noopener">Azure Elastic Job agent</a> as a managed service, enabling efficient scheduling of T-SQL workloads on Azure SQL Databases. Similar to the SQL Server Agent job Wizard in SQL Server Management Studio, Azure Elastic Jobs Manager streamlines job deployment oversight with a Visual Studio extension, allowing seamless management from your desktop. This article demonstrates creating elastic jobs using Azure Elastic Jobs Manager, highlighting its resemblance to the SQL Server Agent job in management capabilities.</p>



<iframe width="700" height="394" src="https://www.youtube.com/embed/8YVrxCgdiIg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>



<p class="has-pale-cyan-blue-background-color has-background"><strong>Prerequisites:</strong><br>1. Azure Elastic Jobs service in Azure. In case you do not have the service created, you can follow <a href="https://elasticjobsmanager.azureops.org/docs/create-elastic-job.html" target="_blank" rel="noreferrer noopener">these </a>steps to create the service. </p>



<h2 class="wp-block-heading">Install the Extension</h2>



<p class="">Azure Elastic Jobs Manager is a desktop application published on Visual Studio Marketplace. This tool serves as an extension to <a href="https://marketplace.visualstudio.com/items?itemName=AzureOps.elasticjobsmanager1719" target="_blank" rel="noreferrer noopener">Visual Studio 2017, 2019</a>, and <a href="https://marketplace.visualstudio.com/items?itemName=AzureOps.elasticjobsmanager22" target="_blank" rel="noreferrer noopener">2022</a>, as well as SQL Server Management Studio versions 18 and 19, and can work as a standalone tool.  <a href="https://elasticjobsmanager.azureops.org/docs/installation.html">Learn </a>more about how to install the plugin.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?ssl=1"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="934" height="214" data-attachment-id="7264" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/vs-extension-and-updates/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?fit=934%2C214&amp;ssl=1" data-orig-size="934,214" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="vs-extension-and-updates" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?fit=934%2C214&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?resize=934%2C214&#038;ssl=1" alt="Azure Elastic Jobs Manager on Visual Studio Marketplace." class="wp-image-7264" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?w=934&amp;ssl=1 934w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?resize=300%2C69&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?resize=768%2C176&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?resize=450%2C103&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/vs-extension-and-updates.png?resize=600%2C137&amp;ssl=1 600w" sizes="(max-width: 934px) 100vw, 934px" /></a></figure>



<h2 class="wp-block-heading">Connect to Elastic job database</h2>



<p class="">1. Launch Azure Elastic Jobs Manager and enter Elastic Jobs database SQL server authentication credentials. If you have enabled <a href="https://elasticjobsmanager.azureops.org/docs/enable-umi.html" target="_blank" rel="noreferrer noopener">user-assigned managed identity</a> credentials to authenticate targets in Azure elastic jobs, check the &#8216;user-assigned managed identity&#8217; checkbox as shown in the image below and Click &#8216;Next&#8217; to connect.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/login-screen.png?ssl=1"><img data-recalc-dims="1" decoding="async" width="598" height="503" data-attachment-id="7238" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/login-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/login-screen.png?fit=598%2C503&amp;ssl=1" data-orig-size="598,503" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="login-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/login-screen.png?fit=598%2C503&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/login-screen.png?resize=598%2C503&#038;ssl=1" alt="azure elastic jobs manager login page" class="wp-image-7238" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/login-screen.png?w=598&amp;ssl=1 598w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/login-screen.png?resize=300%2C252&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/login-screen.png?resize=450%2C379&amp;ssl=1 450w" sizes="(max-width: 598px) 100vw, 598px" /></a></figure>



<p class="">2. Once connected,  you will see elastic jobs objects on the landing screen as shown in the image below.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/home-screen.png?ssl=1"><img data-recalc-dims="1" decoding="async" width="595" height="506" data-attachment-id="7240" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/home-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/home-screen.png?fit=595%2C506&amp;ssl=1" data-orig-size="595,506" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="home-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/home-screen.png?fit=595%2C506&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/home-screen.png?resize=595%2C506&#038;ssl=1" alt="azure elastic jobs manager landing page" class="wp-image-7240" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/home-screen.png?w=595&amp;ssl=1 595w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/home-screen.png?resize=300%2C255&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/home-screen.png?resize=450%2C383&amp;ssl=1 450w" sizes="(max-width: 595px) 100vw, 595px" /></a></figure>



<h3 class="wp-block-heading">Create credentials for jobs</h3>



<p class="">If you are not using user-assigned managed identity credentials, you must create credentials for elastic jobs. Click the <strong>New Credentials</strong> button to create it. <a href="https://elasticjobsmanager.azureops.org/docs/features/create-credentials.html" target="_blank" rel="noreferrer noopener">Learn </a>more about how to create credentials.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/credentials-screen.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="481" height="346" data-attachment-id="7266" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/credentials-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/credentials-screen.png?fit=481%2C346&amp;ssl=1" data-orig-size="481,346" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="credentials-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/credentials-screen.png?fit=481%2C346&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/credentials-screen.png?resize=481%2C346&#038;ssl=1" alt="" class="wp-image-7266" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/credentials-screen.png?w=481&amp;ssl=1 481w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/credentials-screen.png?resize=300%2C216&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/credentials-screen.png?resize=450%2C324&amp;ssl=1 450w" sizes="(max-width: 481px) 100vw, 481px" /></a></figure>



<h3 class="wp-block-heading">Create a Target group and add targets</h3>



<p class="">Define the target group where the job will run. These can include individual databases, all databases on a server, or all databases in an elastic pool. Elastic jobs provide flexibility to include or exclude specific databases. Click on the <strong>New TargetGroup</strong> button to create a new target group or double-click the existing target group to edit it. </p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-group-screen.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="546" height="407" data-attachment-id="7242" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/target-group-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-group-screen.png?fit=546%2C407&amp;ssl=1" data-orig-size="546,407" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="target-group-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-group-screen.png?fit=546%2C407&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-group-screen.png?resize=546%2C407&#038;ssl=1" alt="azure elastic jobs manager create targetgroup screen" class="wp-image-7242" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-group-screen.png?w=546&amp;ssl=1 546w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-group-screen.png?resize=300%2C224&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-group-screen.png?resize=450%2C335&amp;ssl=1 450w" sizes="(max-width: 546px) 100vw, 546px" /></a></figure>



<p class="">To add a target, click the <strong>Add target</strong> button. Choose the appropriate settings for the target and Click &#8216;OK&#8217; to add the target to the target group.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-screen.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="596" height="462" data-attachment-id="7243" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/target-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-screen.png?fit=596%2C462&amp;ssl=1" data-orig-size="596,462" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="target-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-screen.png?fit=596%2C462&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-screen.png?resize=596%2C462&#038;ssl=1" alt="azure elastic jobs manager create target screen" class="wp-image-7243" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-screen.png?w=596&amp;ssl=1 596w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-screen.png?resize=300%2C233&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/target-screen.png?resize=450%2C349&amp;ssl=1 450w" sizes="(max-width: 596px) 100vw, 596px" /></a></figure>



<h3 class="wp-block-heading">Create and Configure Jobs</h3>



<p class="">Now that the target group is set up, create jobs to execute on them.</p>



<p class="">Click the <strong>New Job</strong> button on the landing screen to create a new job or double-click on the existing job to edit it.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-general-screen.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="633" height="477" data-attachment-id="7248" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/job-general-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-general-screen.png?fit=633%2C477&amp;ssl=1" data-orig-size="633,477" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="job-general-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-general-screen.png?fit=633%2C477&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-general-screen.png?resize=633%2C477&#038;ssl=1" alt="azure elastic jobs manager create job screen" class="wp-image-7248" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-general-screen.png?w=633&amp;ssl=1 633w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-general-screen.png?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-general-screen.png?resize=450%2C339&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-general-screen.png?resize=600%2C452&amp;ssl=1 600w" sizes="(max-width: 633px) 100vw, 633px" /></a></figure>



<p class="">To manage steps within the job, click the &#8216;Steps&#8217; page.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-steps-screen.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="638" height="480" data-attachment-id="7251" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/job-steps-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-steps-screen.png?fit=638%2C480&amp;ssl=1" data-orig-size="638,480" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="job-steps-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-steps-screen.png?fit=638%2C480&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-steps-screen.png?resize=638%2C480&#038;ssl=1" alt="" class="wp-image-7251" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-steps-screen.png?w=638&amp;ssl=1 638w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-steps-screen.png?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-steps-screen.png?resize=450%2C339&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-steps-screen.png?resize=600%2C451&amp;ssl=1 600w" sizes="(max-width: 638px) 100vw, 638px" /></a></figure>



<p class="">Click the &#8216;New&#8217; button to create a new step or double-click on an existing step to edit the existing step.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/step-general-screen.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="628" height="477" data-attachment-id="7253" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/step-general-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/step-general-screen.png?fit=628%2C477&amp;ssl=1" data-orig-size="628,477" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="step-general-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/step-general-screen.png?fit=628%2C477&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/step-general-screen.png?resize=628%2C477&#038;ssl=1" alt="azure elastic jobs manager create job stepscreen" class="wp-image-7253" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/step-general-screen.png?w=628&amp;ssl=1 628w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/step-general-screen.png?resize=300%2C228&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/step-general-screen.png?resize=450%2C342&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/step-general-screen.png?resize=600%2C456&amp;ssl=1 600w" sizes="(max-width: 628px) 100vw, 628px" /></a></figure>



<p class="">To manage advanced properties such as timeout settings, click on the &#8216;<a href="https://elasticjobsmanager.azureops.org/docs/features/create-job/add-step/#managing-step-retry-settings">Advanced</a>&#8216; page. Click on the &#8216;<a href="https://elasticjobsmanager.azureops.org/docs/features/create-job/add-step/#configuring-job-step-output-to-database-table" target="_blank" rel="noreferrer noopener">Output</a>&#8216; page if you want to store the output of the SQL into an output table. Click &#8216;OK&#8217; to save changes in the step.</p>



<p class="">To manage the job schedule, click the &#8216;Schedule&#8217; page in the job properties. By default, the scheduling options will be in the local time zone. To change the timezone, navigate the &#8216;<a href="https://elasticjobsmanager.azureops.org/docs/features/settings.html">Settings</a>&#8216; page of the wizard and set the preferred time zone for future use.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-schedule-screen.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="638" height="480" data-attachment-id="7257" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/job-schedule-screen/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-schedule-screen.png?fit=638%2C480&amp;ssl=1" data-orig-size="638,480" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="job-schedule-screen" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-schedule-screen.png?fit=638%2C480&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-schedule-screen.png?resize=638%2C480&#038;ssl=1" alt="" class="wp-image-7257" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-schedule-screen.png?w=638&amp;ssl=1 638w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-schedule-screen.png?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-schedule-screen.png?resize=450%2C339&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/job-schedule-screen.png?resize=600%2C451&amp;ssl=1 600w" sizes="(max-width: 638px) 100vw, 638px" /></a></figure>



<p class="">Click &#8216;OK&#8217; to save changes to the job. </p>



<h3 class="wp-block-heading">Manage and monitor jobs</h3>



<p class="">Once you create the jobs, you can perform various actions on the job like Start job, stop job, Enable job, Disable job, View history, etc. </p>



<figure class="wp-block-image size-full is-resized"><a href="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1002" height="517" data-attachment-id="8313" data-permalink="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/image-32/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?fit=1002%2C517&amp;ssl=1" data-orig-size="1002,517" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?fit=1002%2C517&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?resize=1002%2C517&#038;ssl=1" alt="" class="wp-image-8313" style="width:848px;height:auto" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?w=1002&amp;ssl=1 1002w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?resize=300%2C155&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?resize=768%2C396&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?resize=450%2C232&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2024/03/image-1.png?resize=600%2C310&amp;ssl=1 600w" sizes="(max-width: 1002px) 100vw, 1002px" /></a></figure>



<p class="has-background" style="background-color:#bcefca"><strong>Pro tips:</strong><br>1. Azure Elastic Jobs Manager provides a lot more features. Check out the <a href="https://elasticjobsmanager.azureops.org/" target="_blank" rel="noreferrer noopener">documentation </a>of the plugin to know more about it.<br>2. Azure Elastic Jobs can use user assigned managed identity to authenticate with target databases.  Follow <a href="https://azureops.org/articles/create-user-assigned-managed-identity-in-azure/" target="_blank" rel="noreferrer noopener">these </a>quick steps to create user assigned managed identity in Azure.</p>
<p>The post <a href="https://azureops.org/articles/create-elastic-job-using-azure-elastic-jobs-manager/">Create Elastic Jobs Using Azure Elastic Jobs Manager</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7233</post-id>	</item>
		<item>
		<title>Automating Azure SQL Database Maintenance Tasks</title>
		<link>https://azureops.org/articles/automating-azure-sql-database-maintenance-tasks/</link>
		
		<dc:creator><![CDATA[Kunal Rathi]]></dc:creator>
		<pubDate>Sat, 08 May 2021 09:18:51 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Elastic Job agent]]></category>
		<category><![CDATA[SQL Database]]></category>
		<category><![CDATA[Automate Azure SQL maintenance]]></category>
		<category><![CDATA[azure sql rebuild index]]></category>
		<category><![CDATA[Execute jobs using elastic agent job]]></category>
		<guid isPermaLink="false">https://azureops.org/?p=751</guid>

					<description><![CDATA[<p>Automate Azure SQL Database index and statistics maintenance tasks using the Azure Elastic Job agent. </p>
<p>The post <a href="https://azureops.org/articles/automating-azure-sql-database-maintenance-tasks/">Automating Azure SQL Database Maintenance Tasks</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="">Azure SQL Database is a fully managed relational database service provided by Microsoft as part of the Azure cloud computing platform. It is based on Microsoft SQL Server and allows you to store, manage, and retrieve data in a scalable and secure manner. In this article, I have described automating Azure SQL database maintenance tasks using Azure Elastic Job agent and azuresqlmaintenance procedure. You can follow the same steps to configure and execute any other job on Azure SQL databases. </p>



<h2 class="wp-block-heading">Background</h2>



<p class="">Azure SQL database does not have its native SQL server agent, unlike SQL Server or Azure SQL Managed Instance. Microsoft has introduced an Azure Elastic Job agent managed service for scheduling jobs on Azure SQL Databases.  </p>



<h3 class="wp-block-heading">When should you use Azure Elastic Job Agent?</h3>



<p class="">An Elastic Job agent is&nbsp;the Azure resource for creating, running, and managing jobs similar to SQL Server Agent jobs. We can also run elastic queries on multiple Azure SQL databases using a single elastic agent job. </p>



<p class="">You should consider using Azure Elastic Job Agent  whenever:&nbsp;</p>



<ul class="wp-block-list">
<li class="">You have an activity or script that needs to be run regularly on a schedule, targeting one or more databases.&nbsp;</li>



<li class="">You have a script that needs to be run once but across multiple databases.&nbsp;</li>



<li class="">Combine the results of the job execution from multiple databases in a shared database.</li>
</ul>



<p class="has-pale-cyan-blue-background-color has-background"><strong>Pre-requisites:</strong><br>1. Create a blank Azure <a href="https://portal.azure.com/#create/Microsoft.SQLDatabase" target="_blank" rel="noreferrer noopener">SQL database</a> for Elastic Job agent. with the name say &#8220;AgentJobs&#8221; on Azure Portal. The Minimum required compute for this database is S1 (20 DTU). You can create this database under the existing Azure SQL Server.<br>2. Create a new <a href="https://portal.azure.com/#create/Microsoft.SQLElasticJobAgent" target="_blank" rel="noreferrer noopener">Elastic Job agent</a> on Azure Portal. Choose the database created in the above step(1).<br>3. <a href="https://raw.githubusercontent.com/yochananrachamim/AzureSQL/master/AzureSQLMaintenance.txt" target="_blank" rel="noreferrer noopener">Download </a>the latest <strong>AzureSQLMaintenance</strong> procedure code by <strong>Yochanan_MSFT</strong>. This procedure has features to update statistics &amp; indexes. Read more about the execution options on <a href="https://techcommunity.microsoft.com/t5/azure-database-support-blog/how-to-maintain-azure-sql-indexes-and-statistics/ba-p/368787" target="_blank" rel="noreferrer noopener">MSDN</a>. We need to <strong>deploy this procedure code on all the target databases</strong> where we need to automate database maintenance.</p>



<h2 class="wp-block-heading">Process</h2>



<p class="">If you have followed all the prerequisites, please execute the scripts below to automate the maintenance job on Azure SQL databases.  You must log in to Azure SQL Server with admin credentials using SSMS. </p>



<h3 class="wp-block-heading">Master database</h3>



<p class=""> Execute the<strong> </strong>below script to <strong>create a login </strong>on the Master<strong> </strong>database of the Azure SQL server containing target databases. </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; highlight: [3]; title: ; notranslate">
--Master
CREATE LOGIN JobUser
WITH PASSWORD = &#039;JobCredentials@123&#039;
GO
</pre></div>


<h3 class="wp-block-heading">Target database</h3>



<p class="">Run the below script on all the target databases to <strong>create a user.</strong></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; highlight: [5,6]; title: ; quick-code: false; notranslate">
--TargetDB1
CREATE USER JobUser
FROM LOGIN JobUser
GO
ALTER ROLE db_owner 
ADD MEMBER JobUser
GO
</pre></div>


<p class="">You can grant the least possible privileges to the <strong>JobUser</strong> instead of the <code>db_owner</code> role. Moreover, this user will be responsible for executing  <strong>AzureSQLMaintenance </strong>procedure. </p>



<h3 class="wp-block-heading">AgentJobs database (database for Elastic Job agent)</h3>



<p class="">1. Run the below script on the AgentJobs database to <strong>create the credentials</strong>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; highlight: [5]; title: ; notranslate">
--AgentJobs - Creating credentials
CREATE MASTER KEY ENCRYPTION BY PASSWORD=&#039;AgeNtJob@123&#039;
GO
CREATE DATABASE SCOPED CREDENTIAL JobCredentials WITH IDENTITY = &#039;JobUser&#039;,
SECRET = &#039;JobCredentials@123&#039;
GO
</pre></div>


<p class="">Notice that we have used the same password as we have used to create a login in the master database of the target server.</p>



<p class="">2. Create the target group on the AgentJobs database.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; quick-code: false; notranslate">
--AgentJobs - Creating target group
EXEC jobs.sp_add_target_group &#039;DatabaseGroup1&#039;
GO
</pre></div>


<p class="">3. <strong>Add the target database to the target group</strong>.  Repeat the procedure jobs.sp_add_target_group_member for all target databases.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; first-line: 1; highlight: [4,5]; title: ; quick-code: false; notranslate">
--AgentJobs - Add databases to the target group
EXEC jobs.sp_add_target_group_member &#039;DatabaseGroup1&#039;,
@target_type =  N&#039;SqlDatabase&#039;,
@server_name=&#039;&lt;dbserver&gt;.database.windows.net&#039;,
@database_name =N&#039;TargetDB1&#039;
GO
</pre></div>


<p class="">4. <strong>Create an Elastic agent job</strong> to execute <strong>AzureSQLMaintenance</strong> procedure.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; highlight: [5]; title: ; notranslate">
--AgentJobs Create the job
EXEC jobs.sp_add_job @job_name=&#039;Database-Maintenance&#039;, @description=&#039;&#039;
GO 
EXEC jobs.sp_add_jobstep @job_name=&#039;Database-Maintenance&#039;,
@command=N&#039;exec &#x5B;dbo].&#x5B;AzureSQLMaintenance] @Operation=&#039;&#039;all&#039;&#039; ,@LogToTable=1&#039;,
@credential_name=&#039;JobCredentials&#039;,
@target_group_name=&#039;DatabaseGroup1&#039;,
@step_timeout_seconds = 100000
GO
</pre></div>


<p class="has-background" style="background-color:#e8bc1c69"><strong>Note</strong>:<br><strong>AzureSQLMaintenance</strong> provides the ability to run <strong>statistics </strong>and <strong>index</strong> updates separately. If you wish only to automate Azure SQL rebuild index, instead of <strong>@Operation=&#8217;all&#8217;</strong>/, you can specify the value as  <strong>@Operation=&#8217;index&#8217;</strong>.</p>



<figure class="is-style-default wp-block-image size-large is-resized"><a href="https://marketplace.visualstudio.com/items?itemName=AzureOps.ssiscatalogerpro&amp;ssr=false#overview" target="_blank" rel="noopener"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="148" data-attachment-id="4839" data-permalink="https://azureops.org/articles/azure-data-studio-for-sql-developers/scmw-horizontal-ad/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?fit=1326%2C163&amp;ssl=1" data-orig-size="1326,163" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="SCMW-horizontal-ad" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?fit=1200%2C148&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=1200%2C148&#038;ssl=1" alt="" class="wp-image-4839" style="object-fit:cover;width:811px;height:99px" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=1200%2C148&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=450%2C55&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=600%2C74&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=300%2C37&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?resize=768%2C94&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2023/01/SCMW-horizontal-ad.png?w=1326&amp;ssl=1 1326w" sizes="(max-width: 1200px) 100vw, 1200px" /></a></figure>



<p class="">5. <strong>Schedule the job</strong> by executing the below script on the AgentJobs database. The below script will configure the job to run every 2 weeks.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; quick-code: false; notranslate">
--AgentJobs - Execute the job manually
EXEC jobs.sp_start_job &#039;Database-Maintenance&#039;
--Schedule the job (every 2 weeks)
EXEC jobs.sp_update_job
    @job_name=&#039;Database-Maintenance&#039;,
    @enabled=1,
    @schedule_interval_type=&#039;Weeks&#039;,
    @schedule_interval_count=2,
    @schedule_start_time= N&#039;2021-05-08 10:00&#039;;  --DateTime in UTC.
</pre></div>


<p class="">6. <strong>Monitor</strong> the job logs.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; quick-code: false; notranslate">
--AgentJobs
SELECT * FROM &#x5B;jobs_internal].&#x5B;job_executions]
</pre></div>


<p class="">You can also monitor the execution status on Azure Portal -&gt; Elastic Agent Job Overview.</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="1200" height="569" data-attachment-id="794" data-permalink="https://azureops.org/articles/automating-azure-sql-database-maintenance-tasks/elastic-agent-job-monitoring-1/" data-orig-file="https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?fit=1924%2C913&amp;ssl=1" data-orig-size="1924,913" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Elastic-agent-job-monitoring-1" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?fit=1200%2C569&amp;ssl=1" src="https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?resize=1200%2C569&#038;ssl=1" alt="azure sql maintenance jobs using Elastic Job agent and [dbo].[azuresqlmaintenance] procedure." class="wp-image-794" srcset="https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?resize=1200%2C569&amp;ssl=1 1200w, https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?resize=450%2C214&amp;ssl=1 450w, https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?resize=600%2C285&amp;ssl=1 600w, https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?resize=768%2C364&amp;ssl=1 768w, https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?resize=1536%2C729&amp;ssl=1 1536w, https://i0.wp.com/azureops.org/wp-content/uploads/2021/05/Elastic-agent-job-monitoring-1.png?w=1924&amp;ssl=1 1924w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<h2 class="wp-block-heading">Other options</h2>



<p class="">We have seen how to automate Azure SQL rebuild index using Azure Elastic Job Agent. Below are some other ways to achieve this. </p>



<ol class="wp-block-list">
<li class=""><strong>AzureSQLMaintenance</strong> procedure can be scheduled to run using <strong>Azure Data Factory </strong>pipeline. </li>



<li class=""><strong>AzureSQLMaintenance</strong> procedure can be run using <strong>Azure Automation account runbook</strong>. However, <strong>Azure Automation</strong>&nbsp;has a feature called <strong>fairshare</strong>, where any&nbsp;runbook&nbsp;that&nbsp;<strong>runs for 3 hours</strong>&nbsp;is unloaded to allow other runbooks to&nbsp;run. If the maintenance job runs longer, the procedure might terminate abnormally. </li>
</ol>



<p class="has-background" style="background-color:#bcefda"><strong>Pro tips:</strong><br>1. It would be best to allow Azure services and resources to access this Azure SQL server containing the Elastic Job agent database and target databases.<br>2. If you have automated database deployments using Azure DevOps (<a href="https://azureops.org/articles/dacpac-sql-server-database/" target="_blank" rel="noreferrer noopener">DACPAC</a>), you may need to add AzureSQLMaintenance procedure code in all the target database projects.<br>3. Elastic job Agent step by default times out in 12 hrs. To run a procedure or script that might run for more than 12 hrs, <strong>specify @step_timeout_seconds = &lt;Number of seconds></strong> in the job step.<br>4. It is recommended to try <strong>AzureSQLMaintenance</strong> features in the DEV environment before running it on PROD.<br>5.. You can manage Elastic jobs in Azure using <a href="https://marketplace.visualstudio.com/items?itemName=AzureOps.elasticjobsmanager1719" target="_blank" rel="noreferrer noopener">Azure Elastic Jobs Manager</a> Visual Studio extension. Know more about it <a href="https://elasticjobsmanager.azureops.org/" target="_blank" rel="noreferrer noopener">here</a>.</p>



<p class="">We have seen a step-by-step process to automate Azure SQL database maintenance tasks. Feel free to connect with me should you have any questions about it.</p>



<h2 class="wp-block-heading">See more</h2>



<iframe width="700" height="394" src="https://www.youtube.com/embed/8YVrxCgdiIg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<p>The post <a href="https://azureops.org/articles/automating-azure-sql-database-maintenance-tasks/">Automating Azure SQL Database Maintenance Tasks</a> appeared first on <a href="https://azureops.org">AzureOps</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">751</post-id>	</item>
	</channel>
</rss>
