How to retrieve UserName and Password in unattended Azure Function

Viewed 154

I have a runbook that is currently executed via a webhook call in order to execute some powershell code on a site. This is been working great.

I have been instructed to convert this code to an Azure function. No big deal, right? Well.... I was able to get it set up without too much trouble - I created it in VS Studio and then deployed to Azure. The problem is that in the code I need to log in and my username and password are hard-coded in the script. When I had run this in the runbook I called a Credential stored in the Automation account but that does not seem to be an option here.

I have seen other people ask the same question and the answer is often "application settings", which of course is not protected.
This is to run unattended so I (obviously) can't ask for credentials. I am running PowerShell 7.

Any help would be greatly appreciated.

1 Answers
Related