https://pulumi.com logo
Title
a

ambitious-crayon-56788

01/31/2020, 12:24 PM
Hey all. I've just swapped from using
ArchiveFunctionApp
to a standard
FunctionApp
(I'm going to use Azure DevOps to push code to the Function App. However, the
FunctionApp
resource does not have the
endpoint
property, so I can't access the Function App URL. I've found that the
getEndpoint()
function is used when setting the
endpoint
property, but it doesn't seem to be publically accessible from index.js. Is there any way I can get the URL of my
FunctionApp
resource? •
getEndpoint()
function: https://github.com/pulumi/pulumi-azure/blob/609a1f52aff8a65573ebd3626de9b128753ee179/sdk/nodejs/appservice/zMixins.ts#L632
p

powerful-football-81694

01/31/2020, 12:54 PM
@ambitious-crayon-56788 you can use the
DefaultHostname
property of
FunctionApp
.
Beyond that, you have to know the rest of the URL, as this depends on the HTTP triggers used in your function app, of which Pulumi can have no knowledge.
If you use a custom domain name for your function app, that domain name is its own resource (of type
CustomHostnameBinding
) so your Pulumi program would know about that too.
a

ambitious-crayon-56788

01/31/2020, 12:57 PM
@powerful-football-81694, thanks, I've found that, but I'd still have to construct the Function App endpoint (https://`defaultHostname`/funcName). Was hoping to be able to access
getEndpoint()
just to avoid having to do that lots of times.
p

powerful-football-81694

01/31/2020, 12:59 PM
Right, I see what you mean. But I don’t think the Azure management plane has a representation of those endpoints, as they are more part of your app content, than the Function App resource at the Azure layer.
(BTW why do you have to do it lots of times?)
a

ambitious-crayon-56788

01/31/2020, 1:01 PM
Because I may deploy more than 1 Function App per stack. It's not a massive issue, just would have been nice to have the function available to a wider audience.
p

powerful-football-81694

01/31/2020, 1:03 PM
OK. Well maybe @tall-librarian-49374 should chime in, because I’m just a user, but I think you’re out of luck, I think you have to construct any endpoint URLs yourself.
t

tall-librarian-49374

01/31/2020, 4:55 PM
Yeah, I sort don’t feel there’s enough value to expose this function. You could just put it into your code if you need it.
a

ambitious-crayon-56788

01/31/2020, 4:56 PM
@tall-librarian-49374, that's exactly what I've done. Seems a waste to duplicate code though ;)
t

tall-librarian-49374

01/31/2020, 4:58 PM
It’s two lines, you are a perfectionist 😉
👍 1