Skip to content

Commit

Permalink
[GOCSERV-119] Add productId input so that we can specify custom API k…
Browse files Browse the repository at this point in the history
…eys (for ex. GoContent) (#149)

<details open>
<summary><a href="https://amuniversal.atlassian.net/browse/GOCSERV-119"
title="GOCSERV-119" target="_blank">GOCSERV-119</a></summary>
  <br />
  <table>
    <tr>
      <th>Summary</th>
      <td>GoContent Service Down for Double Coconut </td>
    </tr>
    <tr>
      <th>Type</th>
      <td>
<img alt="Bug"
src="https://amuniversal.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10308?size=medium"
/>
        Bug
      </td>
    </tr>
    <tr>
      <th>Status</th>
      <td>In Progress</td>
    </tr>
    <tr>
      <th>Points</th>
      <td>N/A</td>
    </tr>
    <tr>
      <th>Labels</th>
      <td>-</td>
    </tr>
  </table>
</details>
<!--
do not remove this marker as it will break action-jira-linter's
functionality.
  added_by_jira_lint
-->
---

<!-- Please make sure you read the contribution guidelines and then fill
out the blanks below.

Please format the PR title appropriately based on the type of change:
  [JIRA-XXX]: <description>
-->

## Description

- Add productId input so that we can specify custom API keys (for ex.
GoContent)

## Related Links

<!-- List any links related to this pull request here

Replace "JIRA-XXX" with the your Jira issue key -->

- Jira Issue: GOCSERV-119
  • Loading branch information
ebronson68 authored Sep 4, 2024
1 parent c408c71 commit 2618152
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/update-azureapimanagement.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 2618152

Please sign in to comment.