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

What is correct method to make Managed private endpoint to be approved automatically #22082

Closed
1 task done
onenessboy opened this issue Jun 8, 2023 · 3 comments
Closed
1 task done

Comments

@onenessboy
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.0.0

AzureRM Provider Version

3.59.0

Affected Resource(s)/Data Source(s)

azurerm_synapse_managed_private_endpoint

Terraform Configuration Files

resource "azurerm_synapse_managed_private_endpoint" "example" {
  name                 = "example-endpoint"
  synapse_workspace_id = azurerm_synapse_workspace.example.id
  target_resource_id   = azurerm_storage_account.example_connect.id
  subresource_name     = "blob"

  depends_on = [azurerm_synapse_firewall_rule.example]
}

Debug Output/Panic Output

private endpoint is getting created but, its in pending state of approval

Expected Behaviour

Should have a argument which will allow us to approve managed private endpoint to be approved

Actual Behaviour

Its just creating managed private endpoint but not approved state

Steps to Reproduce

terraform apply

Important Factoids

No response

References

#13525

Referred to above PR, but it seems it not yet completed or abondened

@marvinbuss
Copy link

marvinbuss commented Jan 17, 2024

This is the expected behavior as this is a cross-tenant private endpoint. These private endpoints always end up in an unapproved state and need to be approved manually or via a follow-up step.

In a project, we used a null resource in combination with an Azure CLI script which took care of this manual approval.
The null resource would look like the following:

resource "null_resource" "synapse_managed_private_endpoint_approval" {
  triggers = {
    always_run = "${timestamp()}" # Can also be updated to not trigger this on each execution
  }
  provisioner "local-exec" {
    working_dir = "${path.module}/../../scripts/"
    interpreter = ["pwsh", "-Command"] # We used a pwsh script and executed Azure CLI scripts within
    command     = "./Approve-ManagedPrivateEndpoint.ps1 -ResourceId '<resource-id-of-service-with-pe>' -SynapseWorkspaceName '<synapse-workspace-name>' -SynapseManagedPrivateEndpointName '<private-endpoint-name>'"
  }
}

In Azure CLI you can then use the following command to approve the private endpoint:

az network private-endpoint-connection approve --id "<private-endpoint-resource-id>" --description "Approved in Terraform"

@rcskosir
Copy link
Contributor

rcskosir commented Jun 6, 2024

Thank you for taking the time to raise this! I am going to close this with @marvinbuss‘s response as an answer. If that is not the case, please provide additional information including the version in which you are still experiencing this issue, thanks!

@rcskosir rcskosir closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
Copy link

github-actions bot commented Jul 7, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants