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

[GOCSERV-119] Add productId input so that we can specify custom API keys (for ex. GoContent) #149

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Changes from all commits
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
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
Loading