az functionapp create is not idempotent
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
**Describe the bug**
The `az functionapp create` command is not idempotent, which breaks the guidelines. If there is a function app running from package, running `az functionapp create` removes the deployed package (or at least the mechanism that wires the deployed package to the app).
**To Reproduce**
1. Create functionapp with cli. `az functionapp create -g test --consumption-plan-location centralus -n testidempotent -s testidempotent`
2. Deploy to functionpp from package (Visual Studio publish, devops pipelines, cli, kudu, etc)
3. Verify functionapp is running.
4. Run create again `az functionapp create -g test --consumption-plan-location centralus -n testidempotent -s testidempotent`
5. Verify running functionapp was removed.
**Expected behavior**
CLI has clear idempotent guidelines. Running this command twice should not remove/delete a running functionapp deployment.
**Additional context**
My contextual scenario, which is a common goal of the industry, is an idempotent CI/CD deployment pipeline that deploys infra & software in a single pipeline (deploying software to a known, declarative environment that sets itself to known state as part of deploy). As such, the pipeline would run the `az functionapp create` command before deploying the new function app build. Because of this bug, there is a window of down time between when the `az functionapp create` command completes and when the function app is built, tested, and deployed (can be minutes, hours, days if the deployment fails).
Contributor guide
Assessment
This issue has not been assessed yet.