{"id":23236,"date":"2023-03-08T09:53:31","date_gmt":"2023-03-08T08:53:31","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=23236"},"modified":"2024-09-10T11:54:50","modified_gmt":"2024-09-10T09:54:50","slug":"maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/","title":{"rendered":"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less &#8211; azure managed identity"},"content":{"rendered":"\n<p>How do you check and rebuild your indexes for Azure SQL DBs in Elastic Pool? That question is getting even more interesting if you have only Private Endpoint enabled to connect to the MSSQL DB.&nbsp;<\/p>\n\n\n\n<p>Lets get started!&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"1\">\n<li>Requirements\n<ul class=\"wp-block-list\">\n<li>Azure SQL DBs in Elastic Pool<\/li>\n\n\n\n<li>Only Private Endpoint<\/li>\n\n\n\n<li>Simple and easy Maintenance for indexes<\/li>\n\n\n\n<li>Password less authentication (service account)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>Solutions&nbsp;\n<ul class=\"wp-block-list\">\n<li>Elastic Database Jobs<\/li>\n\n\n\n<li>Azure Automation<\/li>\n\n\n\n<li>Windows Task Scheduler \u2013 the old way<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Elastic Database Jobs<\/strong><\/h2>\n\n\n\n<p>So first, we need to check Elastic Database Jobs.&nbsp;<br><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/azure-sql\/database\/elastic-jobs-overview?view=azuresql\" target=\"_blank\" rel=\"noreferrer noopener\">Elastic Database Jobs (preview) &#8211; Azure SQL Database | Microsoft Learn<\/a>&nbsp;<\/p>\n\n\n\n<p>Unfortunately, there is one limitation right now, that Private endpoints aren&#8217;t supported.&nbsp;<br>So this option is not going to work.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Azure Automation<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/azure.microsoft.com\/en-us\/products\/automation\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azure Automation \u2013 Cloud Automation Service | Microsoft Azure<\/a>&nbsp;<br><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/architecture\/hybrid\/azure-automation-hybrid\" target=\"_blank\" rel=\"noreferrer noopener\">Azure Automation in a hybrid environment &#8211; Azure Architecture Center | Microsoft Learn<\/a>&nbsp;<br><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/automation\/automation-hrw-run-runbooks?tabs=sa-mi\" target=\"_blank\" rel=\"noreferrer noopener\">Run Azure Automation runbooks on a Hybrid Runbook Worker | Microsoft Learn<\/a><br><br>Theoretically, we can deploy a Runbook in combination with a Hybrid Worker. Why Hybrid Worker? Because that option is needed if you need connect to a Private endpoint.&nbsp;<br>After another look at the architecture, it is quite a big solution with many Azure resources and we still have to deploy a Virtual Machine (VM) (for the installation of the hybrid worker). After a meeting with a customer, this solution was declared too complex, and we must check the next one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PowerShell Script executed via Windows Task Scheduler<\/strong><\/h2>\n\n\n\n<p>So let\u2019s check the old way &#8211;\u00a0PowerShell Script executed via Windows Task Scheduler.\u00a0<br>And you will already expect the result, it\u2019s working like a charm.\u00a0<\/p>\n\n\n\n<p>As mentioned in the requirements, we must authenticate without a hardcoded password in the PowerShell script. In that case we can use Azure Managed Identity.&nbsp;<br><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/active-directory\/managed-identities-azure-resources\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">Managed identities for Azure resources &#8211; Microsoft Entra | Microsoft Learn<\/a><\/p>\n\n\n\n<p>Step-by-Step:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the Azure VM&nbsp;<\/li>\n\n\n\n<li>Enable Managed Identity in Azure for the VM (system assigned)&nbsp;<\/li>\n\n\n\n<li>Grant read permission for VM object to the Azure Elastic DB Server\n<ul class=\"wp-block-list\">\n<li>This is required to get\/query all DB names running in the elastic group<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the login for the VM object on SQL Instance&nbsp;<\/li>\n\n\n\n<li>Create the user for the VM object on every DB&nbsp;<\/li>\n\n\n\n<li>Grant the right permission for the VM object to get the work done\n<ul class=\"wp-block-list\">\n<li>in our case we grant dbo permission \u2013 please check the least privilege needed in your environment<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create and adjust the PowerShell script&nbsp;<\/li>\n\n\n\n<li>Create the scheduled task entry&nbsp;<\/li>\n\n\n\n<li>All done \ud83d\ude42 now you can query your databases and maintain them<\/li>\n<\/ul>\n\n\n\n<p>In our script example, we query Azure to get all DB names running in the elastic pool, then we loop through each database and execute a query to get the index stats.&nbsp;<br>After that, the script created a file called table.csv with all index information.&nbsp;<br>Of course you can replace the select query and execute any other statement.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#region info\n#https:\/\/dbatools.io\/offline\/\n#Get-ChildItem -Recurse C:\\Temp\\dbatools.1.1.145\\ | Unblock-File\n#$env:PSMODULEPATH\n#C:\\Program Files\\WindowsPowerShell\\Modules\\dbatools\\1.1.145\n\n\n#to view log in GV:\n#Import-Csv -LiteralPath $path_out_table_info -Delimiter \";\" | Out-GridView\n\n#endregion\n\n#region functions\nfunction add-logentry-to-json\n{\n    param(\n        &#091;Parameter(Mandatory=$true)]\n        &#091;AllowEmptyString()]\n        &#091;System.String]$logvariable\n\n        ,&#091;Parameter(Mandatory=$true)]\n        &#091;ValidateNotNull()]\n        &#091;System.String]$timestamp\n\n        ,&#091;Parameter(Mandatory=$true)]\n        &#091;ValidateSet(\"INFO\", \"WARN\", \"ERROR\", \"DEBUG\")]\n        &#091;System.String]$loglevel\n\n        ,&#091;Parameter(Mandatory=$true)]\n        &#091;ValidateNotNull()]\n        &#091;System.String]$logtext\n\n        ,&#091;Parameter(Mandatory=$true)]\n        &#091;AllowNull()]\n        &#091;System.Collections.Hashtable]$content\n    )\n\n    $out = @()\n\n    $tmp = @{\n        timestamp = $timestamp;\n        loglevel = $loglevel;\n        logtext = $logtext;\n        content = $content;\n    }\n\n    if(!&#091;string]::IsNullOrEmpty($logvariable))\n    {\n        $out += $logvariable | ConvertFrom-Json\n    }\n\n    $out += $tmp\n    \n    return ($out | ConvertTo-Json)\n}\n#endregion\n\n#region vars\n$TenantId = \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\"\n$Subscription = \"my-cool-subscription\"\n$ResourceGroupName = \"my-cool-resource-group\"\n$AzSqlElasticPoolDatabase_server = \"azep-db-server\"\n$ElasticPoolName = \"elastic-pool-name\"\n$SqlInstance = \"azep-db-server,1433\"\n\n$path_log = \"C:\\temp\\\"\n$path_out_log = Join-Path $path_log \"log.json\"\n$path_out_table_info = Join-Path $path_log \"table.csv\"\n#endregion\n\n\n#region init vars\n$json_log_content = \"\"\n$table = @()\n#endregion\n\n$ErrorActionPreference = \"STOP\"\n\ntry\n{\n    $json_log_content = add-logentry-to-json -logvariable $json_log_content `\n                        -timestamp $(Get-Date -Format o | ForEach-Object { $_ -replace \":\", \".\" }) `\n                        -loglevel \"INFO\" -logtext \"Script Start\" -content $null\n    \n    #import dbatools module with required version\n    Import-Module -Name dbatools -RequiredVersion 1.1.145\n\n    #connect to azure\n    Connect-AzAccount -TenantId $TenantId -Subscription $Subscription -Identity\n\n    #get all dbs from pool\n    $AzSqlElasticPoolDatabase = Get-AzSqlElasticPoolDatabase -ResourceGroupName $ResourceGroupName -ServerName $AzSqlElasticPoolDatabase_server -ElasticPoolName $ElasticPoolName\n\n    #get access token\n    $token = New-DbaAzAccessToken -Type ManagedIdentity -Subtype AzureSqlDb\n\n    #loop all dbs and fill table variable with index infos\n    #sequential to lower dtu consumption\n    $AzSqlElasticPoolDatabase | %{\n        try\n        {\n            $Database = $_.DatabaseName\n\n            $json_log_content = add-logentry-to-json -logvariable $json_log_content `\n                            -timestamp $(Get-Date -Format o | ForEach-Object { $_ -replace \":\", \".\" }) `\n                            -loglevel \"INFO\" -logtext \"Bearbeite DB: $Database ...\" -content $null\n\n            #connect to server\n            $server = Connect-DbaInstance -SqlInstance $SqlInstance -Database $Database -AccessToken $token -TrustServerCertificate\n\n            $tsql=\"\n                SELECT DB_Name() as 'DBName'\n                    ,OBJECT_SCHEMA_NAME(ips.OBJECT_ID) 'Schema'\n                    ,OBJECT_NAME(ips.OBJECT_ID) 'Table'\n                    ,i.NAME\n                    ,ips.index_id\n                    ,index_type_desc\n                    ,avg_fragmentation_in_percent\n                    ,avg_page_space_used_in_percent\n                    ,page_count\n                FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'SAMPLED') ips\n                INNER JOIN sys.indexes i ON (ips.object_id = i.object_id)\n                        AND (ips.index_id = i.index_id)\n                ORDER BY avg_fragmentation_in_percent DESC\n            \"\n        \n            #execute query and fill table variable\n            $table += Invoke-DbaQuery -SqlInstance $server -Query $tsql\n        }\n        catch\n        {\n            $json_log_content = add-logentry-to-json -logvariable $json_log_content `\n                                -timestamp $(Get-Date -Format o | ForEach-Object { $_ -replace \":\", \".\" }) `\n                                -loglevel \"ERROR\" -logtext \"Script runtime error\" `\n                                -content @{Message = $($_.Exception.Message);\n                                            ScriptLineNumber = $( $_.invocationinfo.ScriptLineNumber);\n                                            Line = $($_.invocationinfo.Line);}\n        }\n        finally\n        {\n            #disconnect server\n            $server | Disconnect-DbaInstance\n        }\n    }\n\n    #after loop, export table varibale to disk\n    $table | Sort-Object avg_fragmentation_in_percent,page_count -Descending | Export-Csv -LiteralPath $path_out_table_info -Delimiter \";\" -NoTypeInformation -Encoding Default\n    #Import-Csv -LiteralPath $path_out_table_info -Delimiter \";\" | Out-GridView\n\n    $json_log_content = add-logentry-to-json -logvariable $json_log_content `\n                        -timestamp $(Get-Date -Format o | ForEach-Object { $_ -replace \":\", \".\" }) `\n                        -loglevel \"INFO\" -logtext \"Script End\" -content $null\n}\ncatch\n{\n    $json_log_content = add-logentry-to-json -logvariable $json_log_content `\n                        -timestamp $(Get-Date -Format o | ForEach-Object { $_ -replace \":\", \".\" }) `\n                        -loglevel \"ERROR\" -logtext \"Script runtime error\" `\n                        -content @{Message = $($_.Exception.Message);\n                                    ScriptLineNumber = $( $_.invocationinfo.ScriptLineNumber);\n                                    Line = $($_.invocationinfo.Line);}\n}\nfinally\n{\n    &#091;system.io.file]::WriteAllText($path_out_log,$json_log_content)\n}\n<\/code><\/pre>\n\n\n\n<p>Thats it! \ud83d\ude42 Please leave a comment if you have any questions or contact us to get professional support.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do you check and rebuild your indexes for Azure SQL DBs in Elastic Pool? That question is getting even more interesting if you have only Private Endpoint enabled to connect to the MSSQL DB.&nbsp; Lets get started!&nbsp; Elastic Database Jobs So first, we need to check Elastic Database Jobs.&nbsp;Elastic Database Jobs (preview) &#8211; Azure [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3271,955,229,99],"tags":[1338,135,51],"type_dbi":[],"class_list":["post-23236","post","type-post","status-publish","format-standard","hentry","category-azure","category-cloud","category-database-administration-monitoring","category-sql-server","tag-azure","tag-cloud","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less - azure managed identity - dbi Blog<\/title>\n<meta name=\"description\" content=\"In this post you will learn how to maintain your Azure SQL DBs in Elastic Pool with a PowerShell Script executed via Windows Task Scheduler.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less - azure managed identity\" \/>\n<meta property=\"og:description\" content=\"In this post you will learn how to maintain your Azure SQL DBs in Elastic Pool with a PowerShell Script executed via Windows Task Scheduler.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-08T08:53:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-10T09:54:50+00:00\" \/>\n<meta name=\"author\" content=\"Microsoft Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less &#8211; azure managed identity\",\"datePublished\":\"2023-03-08T08:53:31+00:00\",\"dateModified\":\"2024-09-10T09:54:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/\"},\"wordCount\":525,\"commentCount\":0,\"keywords\":[\"Azure\",\"Cloud\",\"SQL Server\"],\"articleSection\":[\"Azure\",\"Cloud\",\"Database Administration &amp; Monitoring\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/\",\"name\":\"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less - azure managed identity - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2023-03-08T08:53:31+00:00\",\"dateModified\":\"2024-09-10T09:54:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"description\":\"In this post you will learn how to maintain your Azure SQL DBs in Elastic Pool with a PowerShell Script executed via Windows Task Scheduler.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less &#8211; azure managed identity\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\",\"name\":\"Microsoft Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"caption\":\"Microsoft Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less - azure managed identity - dbi Blog","description":"In this post you will learn how to maintain your Azure SQL DBs in Elastic Pool with a PowerShell Script executed via Windows Task Scheduler.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/","og_locale":"en_US","og_type":"article","og_title":"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less - azure managed identity","og_description":"In this post you will learn how to maintain your Azure SQL DBs in Elastic Pool with a PowerShell Script executed via Windows Task Scheduler.","og_url":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/","og_site_name":"dbi Blog","article_published_time":"2023-03-08T08:53:31+00:00","article_modified_time":"2024-09-10T09:54:50+00:00","author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less &#8211; azure managed identity","datePublished":"2023-03-08T08:53:31+00:00","dateModified":"2024-09-10T09:54:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/"},"wordCount":525,"commentCount":0,"keywords":["Azure","Cloud","SQL Server"],"articleSection":["Azure","Cloud","Database Administration &amp; Monitoring","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/","url":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/","name":"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less - azure managed identity - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2023-03-08T08:53:31+00:00","dateModified":"2024-09-10T09:54:50+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"description":"In this post you will learn how to maintain your Azure SQL DBs in Elastic Pool with a PowerShell Script executed via Windows Task Scheduler.","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/maintenance-azure-sql-dbs-in-elastic-pool-private-endpoint-example-based-on-index-fragmentation-password-less-azure-managed-identity\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) \u2013 example based on index fragmentation \u2013 password less &#8211; azure managed identity"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4","name":"Microsoft Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","caption":"Microsoft Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/23236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=23236"}],"version-history":[{"count":6,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/23236\/revisions"}],"predecessor-version":[{"id":23243,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/23236\/revisions\/23243"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=23236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=23236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=23236"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=23236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}