Skip to content

Update powershell scripts to support fetching publish credentials #133

@asalvo

Description

@asalvo

All of our app services have default publishing credentials, so downloading the publishing profile for each is a pain. Our build scripts get the publishing creds and then use them to deploy our code, so I made a added some code to one of the install scripts and got something working.

Between the original check for "ambient" and creating the BASE64 encoded creds, I added the following block which should still support the use of the ambient (env variables).

if($Username -eq "ambient" -or $Username -eq "") {
	Write-Output "No username provided. Fetching publish crendentials from Kudu..."
	$publishProfile = (az webapp deployment list-publishing-credentials --name ${SiteName} --resource-group ${ResourceGroup} --subscription ${SubscriptionId} | ConvertFrom-Json)
	$Username = $publishProfile.publishingUserName
	$Password = $publishProfile.publishingPassword
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions