Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create log analytics resource #1348

Closed
rohrerb opened this issue Jun 5, 2018 · 2 comments · Fixed by #1410
Closed

Can't create log analytics resource #1348

rohrerb opened this issue Jun 5, 2018 · 2 comments · Fixed by #1410
Assignees
Milestone

Comments

@rohrerb
Copy link
Contributor

rohrerb commented Jun 5, 2018

*Unlikely this is related to - #1078

Terraform v0.11.7

  • provider.azurerm v1.6.0

TF File:

provider "azurerm" {
subscription_id = "75406810-f3e6-42fa-97c6-e9027e0a0a45"
environment = "usgovernemnt"
}

resource "azurerm_resource_group" "loganalytics" {
name = "Log-AnalyticsX1"
location = "USGov Virginia"
}

resource "azurerm_log_analytics_workspace" "log_analytics_workspace" {
name = "LogAnalyticsX1"
location = "${azurerm_resource_group.loganalytics.location}"
resource_group_name = "${azurerm_resource_group.loganalytics.name}"
sku = "PerNode"
retention_in_days = 30
}

Resource Group is created and log analytics workspace throws a odd error about invalid subscription. Makes no sense as the resource group is created with that subscription. I am able to create the log analytics instance through the portal with no issues. Tested it in Commercial and the above script ran perfectly fine.

Output:

Terraform will perform the following actions:

  • azurerm_log_analytics_workspace.log_analytics_workspace
    id:
    location: "usgovvirginia"
    name: "LogAnalyticsX1"
    portal_url:
    primary_shared_key:
    resource_group_name: "Log-AnalyticsX1"
    retention_in_days: "30"
    secondary_shared_key:
    sku: "PerNode"
    tags.%:
    workspace_id:

  • azurerm_resource_group.loganalytics
    id:
    location: "usgovvirginia"
    name: "Log-AnalyticsX1"
    tags.%:

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

azurerm_resource_group.loganalytics: Creating...
location: "" => "usgovvirginia"
name: "" => "Log-AnalyticsX1"
tags.%: "" => ""
azurerm_resource_group.loganalytics: Creation complete after 1s (ID: /subscriptions/75406810-f3e6-42fa-97c6-...e0a0a45/resourceGroups/Log-AnalyticsX1)
azurerm_log_analytics_workspace.log_analytics_workspace: Creating...
location: "" => "usgovvirginia"
name: "" => "LogAnalyticsX1"
portal_url: "" => ""
primary_shared_key: "" => ""
resource_group_name: "" => "Log-AnalyticsX1"
retention_in_days: "" => "30"
secondary_shared_key: "" => ""
sku: "" => "PerNode"
tags.%: "" => ""
workspace_id: "" => ""

Error: Error applying plan:

1 error(s) occurred:

  • azurerm_log_analytics_workspace.log_analytics_workspace: 1 error(s) occurred:

  • azurerm_log_analytics_workspace.log_analytics_workspace: operationalinsights.WorkspacesClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="SubscriptionNotFound" Message="The subscription '75406810-f3e6-42fa-97c6-e9027e0a0a45' could not be found."

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Debug Output can be found here

@tombuildsstuff
Copy link
Contributor

hey @rohrerb

Thanks for opening this issue :)

Taking a look into this this appears to be a bug where we register the SDK Client without specifying the ARM Endpoint to use - which means this defaults to communicating with Azure Public rather than (in this case) Azure Government. I've opened #1410 which includes a fix for this - apologies for the inconvenience here!

Thanks!

@ghost
Copy link

ghost commented Mar 30, 2020

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 ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants