You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the error below as:Error: Error refreshing state: 1 error occurred:
* provider.azurerm: Error building account: Error getting authenticated object ID: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status #1
Current state is I'm able to see the resourceGroup and VirtualNetwork Details in the terraform state file which is correct. But while interpolating as "data.azurerm_resource_group.rgname.name", in azurerm_virtual_network_peering resource, it always gives me the error as :
azurerm_virtual_network_peering.coretovnet: network.VirtualNetworkPeeringsClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="ResourceGroupNotFound" Message="Resource group 'co-np-eastus-core1-rg' could not be found." The RG-not-found is over the resource data.azurerm_resource_group.
The SPN has contributor access to both the subscriptions. Kindly help
This forum is intended to be used for feature enhancements and bugs in the Azure Provider - so that we can keep this forum focused on that we instead ask that broader questions are raised using one of the Community Resources. As such I'm going to close this issue for the moment, but I believe you should be able to get an answer for this using one of the Community Resources.
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
ghost
locked and limited conversation to collaborators
Mar 28, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am using the below code to peer my created vnet with an existing Vnet in a separate subscription.
provider "azurerm" {
alias = "core"
subscription_id = "REMOTESUBID"
tenant_id = "CurrentTenantID"
client_id = "ClientIDConstant"
client_secret = "ClientIDConstant"
}
data "azurerm_virtual_network" "remotevnet" {
provider = "azurerm.core"
name = "co-np-eastus-core1-vnet"
resource_group_name = "co-np-eastus-core1-rg"
}
module "applicationrg"
{
source = "../modules/resource_group"
resource_group_name = "${var.applicationrg_name}"
resource_group_location = "${var.application_rg_location}"
tags = "${var.tags}"
}
module "applicationvnet"{
source="../modules/virtual_network"
virtual_network_name="${var.virtual_network_name}"
resource_group_location = "${module.applicationrg.resource_group_location}"
resource_group_name ="${module.applicationrg.resource_group_name}"
address_space = "${var.address_space}"
dns_server = "${var.dns_server}"
tags = "${var.tags}"
}
resource "azurerm_virtual_network_peering" "CreatedVnetToRemoteVnet" {
name = "CreatedVnettoRemoteVnet"
virtual_network_name = "${module.applicationvnet.virtual_network_name}"
resource_group_name = "${module.applicationrg.resource_group_name}"
remote_virtual_network_id = "${data.azurerm_virtual_network.remotevnet.id}"
allow_virtual_network_access = true
allow_forwarded_traffic = true
}
resource "azurerm_virtual_network_peering" "RemoteVnetToCreatedVnet" {
name = "RemoteVnettoCreatedVnet"
virtual_network_name = "${data.azurerm_virtual_network.corevnet.name}"
resource_group_name = "${data.azurerm_virtual_network.corevnet.resource_group_name}"
remote_virtual_network_id = "/subscriptions/${data.azurerm_subscription.current.subscription_id}/resourceGroups/${module.applicationrg.resource_group_name}/providers/Microsoft.Network/virtualNetworks/${module.applicationvnet.virtual_network_name}"
allow_virtual_network_access = true
allow_forwarded_traffic = true
}
I'm getting the error below as:Error: Error refreshing state: 1 error occurred:
* provider.azurerm: Error building account: Error getting authenticated object ID: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status #1
Issue is related to #1253 (#1253)
I'm using the same Service principal, which has contributor access to both the subscription. Kindly help. I am using the below versions.
terraform {
required_version = "= 0.11.14"
}
provider "azurerm" {
version = "= 1.44.0"
}
provider "null" {
version = "= 2.1.1"
}
provider "template" {
version = "= 2.1.1"
}
The text was updated successfully, but these errors were encountered: