Trying to retrieve publish profile for an appservice/function via below bicep doesn’t work and produces an empty string, the Bicep is running with this permissions Microsoft.Web/sites/config/list/Action
and Microsoft.Web/sites/publishxml/Action
:
param appserviceOrFunctionName string
var publishingCredentialsId = resourceId('Microsoft.Web/sites/config', appserviceOrFunctionName, 'publishingCredentials')
# disable-next-line outputs-should-not-contain-secrets
output publish_profile object = list(publishingCredentialsId, '2022-03-01')
Although on another thread on SO, with an unaccepted answer, this doesn’t look like it works
Retrieve the publishing credentials (publish profile) of App Service with Bicep
How can I retrieve the publish profile XML of a website in Bicep or at least the publish password?
This can be retrieved via Azure CLI with the next command, but I am interested in the pure Bicep.
az webapp deployment list-publishing-profiles --name <webAppName> --resource-group <resourceGroupName> --xml