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

AzAPI Microsoft.Relay namespaces #558

Open
v-vsj opened this issue Jul 23, 2024 · 3 comments
Open

AzAPI Microsoft.Relay namespaces #558

v-vsj opened this issue Jul 23, 2024 · 3 comments
Labels
example Example request

Comments

@v-vsj
Copy link

v-vsj commented Jul 23, 2024

AzAPI resource/AzAPI_update_resource/AzAPI_resource_action : None of the resources able to disable the public network access property for the Relay Namespace
type = "Microsoft.Relay/namespaces@2021-11-01"

@ms-henglu
Copy link
Member

Hi @v-vsj ,

Thank you for taking time to report this issue!

@hqhqhqhqhqhqhqhqhqhqhq, please help check this issue and provide an example.

@hqhqhqhqhqhqhqhqhqhqhq
Copy link
Collaborator

hqhqhqhqhqhqhqhqhqhqhq commented Jul 23, 2024

@v-vsj
Hi, I believe this is a Relay RP's issue, even we pass "Disabled" to it, it still uses "Enabled" for publicNetworkAccess.

This is a similar issue to: Azure/bicep-types-az#2038

We will contact the service team for more support about this.
In the mean time, as a work around, you can use this script to deploy the resource with publicNetworkAccess set to Disabled.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
}

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  name     = "test-rg"
  location = "West US"
}


resource "azapi_resource" "example" {
  type      = "Microsoft.Relay/namespaces@2021-11-01"
  parent_id = azurerm_resource_group.example.id
  name      = "test-ns"
  location  = "westus"
  body = {
    properties = {
    }
    sku = {
      name = "Standard"
      tier = "Standard"
    }
  }

  schema_validation_enabled = true
  response_export_values    = ["*"]
}

resource "azapi_update_resource" "example" {
  type        = "Microsoft.Relay/namespaces/networkRuleSets@2021-11-01"
  resource_id = "${azapi_resource.example.id}/networkRuleSets/default"
  body = {
    properties = {
      publicNetworkAccess = "Disabled"
    }
  }
  depends_on = [azapi_resource.example]
}

it created the resource fine, and also tried destroying also had no problems.
In the Azure Portal, it shows up that it is created with publicNetworkAccess set to Disabled.
image

Let me know if this solves the problem.
cc @ms-henglu

@v-vsj
Copy link
Author

v-vsj commented Jul 23, 2024

Thanks for the workaround. Will deploy and revert you the outcome

@ms-henglu ms-henglu added the example Example request label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Example request
Projects
None yet
Development

No branches or pull requests

3 participants