hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

Cross Tenant Peering #4546

Closed ghost closed 3 years ago

ghost commented 5 years ago

This issue was originally opened by @steve-88 as hashicorp/terraform#23014. It was migrated here as a result of the provider split. The original body of the issue is below.


Hi,

I am trying to create a peer from one Azure Tenant to another and get the following error:

Error: network.VirtualNetworkPeeringsClient#CreateOrUpdate: Failure sending request: StatusCode=403 -- Original Error: Code="LinkedAuthorizationFailed" Message="The client has permission to perform action 'Microsoft.Network/virtualNetworks/peer/action' on scope '/subscriptions/X1/resourceGroups/nonproduction/providers/Microsoft.Network/virtualNetworks/nonprod-vnet1/virtualNetworkPeerings/nonprod-vnet-to-core-prod-vnet', however the current tenant 'X1' is not authorized to access linked subscription 'X2'."

Is the only real solution to add service principles to my provider? In the portal, when you do it manually, you need to hit the authenticate button, which works using my credentials.

Terraform Version

Terraform v0.12.6
+ provider.azurerm v1.35.0

Terraform Configuration Files

module "nonprod_to_domain_controller_peer" {
  source = "../modules/vnet-peering"

  peer_source = "nonprod"
  peer_remote = "core-prod"

  resource_group_name       = "nonproduction"
  vnet_name                 = data.terraform_remote_state.nonprod_shared.outputs.nonprod_vnet_name
  remote_virtual_network_id = data.terraform_remote_state.core_prod.outputs.core_vnet_id

  allow_forwarded_traffic      = true
  allow_virtual_network_access = true

  use_remote_gateways   = false
  allow_gateway_transit = false

}

Debug Output

Crash Output

Expected Behavior

Actual Behavior

Steps to Reproduce

Additional Context

References

favoretti commented 3 years ago

Since this issue has been reported a long time ago and relates to the version of provider we no longer support - I'm going to close it. Please open a new updated bug report on current versions of terraform and provider if this is still relevant. Thank you.

github-actions[bot] commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.