1

I want to create an Azure Function that would retrieve the Sources Groups List, I found related question here, but I'm wondering if there could be another alternative as this function will be hosted in the same Azure subscription, without making REST requests.

ulitosCoder
  • 1,919
  • 1
  • 17
  • 22

1 Answers1

2

It is not possible to have it without a call. Having something in the resource group does not grant access out of the box to list other resources in that resource group. That could be a security issue.

There are a couple of different ways to get the desired information. It could be done via a REST API call, Powershell, Azure CLI etc.

There is a way to use Powershell in Azure Functions, but it is currently in the preview. I have not tried this before, but maybe you can try to leverage this to call the simple PowerShell command to get the resources. That way you are not calling the rest API, at least not directly.

If you ask me, and if you really need an Azure function to do this, going with REST API call is the safest bet.

kgalic
  • 2,441
  • 1
  • 9
  • 21