-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add slot support for function apps #9550
Add slot support for function apps #9550
Conversation
6a87925
to
2141cb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. One thing to do is in the az webapp create can you update it to check if kind is function app & throw a error message to use the new function app commands?
src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/custom.py
Show resolved
Hide resolved
c1d8fca
to
ded1e60
Compare
@panchagnula, I have updated the PR to add an error message when use webapp's create command. Please have another look if you don't mind :) |
750e460
to
c0e21c3
Compare
c0e21c3
to
e322308
Compare
Hi @ankitkumarr thanks for implementing this. I was able to check out the repo and test this out and was able to create a slot. I was wondering about the ability to deploy using az functionapp to slots. I believe az webapp has a deployment option (az webapp deployment source config-zip) that has a --slot option. Are you planning on adding the same for the az functionapp deployment commands? |
@bigdatamoore, this PR should have addressed that as well. |
@ankitkumarr I was able to deploy a c# function using the az functionapp deployment source config-zip --slot command. I tried it with a python function and got the following error:
|
@bigdatamoore, oh are you on a Linux Consumption plan? Slots aren't yet supported for Linux Consumption, neither is the |
Ok thanks. That is what I figured. Thanks for the update. I will wait until those are supported. Any idea as to when that could be? |
@ankitkumarr I have confirmed that the CLI is working with slots for C# functions. I was able to create a slot, deploy to the slot, and then use the CLI to swap the slots. |
@bigdatamoore, thanks for reporting this. I will take a look at your issue later today. As for the actual code, you did find the correct function azure-cli/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py Line 253 in cbb0c77
The reference you linked is actually for a different command az webapp up that uses the function to deploy.
Anyway, I will try and get a repro to see what's going on. |
@bigdatamoore, whoops, I missed you comment. Thanks for verifying. Glad you were able to resolve. |
@ankitkumarr, can you test out the create slot command and see if it updates the WEBSITE_CONTENTSHARE setting value? When doing this via the portal, the WEBSITE_CONTENTSHARE is automatically appended with a random string. However when doing this via the CLI it is copying the same value that is in the production slot. So that was actually causing the behavior that I was seeing. Probably you will want to add some random string to the end of the existing value so that you don't have these collisions when using the CLI to create slots. This may be by design but I am not sure. Thanks. |
@panchagnula, would love a review from you.
Fixes #6581, #9126
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).
I adhere to the Command Guidelines.