Closed AgelM closed 3 years ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp, @AzureAppServiceCLI.
Web App team, please help to check this question.
We have the same behavior on Azure Devops AzurePowershell@5, password disappears after appsettings update
Having the same behavior here.
In AzureDevops we had to use the version 4.2.0 as a temporary work around for the task AzurePowerShell@5
input: preferredAzurePowerShellVersion: '4.2.0'
other way that is working for us is: Set-AZWebApp -ResourceGroupName $webappresourcegroup -Name $webappname -AppSettings $hash -ContainerRegistryPassword $securepass
Strange, I have the very same command and it was not working. 🤔
*Edit: I found the difference, even though we use the Set-AzWebApp ContainerRegistryPassword $securepass, later we set the configuration with another command Set-AZWebApp and we do not set ContainerRegistryPassword $securepass.
The actual workaround is to specify the Registry URL and Username as part of the AppSettings (without including the Password) and define the password as a Secure String:
$someAppSettings = @{
...
"DOCKER_REGISTRY_SERVER_URL" = $ACRContainerRegistryUrl
"DOCKER_REGISTRY_SERVER_USERNAME" = $AcrUsername
"DOCKER_ENABLE_CI" = "true"
}
Set-AzWebApp -ResourceGroupName <ResourceGroup> -Name $appName -AppSettings $someAppSettings -ContainerImageName $someconatinerImage -ContainerRegistryPassword $securepass
Two keys must be passed to the Set-AzWeApp command:
Two app settings must be included + any other custom app settings :
An Additional information is that even if the password was previously applied, any usage of Set-AzWebApp
without the parameter -ContainerRegistryPassword
nullifies the Docker registry Password, resulting in failures to pull docker images. This is an additional inconsistency, since even without specifying the parameter -ContainerImageName
, the App Service re-uses the previously defined image.
Solved in Az.Websites 2.2.0 (5 months ago)
@AgelM Apologies for the delayed response. Following up to check if you need any further help on this issue.
@SaurabhSharma-MSFT, the issue has been resolved. We haven’t faced it with the most recent versions.
Description
After upgrading from Az version 3.2.0 to 4.3.0. Deploying an application that referenced a docker Image within the ACR thanks to the Application Settings
DOCKER_REGISTRY_SERVER_.*
, completes with success but the application isn't running and the Container logs indicates the inability to pull images from the ACR. After debugging the command we have noted the following defects:DOCKER_REGISTRY_SERVER_PASSWORD
, when provided within AppSettings as a Hashtable gets removed during the execution ofSet-AzWebApp
. This is very wrong since, it is not expected from the Set-AzWebApp to modify local variables that are passed to it.ContainerRegistryPassword
without adding theDOCKER_REGISTRY_SERVER_PASSWORD
in the appSettings,, this key gets added to the Appsettings Hashtable.Steps to reproduce
Environment data
Module version
Debug output
Error output