serverless-azure-functions icon indicating copy to clipboard operation
serverless-azure-functions copied to clipboard

Azure APIM multiple operations are not created

Open andrebianchessi opened this issue 5 years ago • 1 comments

Description

  • What went wrong? I added apim to a function. Although the terminal says the apim deployment was sucessfull, only one operation from the function appears on the azure portal
  • What did you expect should have happened? All operations should be addeda and appear on the portal
  • What was the config you used?
  • What stacktrace or error message from your provider did you see? No error was displayed

Additional Data

Framework Core: 1.82.0 Plugin: 3.8.3 SDK: 2.3.1 Components: 2.34.9

Cmd output:

Serverless: -> Deploying API keys Serverless: -> Deploying API: Serverless: -> Deploying API Backend: pvtapi-backend => < url > Serverless: -> Deploying API Operations:<...>-apim Serverless: --> companies: [PUT] <...>-apim.azure-api.net/api/companies Serverless: --> companies: [GET] <...>-apimazure-api.net/api/companies Serverless: --> companies: [DELETE] <...>-apim.azure-api.net/api/companies-delete Serverless: Finished APIM service deployment

API Management in Azure portal showing only one operation

image

service: <service name>

custom:
  dotenv:
    logging: true

provider:
  name: azure
  region: brazilsouth
  runtime: python3.7
  subscriptionId: <Subscription Id>
  stage: dev
  type: consumption

  environment: # these will be created as application settings
    DEV: ${env:DEV}

  apim:
    apis:
      - name: <api name>
        subscriptionRequired: false
        displayName: API Test
        description: API created with serverless framework
        protocols:
          - https
        path: api
        authorization: none
    backends:
      - name: <api backend name>
        url: api
    cors:
      allowCredentials: false
      allowedOrigins:
        - "*"
      allowedMethods:
        - GET
        - POST
        - PUT
        - DELETE
        - PATCH
      allowedHeaders:
        - "*"
      exposeHeaders:
        - "*"


plugins:
  - serverless-azure-functions
  - serverless-dotenv-plugin

package:
  exclude:
    - env/**
    - .env/**
    - local.settings.json
    - .vscode/**
    - __pycache__/**
    - node_modules/**
    - .python_packages/**
    - .funcignore
    - package.json
    - package-lock.json
    - .gitignore
    - .git/**

functions:
  companies:
    handler: src/handlers/companies.main
    apim:
      api: <api name>
      backend: <api backend name>
      operations:
        - method: PUT
          urlTemplate: companies
          displayName: Companies
        - method: GET
          urlTemplate: companies
          displayName: Companies
        - method: DELETE
          urlTemplate: companies
          displayName: Companies
    events:
      - http: true
        authLevel: function

andrebianchessi avatar Sep 08 '20 18:09 andrebianchessi

@andrebianchessi facing the same issue, is there any workaround for this?

bharathtakkalki avatar Aug 23 '22 07:08 bharathtakkalki