Deployment methods (Git, ZIP, CI/CD) in Azure - Time & Space Complexity
When deploying applications using Azure, it's important to understand how the time to complete deployment changes as the project size grows.
We want to know how deployment time scales with the amount of code or files being deployed.
Analyze the time complexity of deploying an app using Git, ZIP upload, and CI/CD pipeline in Azure.
// Pseudocode for deployment methods
// 1. Git deployment
az webapp deployment source config --name MyApp --resource-group MyGroup --repo-url https://github.com/user/repo.git
// 2. ZIP deployment
az webapp deployment source config-zip --name MyApp --resource-group MyGroup --src app.zip
// 3. CI/CD pipeline trigger
az pipelines run --name MyPipeline
This code triggers deployment using three common methods: Git push, ZIP file upload, and a CI/CD pipeline run.
Each deployment method processes files to update the app.
- Primary operation: Uploading and processing files (copying, extracting, building)
- How many times: Once per file or code change in the deployment package
As the number of files or code size increases, deployment time grows roughly in proportion.
| Input Size (files or code size) | Approx. Operations (upload/build steps) |
|---|---|
| 10 | 10 units of work |
| 100 | 100 units of work |
| 1000 | 1000 units of work |
Pattern observation: Deployment time grows linearly as the project size grows.
Time Complexity: O(n)
This means deployment time increases directly with the number of files or code size being deployed.
[X] Wrong: "Deployment time stays the same no matter how big the project is."
[OK] Correct: Larger projects have more files and code to upload and process, so deployment takes longer.
Understanding how deployment time grows helps you plan and explain deployment strategies clearly in real projects.
What if we changed from ZIP deployment to incremental deployment? How would the time complexity change?
Practice
Solution
Step 1: Understand Git deployment
Git deployment connects your Azure app directly to your Git repository, pushing code changes automatically.Step 2: Compare with other methods
ZIP deployment uploads a packaged file, manual upload and FTP are manual and not direct from repo.Final Answer:
Git deployment -> Option DQuick Check:
Direct repo push = Git deployment [OK]
- Confusing ZIP deployment with Git deployment
- Thinking FTP is automated from repo
- Assuming manual upload is Git-based
myapp in resource group mygroup?Solution
Step 1: Identify correct Azure CLI syntax for ZIP deployment
The official command isaz webapp deployment source config-zipwith parameters for resource group, app name, and source ZIP file.Step 2: Check options for syntax correctness
az webapp deployment source config-zip --resource-group mygroup --name myapp --src app.zip matches the correct command and parameters exactly; others use incorrect commands or flags.Final Answer:
az webapp deployment source config-zip --resource-group mygroup --name myapp --src app.zip -> Option BQuick Check:
Correct CLI command for ZIP deploy = az webapp deployment source config-zip --resource-group mygroup --name myapp --src app.zip [OK]
- Using wrong command verbs like 'deploy' or 'upload-zip'
- Mixing parameter names like --app-name vs --name
- Forgetting to specify the source ZIP file with --src
trigger:
branches:
include:
- main
steps:
- task: AzureWebApp@1
inputs:
azureSubscription: 'MyAzureSub'
appName: 'myapp'
package: '$(System.DefaultWorkingDirectory)/drop/app.zip'What happens when you push code to the
main branch?Solution
Step 1: Analyze the trigger section
The pipeline triggers on pushes to themainbranch as specified in the trigger include list.Step 2: Understand the deployment task
The AzureWebApp@1 task deploys the ZIP package located at the specified path to the Azure Web App named 'myapp'.Final Answer:
The pipeline triggers and deploys the ZIP package to the Azure Web App -> Option CQuick Check:
Push to main triggers deploy task = The pipeline triggers and deploys the ZIP package to the Azure Web App [OK]
- Assuming pipeline triggers on other branches
- Thinking deployment task does nothing
- Confusing deployment with deletion
Solution
Step 1: Identify cause of authentication error
Authentication errors usually mean the pipeline cannot access Azure resources due to wrong or missing service connection credentials.Step 2: Evaluate other options
Missing ZIP or wrong app name cause deployment errors but not authentication errors; wrong trigger prevents pipeline start.Final Answer:
Incorrect Azure subscription service connection in the pipeline -> Option AQuick Check:
Auth error = service connection issue [OK]
- Blaming missing ZIP for authentication errors
- Confusing app name mismatch with auth failure
- Assuming trigger issues cause auth errors
Solution
Step 1: Understand automation needs
Automating build, test, and deploy requires a CI/CD pipeline connected to the source repository.Step 2: Compare deployment methods
Manual ZIP and FTP are manual or partial automation; Git deployment pushes code but lacks build/test automation.Final Answer:
CI/CD pipeline connected to GitHub with automated build and deploy steps -> Option AQuick Check:
Full automation = CI/CD pipeline [OK]
- Thinking Git deployment automates build and test
- Assuming FTP can automate deployment fully
- Using manual ZIP deploy for automation
Ready to prove it?
Pass the test and this pattern moves unknown
