Azure-docs: Example of creating subsription via ARM

Created on 6 Dec 2019  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

I cannot find any example of how it may be done. Looks like it is impossible. If so, please specify that explicitly in the docs to save time of other folks.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author azure-functionsvc doc-enhancement triaged

Most helpful comment

@M0ns1gn0r I believe there is a way to fetch the master key. The discussion in this issue covers more details on how to do it, specifically this comment.

Also, there is a link to a sample for an Azure Functions + Event Grid ARM Template that you can refer to.

All 5 comments

@M0ns1gn0r Thanks for the feedback! Though not mentioned in the docs, it is possible.

You should be able to build on top of this azure quickstart sample for creating an event subscription and for the endpoint parameter, use the URL mentioned in this section of this doc.

We have assigned this issue to the content author to review and update accordingly.

That's exactly the problem: it seems not possible to form this URL inside an ARM template as there is no way to obtain the master key.

@M0ns1gn0r I believe there is a way to fetch the master key. The discussion in this issue covers more details on how to do it, specifically this comment.

Also, there is a link to a sample for an Azure Functions + Event Grid ARM Template that you can refer to.

OMG it works, the magic incantation is

listKeys(resourceId('Microsoft.Web/sites/host/', variables('functionAppName'), 'default'),'2016-08-01').systemkeys.eventgrid_extension

I have spent numerous hours searching through docs and trying different ways to get the key and failed every time. In particular, this page contains incorrect information: it says that for resource type microsoft.web/sites/functions the function listsecrets should be used. However, this function fails for function apps with the Runtime ~2.

Boy am I glad I opened this feedback-item..., would have been struggling with this issue for another day or more if I hadn't. Didn't find anything in the docs about this, so the content author probably hasn't come around to adding it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

behnam89 picture behnam89  Â·  3Comments

Favna picture Favna  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments