Function App - List, Create or Update, Delete Api Keys

In previous post I was complaining how I received a BadRequest error when trying to create or update host secret in Function App using ARM Api. But how I’m actually doing this?

One way is to use Postman and call ARM Api. I’m calling ARM Api using PowerShell Invoke-WebRequest cmdlet in my scripts and then using this in CI/CD to create/update/get/delete api keys on Function Apps in my Azure Tenant.

Actually I’m and following instructions in the docs:

And here’s is a part of my code. Also I’m describing [here](/2020/07/24/badrequest-error-function-app-create-or-update-host-secret/ why I’m building JSON body (variable $body) in this way for Create/Update request.

I’m using ‘GetToken’ function to acquire current session authentication token. Code for the function is here.

Thanks for reading!