Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.98k forks source link

az functionapp create - repeating steps removes running Function App package #10032

Open ndm70 opened 5 years ago

ndm70 commented 5 years ago

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug Reusing the "az functionapp create" steps in provisioning the infrastructure has an adverse effect on existing function app code running inside. It complete removes the running code

To Reproduce Create a function app az functionapp create --plan %az-applanname% --resource-group %az-resourcegroup% --name %az-functionappname1% --os-type %az-funcappostype% --runtime %az-funcappruntime% --storage-account %az-storageacc% --disable-app-insights %az-appinsightsdisable%

Deploy a sample FA from Azure DevOps step "Azure Function" in a release pipeline. Using the default settings where subscription / App Type (Windows) and App name (created in the AZ step above)

Confirm the code is running by checking through the Azure Portal / Function Apps / Functions pane

Re-run az functionapp create --plan %az-applanname% --resource-group %az-resourcegroup% --name %az-functionappname1% --os-type %az-funcappostype% --runtime %az-funcappruntime% --storage-account %az-storageacc% --disable-app-insights %az-appinsightsdisable%

Confirm the code is disappeared by checking through the Azure Portal / Function Apps / Functions pane. "No results" will be listed

Expected behavior The "az functionapp create" should be idempotent and not affect the current running service or code inside that service if it already exists.

Environment summary Azure CLI version 2.0.69 Azure DevOps website using "Azure FunctionApp" Task version 1

Additional context No additional content

ghost commented 5 years ago

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

ghost commented 4 years ago

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

thisisbrianstewart commented 4 years ago

Any updates on this?? Definitely not the behavior we expected. We've had to temporarily re-write pipeline code, which re-deploys environments using the cli for IaC, to comment out the az functionapp create code.

thisisbrianstewart commented 4 years ago

Any updates on this bug? The cli deletes running functionapp packages when re-running the create command. It is not idempotent.

SaurabhSharma-MSFT commented 2 years ago

@ahmedelnably, @fabiocav Do you have any updates on this issue.

TomMalow commented 2 years ago

Is there any update if this side effect is intentionally or not?

I just discovered this myself when trying to optimize our deployment infrastructure to only provision azure resources or deploy code when there are changes to these respective areas. But this is not possible as this command clear any existing running code in the function.

I can also add that the command has the side-effect of overwriting "FUNCTIONS_WORKER_RUNTIME" app setting to "dotnet". This is a problem as we are running with isolated functions. So an additional call with the command "az functionapp config appsettings set" is required to set it back to "dotnet-isolated".

mystiqu commented 1 year ago

Also waiting for an update - this is a rather important and should not be ignored - this issue was reported 2019, what's taking so long?

We just found out "the hard way" when our infrastructure script completely removed all the code, properties and other settings in production.

mystiqu commented 1 year ago

I reported this to MS support and the CLI engineering team has acknowledged the issue (the create command not being in line with how other create commands work).

A fix will probably be available sometime in July according to the preliminary estimation I got.

ulluoink commented 3 months ago

I reported this to MS support and the CLI engineering team has acknowledged the issue (the create command not being in line with how other create commands work).

A fix will probably be available sometime in July according to the preliminary estimation I got.

well now it is July (we better not talk about in which year) - any news on this?

ulluoink commented 3 months ago

@mystiqu any updates?