> Source: [sk181666](https://support.checkpoint.com/results/sk/sk181666)

# sk181666 - "Failed to retrieve peered network" error in Azure HA deployed with terraform

| Property | Value |
|----------|-------|
| Solution ID | sk181666 |
| Date Created | 2023-11-19 |
| Last Modified | 2026-05-10 |
| Technical Level | General |
| Products | Cloud Firewall |
| Versions | R82.10, R81.20, R82 |
| Platform | Azure |

## Symptoms

- * `"Failed to retrieve peered network"` error in Azure HA deployed with terraform.

* A similar error shows in the *$FWDIR/log/azure_had.elg* log file:

  `{"error":{"code":"AuthorizationFailed","message":"The client <>\' with object id \'<>\' does not have authorization to perform action \'Microsoft.Network/virtualNetworks/read\' over scope or the scope is invalid. If access was recently granted, please refresh your credentials."}}'`

## Cause

This error indicates there are peered Vnet without sufficient permissions (contributor).

There is an issue in the *azure_had.py* script,where if the template name equals "`ha_terraform in the $FWDIR/conf/azure-ha.json,`" the script incorrectly iterates the peered network, leading to this issue.

## Solution

Run this procedure in an existing deployment:

Notes:

* Make sure to do these steps on both Cluster members.
* Termination of the HAD service does not start a failover.

Procedure:

1. Find the azure_had.py script on the Security Gateway with this command:

   `# find / -name azure_had.py`
2. Edit the script with the vi command.

3. Find the `setLocalActive() `function

4. Change the if condition from:

   `if templateName = 'ha' :`

   to:

   `if templateName in ['ha', 'ha_terraform']:`
5. Save the changes.

6. To stop the HAD service run:

   `# 'kill -9 $(cpwd_admin getpid -name AZURE_HAD)`

   The HAD service load the new script and starts automatically.

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
