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

Fix updating the Azure API Management #59

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module "apim" {
count = var.enable_apim ? 1 : 0
source = "./modules/apim"
location = azurerm_resource_group.rg.location
resource_group_id = azurerm_resource_group.rg.id
resource_group_name = azurerm_resource_group.rg.name
apim_name = local.apim_name
apim_subnet_id = module.vnet.apim_subnet_id
Expand Down
8 changes: 2 additions & 6 deletions infra/modules/apim/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ locals {
backend_url = "${var.openai_service_endpoint}openai"
}

data "azurerm_resource_group" "rg" {
name = var.resource_group_name
}

resource "azapi_resource" "apim" {
type = "Microsoft.ApiManagement/service@2023-05-01-preview"
name = var.apim_name
parent_id = data.azurerm_resource_group.rg.id
parent_id = var.resource_group_id
location = var.location
identity {
type = "SystemAssigned"
Expand Down Expand Up @@ -172,7 +168,7 @@ resource "azurerm_api_management_api_policy" "policy" {
</on-error>
</policies>
XML
depends_on = [azurerm_api_management_backend.openai, azapi_resource.apim_backend_pool]
depends_on = [azurerm_api_management_named_value.tenant_id]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this dependency the named value resource depends on the apim.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

}

# https://github.com/aavetis/azure-openai-logger/blob/main/README.md
Expand Down
1 change: 1 addition & 0 deletions infra/modules/apim/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
variable "resource_group_name" {}
variable "resource_group_id" {}
variable "location" {}
variable "apim_name" {}
variable "publisher_name" {}
Expand Down
Loading