question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing deployment slot support for az functionapp update

See original GitHub issue

Describe the bug

Hi there!

When attempting to update one of the properties on my function app, I found that az functionapp update does not have slot support. To attempt to work around this I tried using az webapp (which does have slot support) but it gave me an error telling me to use az functionapp instead.

Other commands that may/may not need slot support:

az functionapp config hostname get-external-ip
az functionapp deployment user set
az functionapp deployment user show
az functionapp devops-pipeline create
az functionapp function *

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

az functionapp update --resource-group <rg> --name <app> --slot staging --set siteConfig.healthCheckPath=/api/HealthCheck

Errors:

az: error: unrecognized arguments: --slot staging

To reiterate, az webapp update does have slot support.

A separate issue that I don’t need addressed is that passing in the resourceId of the slot gets ignored, e.g.

az functionapp update --ids /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroup}/providers/Microsoft.Web/sites/{FunctionApp}/slots/staging --set siteConfig.healthCheckPath=/api/HealthCheck

Ends up silently updating the production slot instead of the staging slot. I imagine this is probably the behavior across all commands though. This is undesired behavior because it will cause an app restart on the production slot when an out-of-rotation slot should have been updated+restarted instead.

Expected Behavior

Update the config on the slot as expected in the same way that it does on the production slot.

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.11.0 *

Extensions:
front-door 1.0.9

Additional Context

Thanks for your help!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kevin-secristcommented, Jul 6, 2022

Tried to reproduce again, created a new test app using instructions from above:

$ az --version
azure-cli                         2.38.0

core                              2.38.0
telemetry                          1.0.6

Dependencies:
msal                            1.18.0b1
azure-mgmt-resource             21.1.0b1

Python location '/opt/az/bin/python3'
Extensions directory '/home/kevin/.azure/cliextensions'

Python (Linux) 3.10.5 (main, Jul  1 2022, 04:14:52) [GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Before Updating Config

$ az functionapp show --resource-group azclitest070622 --name azclitest070622 | jq .siteConfig.healthCheckPath
null
$ az functionapp show --resource-group azclitest070622 --name azclitest070622 --slot staging | jq .siteConfig.healthCheckPath
null

Update Config

az functionapp update --resource-group azclitest070622 --name azclitest070622 --slot staging --set siteConfig.healthCheckPath=/api/HealthCheck

After Update

$ az functionapp show --resource-group azclitest070622 --name azclitest070622 | jq .siteConfig.healthCheckPath
null
$ az functionapp show --resource-group azclitest070622 --name azclitest070622 --slot staging | jq .siteConfig.healthCheckPath
"/api/HealthCheck"

✔️ Looks like the staging slot took the setting instead of the production slot

Newest version (2.38.0) fixes the issue, fixed by https://github.com/Azure/azure-cli/pull/22745, thanks @haroonf

0reactions
kevin-secristcommented, Jun 29, 2022

May be fixed by https://github.com/Azure/azure-cli/pull/22745, will retest upon the next release

Read more comments on GitHub >

github_iconTop Results From Across the Web

unable to add deployment slot in portal - Microsoft Q&A
When I attempt to add a deployment slot to a function app, ... Failed to create slot 'stage': Required parameter AccessKey is missing....
Read more >
Functions missing in production slot after deploying to staging ...
I have a function app with 2 slots - staging and production. Both staging and production slots have some functions.
Read more >
How-to use Deployment slots with Azure Functions.
There are more than four slots available for non-serverless App Service plans. ... --slot stagingaz functionapp deployment slot swap \
Read more >
Azure Bicep and Azure DevOps to deploy a function app
The function app which we'll be creating will use deployment slots (azure function apps supports production and staging slots only).
Read more >
How to: CI/CD/IaC for Azure Function Apps and GitHub Actions
This article shows you how to use Github Actions to test an Azure Function App, as well as create all resources & deploy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found