Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
393 stars 187 forks source link

[Issue] Python Web App Deployment taking longer with v0.2.0-beta.1 #688

Open charris-msft opened 1 year ago

charris-msft commented 1 year ago

Output from azd version azd version 0.2.0-beta.1 (commit 817a81ab44ac788ec2d3050e94ba0138c3a80ac3)

Output from az version

  "azure-cli": "2.40.0",
  "azure-cli-core": "2.40.0",
  "azure-cli-telemetry": "1.0.8",
  "extensions": {
    "azure-dev": "0.0.1b456",
    "connectedk8s": "1.3.3",
    "connectedmachine": "0.5.1",
    "containerapp": "0.3.11",
    "containerapp-compose": "0.2.2",
    "customlocation": "0.1.3",
    "k8s-extension": "1.3.3",
    "rdbms-connect": "1.0.3",
    "webapp": "0.4.0"
  }

Describe the bug With the previous version of azd I observed azd up templates for this repo taking 3 minutes.

After upgrading to 0.2.0-beta.1, I've deployed twice.

I noticed when comparing my recording to the Deployment Center logs for one of the attemptes, there appears to be a 4 minute gap between when the Deployment Center indicated the deployment was complete and when the CLI updated to indicate the deployment was complete.

JonG thought there might be a delay in the api.

To Reproduce azd up --tempate https://github.com/tonybaloney/django-on-azure

Expected behavior After talking with JonG, about improvements in the current release I expected the deployment to be at least as fast if not faster than the previous version.

Environment Information on your environment:

Additional context Add any other context about the problem here.

weikanglim commented 1 year ago

Hey @charris-msft , thanks for reporting it. Performance is always tricky, and I'm glad that you found an anomaly by comparing with the deployment center timings.

Would you mind rerunning azd up --template https://github.com/tonybaloney/django-on-azure with debug enabled (assuming it reproduces consistently), and sending the logs offline (debug logs might contain az debug logs which itself can be sensitive)? I'm going to try and do the same on my end.

The following command should work: azd up --template https://github.com/tonybaloney/django-on-azure --debug 1>azd.out 2>azd.err.

charris-msft commented 1 year ago

Hi @weikanglim - I tried the command you suggested, but it just hung for about 20 minutes - I'm guessing the prompt for the environment name, region, etc was swallowed up by stdout.

I'll get the --debug, but without redirecting the output and share it in just a minute

rajeshkamal5050 commented 1 year ago

Hey @charris-msft did you get the debug output?

weikanglim commented 1 year ago

@charris-msft Thanks for submitting the debug output.

Looking at the output, I see all the correct behavior on azd. A deployment is created through az deployment sub create, and every 30 seconds, az was polling the ARM API to see if the deployment was completed. At 00:15:12 UTC, it completed and azd correctly continued with application deploy. The ARM deploy started at 00:06:57 UTC, so this took about 9 minutes.

For the application deploy, that took 8 minutes to complete. These two operations took majority the execution time and are all dependent on Azure services on how long it might take.