<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Mirrored Sql server not Resumeing automatically even after the Capacity resumes in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5123383#M15263</link>
    <description>&lt;P&gt;This is super cool&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1445078"&gt;@deborshi_nag&lt;/a&gt;&amp;nbsp; it worked. thank you so much for your time and efforts.&lt;BR /&gt;have a great day ahead&lt;/P&gt;</description>
    <pubDate>Sat, 28 Feb 2026 15:13:56 GMT</pubDate>
    <dc:creator>JibinSebastian</dc:creator>
    <dc:date>2026-02-28T15:13:56Z</dc:date>
    <item>
      <title>Mirrored Sql server not Resumeing automatically even after the Capacity resumes</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5122497#M15256</link>
      <description>&lt;P&gt;I have connected a mirrored SQL database and everything was working properly. However, our Fabric capacity is scheduled to be suspended at 7:00 PM and resumed the next day at 7:00 AM. Because of this, I need to manually resume the replication in the mirrored SQL database each morning. Is there a way to automate or avoid this manual step?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JibinSebastian_0-1772203677535.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1328347i35DCF8366B1126A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JibinSebastian_0-1772203677535.png" alt="JibinSebastian_0-1772203677535.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 14:48:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5122497#M15256</guid>
      <dc:creator>JibinSebastian</dc:creator>
      <dc:date>2026-02-27T14:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Mirrored Sql server not Resumeing automatically even after the Capacity resumes</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5122700#M15258</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1380740"&gt;@JibinSebastian&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When a Fabric capacity is resumed following its nightly pause, please note that Mirroring does not automatically resume; the mirrored database will display Status = Paused and requires a Resume replication action to restart change capture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are two Microsoft-native solutions to help eliminate the need for this daily manual intervention.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Time-based resume using Azure Automation&lt;/STRONG&gt;&lt;BR /&gt;Mirroring can be managed programmatically (start/stop) via the public REST API. After resuming capacity, invoking Start Mirroring will transition each mirrored database from Paused to Running without the need for manual input in the UI. You can set it to start at a particualr time of the day, say 8 AM in the morning.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Event-driven resume on “Capacity Resumed”&lt;/STRONG&gt;&lt;BR /&gt;Leverage Azure Monitor to listen for the “Resume the specified Fabric capacity” platform event, and trigger an Automation Runbook that initiates Start Mirroring for all mirrored databases associated with that capacity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For further details, please refer to the official Microsoft documentation:&lt;/P&gt;&lt;P&gt;&lt;A title="https://learn.microsoft.com/en-us/fabric/enterprise/pause-resume" href="https://learn.microsoft.com/en-us/fabric/enterprise/pause-resume" rel="noreferrer noopener" target="_blank"&gt;Pause and resume your capacity - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 17:54:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5122700#M15258</guid>
      <dc:creator>deborshi_nag</dc:creator>
      <dc:date>2026-02-27T17:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Mirrored Sql server not Resumeing automatically even after the Capacity resumes</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5122726#M15260</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1445078"&gt;@deborshi_nag&lt;/a&gt;&amp;nbsp;, I tried creating a fabric notebook to change the status to Running but it didn't worked.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JibinSebastian_0-1772216046562.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1328384i350354D1AC8D9EA9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JibinSebastian_0-1772216046562.png" alt="JibinSebastian_0-1772216046562.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JibinSebastian_1-1772216181723.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1328387i5BD2DB62F9F33EFD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JibinSebastian_1-1772216181723.png" alt="JibinSebastian_1-1772216181723.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There was no item for this replication status.&lt;BR /&gt;&lt;BR /&gt;i will try using Azure automation and will let you know the updates&lt;BR /&gt;&lt;BR /&gt;thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 18:17:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5122726#M15260</guid>
      <dc:creator>JibinSebastian</dc:creator>
      <dc:date>2026-02-27T18:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Mirrored Sql server not Resumeing automatically even after the Capacity resumes</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5123369#M15262</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1380740"&gt;@JibinSebastian&lt;/a&gt;&amp;nbsp;this is a code snippet you may want to try and see if it works! It restarts any mirrored database in your workspace that is not in Running status.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def get_fabric_token_via_user() -&amp;gt; str:
    """
    User-context token in a Fabric notebook.
    NOTE: Some endpoints may fail with InsufficientScopes under SPN contexts; SPN is recommended.
    """
    # Try Fabric audience first; fall back to built-in 'pbi' token if needed.
    try:
        return mssparkutils.credentials.getToken("https://api.fabric.microsoft.com/.default")
    except Exception:
        return mssparkutils.credentials.getToken("pbi")

def fabric_request(method: str, path: str, token: str, body: Optional[dict] = None):
    base = "https://api.fabric.microsoft.com/v1"
    url  = path if path.startswith("http") else f"{base}/{path}"
    headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json", "Accept":"application/json"}

    # simple 429 retry loop
    for attempt in range(6):
        resp = requests.request(method, url, headers=headers, json=body, timeout=60)
        if resp.status_code != 429:
            if not resp.ok:
                raise RuntimeError(f"Fabric API {method} {url} failed: {resp.status_code} {resp.text}")
            return resp
        retry_after = int(resp.headers.get("Retry-After", "5"))
        print(f"429 from Fabric API. Retrying in {retry_after}s ...")
        time.sleep(retry_after)
    raise RuntimeError("Fabric API throttled repeatedly (429)")

fabric_token = get_fabric_token_via_user()

def start_mirroring_for_workspace(workspace_id: str):
    print(f"\nWorkspace {workspace_id}: listing mirrored databases ...")
    # GET /workspaces/{workspaceId}/mirroredDatabases
    mirrors = fabric_request("GET", f"workspaces/{workspace_id}/mirroredDatabases", fabric_token).json().get("value", [])
    if not mirrors:
        print("No Mirrored Databases found.")
        return

    for m in mirrors:
        mid   = m["id"]
        name  = m.get("displayName", mid)
        # POST /getMirroringStatus
        status = fabric_request("POST", f"workspaces/{workspace_id}/mirroredDatabases/{mid}/getMirroringStatus", fabric_token).json().get("status")
        print(f"  - '{name}': current status = {status}")
        if status != "Running":
            print(f"    Starting mirroring for '{name}' ...")
            # POST /startMirroring
            fabric_request("POST", f"workspaces/{workspace_id}/mirroredDatabases/{mid}/startMirroring", fabric_token)
            time.sleep(2)
            status2 = fabric_request("POST", f"workspaces/{workspace_id}/mirroredDatabases/{mid}/getMirroringStatus", fabric_token).json().get("status")
            print(f"    New status = {status2}")
        else:
            print(f"    Already Running. Skipping.")

for wsid in WORKSPACE_IDS:
    start_mirroring_for_workspace(wsid)

print("\nDone.")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Feb 2026 14:50:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5123369#M15262</guid>
      <dc:creator>deborshi_nag</dc:creator>
      <dc:date>2026-02-28T14:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Mirrored Sql server not Resumeing automatically even after the Capacity resumes</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5123383#M15263</link>
      <description>&lt;P&gt;This is super cool&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1445078"&gt;@deborshi_nag&lt;/a&gt;&amp;nbsp; it worked. thank you so much for your time and efforts.&lt;BR /&gt;have a great day ahead&lt;/P&gt;</description>
      <pubDate>Sat, 28 Feb 2026 15:13:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Mirrored-Sql-server-not-Resumeing-automatically-even-after-the/m-p/5123383#M15263</guid>
      <dc:creator>JibinSebastian</dc:creator>
      <dc:date>2026-02-28T15:13:56Z</dc:date>
    </item>
  </channel>
</rss>

