Search code examples
powershellazureazure-functionsazure-deployment

How to get azure function app Credentials?


Every Azure Function has a publish profile containing a username and a password. I need them because I want to create a FunctionApp with Powershell and push a function with zip Deployment immediately.

The Question is:

How can I get these two parameters from a Function, using PowerShell?


Solution

  • Just use the code below, it works on my side.

    $credentials = Invoke-AzureRmResourceAction -ResourceGroupName YourResourceGroup -ResourceType Microsoft.Web/sites/config -ResourceName YourWebApp/publishingcredentials -Action list -ApiVersion 2015-08-01 -Force
    $username = $credentials.Properties.PublishingUserName
    $password = $credentials.Properties.PublishingPassword