Reputation: 229
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?
Upvotes: 1
Views: 1627
Reputation: 17790
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
Upvotes: 1