Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing deployment slot support for az functionapp update #15800

Closed
kevin-secrist opened this issue Nov 4, 2020 · 13 comments
Closed

Missing deployment slot support for az functionapp update #15800

kevin-secrist opened this issue Nov 4, 2020 · 13 comments
Assignees
Labels
Functions az functionapp question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@kevin-secrist
Copy link

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!

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 4, 2020
@yonzhan yonzhan added the Functions az functionapp label Nov 4, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 4, 2020
@yonzhan yonzhan added Service Attention This issue is responsible by Azure service team. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 4, 2020
@ghost
Copy link

ghost commented Nov 4, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ahmedelnably, @fabiocav.

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 4, 2020

functionapp

@apawast
Copy link

apawast commented Nov 18, 2020

@gzuber could you please take a look at this?

@bhopkinson
Copy link

bhopkinson commented May 11, 2021

Hi,

I have just come across this problem. I too need to update the staging slot.

        az functionapp update `
            --name <name> `
            --resource-group <resource group> `
            --set dailyMemoryTimeQuota=<quota> `
            --slot staging

Omitting --slot correctly updates the production slot, but ideally we need a way to update the staging slot.

Are there any alternative ways until the support is added? I'm using azure-cli 2.22.1.

Thanks.

@hejingkan2005
Copy link

hejingkan2005 commented May 12, 2021

Hi team,

I'm having the same issue that az functionapp update does not support updating httpsonly for slot. It gives "unrecognized arguments: --slot staging" for example
> az functionapp update --name --resource-group --set httpsOnly=true --slot staging
DLL load failed while importing win32file: The specified module could not be found.
unrecognized arguments: --slot staging

Any update on this?

Az.Functions version: 2.0.0

@mjazwiecki
Copy link

do we have any updates / ways to make this work?
updating staging slot is something we would love to use in our environment.

@evotch
Copy link

evotch commented Oct 25, 2021

I know this is not ideal but a work around is to move the production slot first. Swap the slot snd execute the same command again. This will move both production slot and staging slot to the new plan. One downside is that you will have code running from the slot so you just need to swap again at the end.

@navba-MSFT
Copy link
Contributor

@kevin-secrist Apologies for the late reply. The similar issue has been discussed here and I see the PR has been merged now #21698. Please let me know if you are still facing the same issue using most recent version of the AzCLI. Awaiting your reply.

@navba-MSFT navba-MSFT added the needs-author-feedback More information is needed from author to address the issue. label Mar 22, 2022
@kevin-secrist
Copy link
Author

Since I reported this I've switched teams and don't work Azure anymore. With a test subscription I tried to replicate the issue a year and a half later.

$ az --version
azure-cli                         2.34.1

core                              2.34.1
telemetry                          1.0.6

Dependencies:
msal                              1.16.0
azure-mgmt-resource               20.0.0

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

Python (Linux) 3.8.12 (default, Mar  2 2022, 07:26:21)
[GCC 9.3.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Set up test functionapp

az storage account create --name azclitest5625 --resource-group azclitest --location eastus --sku Stan
dard_LRS
az functionapp create --consumption-plan-location eastus --name azclitest5625 --os-type windows --reso
urce-group azclitest --runtime dotnet --storage-account azclitest5625
az functionapp deployment slot create --resource-group azclitest --name azclitest5625 --slot staging

Try to set the config

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

✔️ This actually returns a successful response now instead of an error. However, when I go to check the actual settings:

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

❌ It appears that the setting gets set on the production slot instead of the specified staging slot. This matches up with the experience I had when trying to set the settings via resourceId in the original post.

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Mar 22, 2022
@navba-MSFT
Copy link
Contributor

@kevin-secrist Thanks for getting back. Just checked the details about the PR #21698 and got a confirmation that the fix is yet to be released. Sending you the next release milestone details: https://github.com/Azure/azure-cli/milestone/116 which is planned for April 6th. Hope this helps. In the meantime, if you have any questions on this, please let me know.

@navba-MSFT navba-MSFT added needs-author-feedback More information is needed from author to address the issue. and removed needs-team-attention This issue needs attention from Azure service team or SDK team labels Mar 23, 2022
@kevin-secrist
Copy link
Author

kevin-secrist commented Mar 23, 2022

copying my reply from the other issue for context

From a non-expert perspective that PR doesn't look like it solves the particular issue that I was facing. The PR appears to be related to zip deployments, but this is changing settings on the app service.

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Mar 23, 2022
@kevin-secrist
Copy link
Author

May be fixed by #22745, will retest upon the next release

@kevin-secrist
Copy link
Author

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 #22745, thanks @haroonf

@navba-MSFT navba-MSFT self-assigned this Jul 7, 2022
@navba-MSFT navba-MSFT removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Sep 29, 2022
@navba-MSFT navba-MSFT added the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functions az functionapp question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

8 participants