azure-cli: webapp:Parameter --configuration-source does not copy app settings and connection strings

I expected the --configuration-source parameter on az webapp deployment slot create command to copy app settings and connection strings to the new slot, but it doesn’t.

Is there another way to achieve this using the CLI? Using the Azure Portal, it is possible to clone the configuration from another slot. It would be really useful if this functionality were also available from the CLI.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 6
  • Comments: 37 (17 by maintainers)

Most upvoted comments

@HerrNiklasRaab Not sure if this is a solution for you, but what we did in our pipelines is use the Az module for PowerShell. The PowerShell command New-AzWebAppSlot with the -SourceWebApp parameter mimics the expected behavior of the Azure CLI command being discussed here and the behavior of the Azure Portal.

So of the three management options, it appears the Azure CLI is the outlier.

This is really a blocker, what is the current plan? I just see this being moved to the next sprint over and over?

Just ran through this on the Portal and compared. I agree with @HerrNiklasRaab, let’s use the same implementation as the Portal (copy all settings).

I think the cli should replicate the behavior from the portal:

Is a setting marked as deployment slot setting, then it should:

  • Not be copied over during a swap
  • Should be cloned over when creating a new slot and you specify either in the Portal using the drop-down or with cli with --configuration-source parameter

This is the behavior I expected and was surprised to see that this was not the case.

I have narrowed it down a bit further. The difference between the portal and --configuration-source is that the portal also clones app settings or configuration strings that are configured as ‘slot settings’. The CLI tools apparently ignore slot settings.

It would probably be helpful if --configuration-source worked exactly like the clone functionality in the portal.

@rulrok you are not incorrect in expecting this behavior - it turns out our backend APIs that CLI uses don’t automatically copy the settings over - CLI needs to explicitly handle this. We need make the change.