From 2618152236e05da45cc9b34e410257833c717813 Mon Sep 17 00:00:00 2001 From: Ella Bronson <111298136+ebronson68@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:30:39 -0500 Subject: [PATCH] [GOCSERV-119] Add productId input so that we can specify custom API keys (for ex. GoContent) (#149)
GOCSERV-119
Summary GoContent Service Down for Double Coconut
Type Bug Bug
Status In Progress
Points N/A
Labels -
--- ## Description - Add productId input so that we can specify custom API keys (for ex. GoContent) ## Related Links - Jira Issue: GOCSERV-119 --- .github/workflows/update-azureapimanagement.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-azureapimanagement.yaml b/.github/workflows/update-azureapimanagement.yaml index 62b5a752..f2492c0c 100644 --- a/.github/workflows/update-azureapimanagement.yaml +++ b/.github/workflows/update-azureapimanagement.yaml @@ -17,6 +17,11 @@ on: type: string description: "GitHub Repository Name." default: ${{ github.event.repository.name }} + productId: + required: false + type: string + description: "API Management Product ID." + default: ${{ vars.API_PRODUCT_ID || 'AZ-WebServices' }} secrets: azurePassword: required: false @@ -94,7 +99,7 @@ jobs: azPSVersion: "latest" inlineScript: | # Set API Management variables - $ApiProductId = "AZ-WebServices" + $ApiProductId = "${{ inputs.productId }}" $ApiSubscriptionRequired = $True # Generate API ID by appending "-api" to the repository name and replacing underscores with hyphens @@ -158,7 +163,10 @@ jobs: # Associate the versioned API with a product Set-AzApiManagementApi -InputObject $Api - Add-AzApiManagementApiToProduct -Context $Context -ApiId "$versionedApiId" -ProductId $ApiProductId + Add-AzApiManagementApiToProduct -Context $Context -ApiId "$versionedApiId" -ProductId "AZ-WebServices" + if ($ApiProductId -ne "AZ-WebServices") { + Add-AzApiManagementApiToProduct -Context $Context -ApiId "$versionedApiId" -ProductId $ApiProductId + } # Remove the original API spec if ($OriginalVersion) {