mirsaeedi / dotnet-apim

dotnet-apim is a cross-platform dotnet tool which streamlines the CI/CD process of deploying APIs into Azure API Management
MIT License
31 stars 10 forks source link

Run-time Error while Processing Backend #10

Closed nvmathure closed 4 years ago

nvmathure commented 4 years ago

Template YAML File

version: 0.0.1
apimServiceName: apim-nm-playground

backends:
  - title: "fa-playground"
    description: "Azure Function App for Testing"
    url: $(functionUrl)
    resourceId: $(functionResourceId)
    protocol: http
    credentials:
      header:
        x-functions-key: 
          - "{{fa-function-app-key}}"

linked: false
outputLocation: C:\Playground\ApimTest
linkedTemplatesBaseUrl : https://foo.bar

Error

System.AggregateException: One or more errors occurred. (API configuration is required) ---> System.ArgumentException: API configuration is required
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create.ConfigurationValidator.ValidateAPIs(DeploymentDefinition creatorConfig) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Core\Configuration\ConfigurationValidator.cs:line 135
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create.ConfigurationValidator.Validate(DeploymentDefinition creatorConfig) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Core\Configuration\ConfigurationValidator.cs:line 16
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.FileReader.GetCreatorConfig(String yamlContent) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Core\Infrastructure\FileReader.cs:line 159
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.FileReader.GetCreatorConfigFromYaml(String configFilePath) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Core\Infrastructure\FileReader.cs:line 39
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create.CreateCommand.GetCreatorConfig(CommandLineOption option) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\CommandLine\Commands\CreateCommand.cs:line 31
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create.CreateCommand.Process(CommandLineOption option) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\CommandLine\Commands\CreateCommand.cs:line 16
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Program.ProcessCommand(CommandLineOption option) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Program.cs:line 39
---> (Inner Exception #0) System.ArgumentException: API configuration is required
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create.ConfigurationValidator.ValidateAPIs(DeploymentDefinition creatorConfig) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Core\Configuration\ConfigurationValidator.cs:line 135
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create.ConfigurationValidator.Validate(DeploymentDefinition creatorConfig) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Core\Configuration\ConfigurationValidator.cs:line 16
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.FileReader.GetCreatorConfig(String yamlContent) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Core\Infrastructure\FileReader.cs:line 159
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.FileReader.GetCreatorConfigFromYaml(String configFilePath) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\Core\Infrastructure\FileReader.cs:line 39
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create.CreateCommand.GetCreatorConfig(CommandLineOption option) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\CommandLine\Commands\CreateCommand.cs:line 31
   at Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create.CreateCommand.Process(CommandLineOption option) in C:\Users\u6104652\source\repos\azure-api-management-devops-resource-kit\src\apimtemplate\CommandLine\Commands\CreateCommand.cs:line 16<---
mirsaeedi commented 4 years ago

Thanks for reporting the issue. The issue is fixed. By the way, in the latest version linked, linkedTemplatesBaseUrl, and outputLocation are not required in the template. You should use the -o flag to determine the output path.