stephaneey / azure-apim-extension

Full Azure API Management suite and more VSTS extension
MIT License
66 stars 49 forks source link

Invalid file location #119

Closed Nibell closed 3 years ago

Nibell commented 3 years ago

Hi,

Get error on azure pipeline using yml when creating api with artifact. Error is ##[error]Invalid file location D:\a\1\s/OpenApi/swagger.json

I know that swagger.json exist. Get the following from cmd test task. D:\a\1\s\OpenApi\swagger.json

                - task: CmdLine@2
                  inputs:
                    script: |
                      cd $(System.DefaultWorkingDirectory)/OpenApi
                      dir /s /b /o:gn

Pipeline

pool:
  vmImage: 'windows-latest'

                - task: apim@5
                  displayName: Create Api
                  inputs:
                    ConnectedServiceNameARM: '$(AzureResourceManagerConnectionName)'
                    ResourceGroupName: '$(AzureCentralResourceGroupName)'
                    ApiPortalName: '$(AzureCentralApiPortalName)'
                    UseProductCreatedByPreviousTask: true
                    OpenAPISpec: 'v2'
                    Authorization: 'None'
                    SwaggerPicker: 'Artifact'
                    swaggerartifact: '$(System.DefaultWorkingDirectory)/OpenApi/swagger.json'
                    targetapi: '${{ parameters.apimApiCode }}'
                    DisplayName: '${{ parameters.apimApiName }}'
                    pathapi: '${{ parameters.apimUrlSuffix }}'
                    MicrosoftApiManagementAPIVersion: '2018-01-01'

I'm missing something?

Best Regards Nibell

Nibell commented 3 years ago

I solved it