From 475691286ec2da704cdf1ab6a64529a6f757d2e7 Mon Sep 17 00:00:00 2001 From: Ella Bronson <111298136+ebronson68@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:05:09 -0500 Subject: [PATCH] [DEVOPS-575] Add `apiSuffix` input to API deploy workflow (#159)
DEVOPS-575
Summary Uexpress Service API has "-api" suffix after deploys
Type Bug Bug
Status In Progress
Points N/A
Labels -
--- ## Description - Add `apiSuffix` input to API deploy workflow so we can toggle it in cases where the service doesn't need it ## Related Links - Jira Issue: DEVOPS-575 --- .github/workflows/update-azureapimanagement.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-azureapimanagement.yaml b/.github/workflows/update-azureapimanagement.yaml index f2492c0..36dbe15 100644 --- a/.github/workflows/update-azureapimanagement.yaml +++ b/.github/workflows/update-azureapimanagement.yaml @@ -22,6 +22,11 @@ on: type: string description: "API Management Product ID." default: ${{ vars.API_PRODUCT_ID || 'AZ-WebServices' }} + apiSuffix: + required: false + type: string + description: "API Suffix for the API URL." + default: ${{ vars.API_SUFFIX || 'true' }} secrets: azurePassword: required: false @@ -103,7 +108,15 @@ jobs: $ApiSubscriptionRequired = $True # Generate API ID by appending "-api" to the repository name and replacing underscores with hyphens - $ApiId = ("${{ github.event.repository.name }}-api").Replace("_","-") + + if (${{ inputs.apiSuffix }} -eq "true") { + $ApiSuffix = "-api" + } + else { + $ApiSuffix = "" + } + + $ApiId = ("${{ github.event.repository.name }}$ApiSuffix").Replace("_","-") # Retrieve the resource group and service name based on the environment tag $ResourceGroup = (Get-AzResource -ResourceType Microsoft.ApiManagement/service -Tag @{"environment"="${{ inputs.environment }}"}).ResourceGroupName