Skip to content

Commit

Permalink
[HOTFIX] Fix already exists errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ebronson68 committed Oct 31, 2024
1 parent b085272 commit 51bdb3e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/update-azureapimanagement.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ jobs:
$SwaggerJSON | Out-File -FilePath $SwaggerJSONFile
# # Import the versioned API
Import-AzApiManagementApi -Context $Context -SpecificationPath $SwaggerJSONFile -SpecificationFormat OpenApi -Path $ApiId -ApiId "$versionedApiId" -ApiVersion "v$version" -ApiVersionSetId $ApiVersionSet.Id -Force
$existingApi = Get-AzApiManagementApi -Context $Context -ApiId "$versionedApiId" -ErrorAction SilentlyContinue
if ($existingApi) {
# Remove the existing API version
Write-Output "Removing existing API version V${version}"
Remove-AzApiManagementApi -Context $Context -ApiId "$versionedApiId"
}
# Retrieve and update the API object
$Api = Get-AzApiManagementApi -Context $Context -ApiId "$versionedApiId"
Expand Down

0 comments on commit 51bdb3e

Please sign in to comment.