Azure / Azure/azure-dev

Add support for getting endpoints for Azure Functions based services

Open
#358 3 comments 0 reactions 1 assignee Claimed by @vhvb1989 View on GitHub
area/core-cli enhancement help wanted
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

In Azure/azure-dev-pr#627 we are adding support so that during a `deploy`, we print endpoints for all the services we deploy. Some (but not all) Azure Functions services can have endpoint (every azure function with an HttpTrigger will have an endpoint).

Today we just don't list endpoints for services deployed to Azure functions. This item tracks fixing that by actually implementing the `Endpoints()` method on `project.functionServiceTarget` instead of just returning `nil, nil` as we do today.

Here's a sketch of a possible implementation strategy, taking from a comment while I was doing the initial PR (after I did some investigation into it):

```golang
// TODO(ellismg): Implement this. It's not 100% clear what this should do, since a functions app may not include
// any HTTP based services (consider an event driven application where the trigger is "some blob was created" or
// "a message was put into a Azure Storage Queue").
//
// One possible idea would be to enumerate all of the functions in your application that have HTTP triggers, and return
// them here (perhaps with their invoke keys?)
//
// The `az` CLI does not provide an out of the box way to list the functions in a function app. This is something you
// can get via the `func` CLI - but the output is designed for humans, not computers, so we may want to do something
// like what was recommended here: https://stackoverflow.com/a/45111951
//
// That would look something like:
//
// az rest --method get --url "/subscriptions/{sub_id}/resourceGroups/{rg_name}/providers/Microsoft.Web/sites/{function-app-name}/functions?api-version=2015-08-01" --output json
//
// and then use the `values` array to pull stuff out. Note that this list endpoint is pageable, so we would likely
// need to handle following the pageable ourselves.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.