serverless / serverless-azure-functions

Serverless Azure Functions Plugin – Add Azure Functions support to the Serverless Framework
MIT License
266 stars 162 forks source link

Ability to re-use an existing Azure Application Insights #484

Closed arsenvlad closed 4 years ago

arsenvlad commented 4 years ago

This is a Feature Proposal

Description

When deploying multiple Azure Functions apps, it maybe desirable to point all of them to use the same Application Insights resource (https://docs.microsoft.com/en-us/azure/azure-functions/functions-monitoring). Currently, serverless.yml supports setting the appInsights resource name, but the plugin is looking for this resource name only in the same resource group where the Function App itself is being deployed. If the existing Application Insights is in another resource group, it does appear to be possible to point multiple serverless-azure-functions to that same resource either by its appInsightsResourceGroupName/appInsightsName or by its instrumentation key.

tbarlow12 commented 4 years ago

Thanks @arsenvlad. I'll get started on this one as soon as I can.

Rapol commented 4 years ago

This is also something we want for all resources, specially APIM. Premium APIMs are expensive and the idea is to have one APIM for your whole organization. Not being able to have this APIM in a different resource group makes it a little difficult to have independent teams working with the same global APIM.

Let me know if we can help with anything. We didn't start working on it but we thought that adding the resource group to the resource definition might help:

provider:
  name: azure
  runtime: nodejs10.x
  resourceGroup: default-function-rg
  apim:
    name: core-apim
    resourceGroup: apim-rg
tbarlow12 commented 4 years ago

Forgot to attach this to the issue when merging the PR. #494