{"id":1107,"date":"2025-02-13T19:56:09","date_gmt":"2025-02-13T18:56:09","guid":{"rendered":"https:\/\/wp.bizoir.dk\/?p=1107"},"modified":"2025-08-20T22:04:00","modified_gmt":"2025-08-20T21:04:00","slug":"azure-bicep-deployment-maintenance-windows","status":"publish","type":"post","link":"https:\/\/wp.bizoir.dk\/?p=1107","title":{"rendered":"Azure Bicep Deployment &#8211; Maintenance Windows for sql-databases"},"content":{"rendered":"<p>Automating things using bicep for Azure deployment can be hard.<\/p>\n<p>While it is <a href=\"https:\/\/learn.microsoft.com\/da-dk\/azure\/azure-sql\/database\/maintenance-window-configure?view=azuresql&amp;tabs=azure-portal\">trivially easy to find<\/a> out how to configure maintenance windows for an SQL database using the Azure Portal directly, it is equally hard to find out how to set it using bicep deployment<\/p>\n<p>No direct search gives any relevant links (apart from <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/templates\/microsoft.sql\/servers\/databases\">saying<\/a> the the <code>maintenanceConfigurationId<\/code> in the bicep-file must a \u201cstring\u201d)<\/p>\n<p><!--more--><\/p>\n<p>Finally found <a href=\"https:\/\/techcommunity.microsoft.com\/blog\/azuresqlblog\/public-preview-maintenance-window-support-for-azure-sql-database-hyperscale-elas\/4097682\">this<\/a>, leading to an AzCli (or Azure Powershell) command, that can list default public standard servicewindows.<\/p>\n<p><code>az maintenance public-configuration list<\/code> gives a quite long list<\/p>\n<p><code>az maintenance public-configuration list \u2013query \u201c[?location==\u2019westeurope\u2019]\u201d \u2013output table<\/code> is better.<\/p>\n<p>So in \u201cWest Europe\u201d region, the standard Servicewindows are called:<br \/>\n&#8211; SQL_Default<br \/>\n&#8211; SQL_WestEurope_DB_1 (Mon \u2013 Thu)<br \/>\n&#8211; SQL_WestEurope_DB_2 (Fri \u2013 Sun)<\/li>\n<p>and the full string used for <code>maintenanceConfigurationId<\/code> would be <code>\/subscriptions\/&lt;&lt;SUBSCRIPTION ID&gt;&gt;\/providers\/Microsoft.Maintenance\/publicMaintenanceConfigurations\/SQL_WestEurope_DB_2<\/code><\/p>\n<p>or <a href=\"https:\/\/stackoverflow.com\/questions\/76465796\/how-to-set-the-maintenance-window-for-elastic-pool-in-bicep-script\">alternatively<\/a><\/p>\n<p><code>subscriptionResourceId(\u2018Microsoft.Maintenance\/publicMaintenanceConfigurations\u2019, \u2018SQL_Default\u2019)<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automating things using bicep for Azure deployment can be hard. While it is trivially easy to find out how to configure maintenance windows for an SQL database using the Azure Portal directly, it is equally hard to find out how to set it using bicep deployment No direct search gives any relevant links (apart from &hellip; <a href=\"https:\/\/wp.bizoir.dk\/?p=1107\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Azure Bicep Deployment &#8211; Maintenance Windows for sql-databases&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[30],"class_list":["post-1107","post","type-post","status-publish","format-standard","hentry","category-guides","tag-azure"],"_links":{"self":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/1107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1107"}],"version-history":[{"count":12,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/1107\/revisions"}],"predecessor-version":[{"id":1131,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/1107\/revisions\/1131"}],"wp:attachment":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}