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
395 stars 190 forks source link

[Issue] Azd provision fails saying still provisioning from last provision which failed on postprovision script #2977

Open dfberry opened 10 months ago

dfberry commented 10 months ago

I'm trying to provision this branch. Since the infra has a postprovision script which uses az cli, I have the following steps:

1) azd provision -> fails on postprovision saying az cli auth error 2) azd config set auth.useAzCliAuth true -> success 3) az login -> success 4) azd provision -> fails with

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details:
DeploymentActive: Unable to edit or replace deployment 'postgresql': previous deployment from '11/15/2023 12:46:43 AM' is still active (expiration time is '11/22/2023 12:45:37 AM'). Please see https://aka.ms/arm-deploy-resources for usage details.

TraceID: 403e06871d2d09afa9854bc70537cbd5

Entire script is:

@dfberry ➜ /workspaces/contoso-real-estate (dfberry/1112-01) $ azd provision

Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time.

Subscription: Visual Studio Enterprise Subscription (b57b253a-e19e-4a9c-a0c0-a5062910a749)
Location: West Europe

  You can view detailed progress in the Azure Portal:
  https://portal.azure.com/#view/HubsExtension/DeploymentDetailsBlade/~/overview/id/%2Fsubscriptions%2Fb57b253a-e19e-4a9c-a0c0-a5062910a749%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fdfberry-1114-515893df-1700009174

  (✓) Done: Resource group: rg-dfberry-1114-515893df
  (✓) Done: Log Analytics workspace: log-dd57syhnhunji
  (✓) Done: Key Vault: kv-dd57syhnhunji
  (✓) Done: Storage account: stdd57syhnhunji
  (✓) Done: App Service plan: plan-dd57syhnhunji
  (✓) Done: Static Web App: stapp-web-dd57syhnhunji
  (✓) Done: Azure Database for PostgreSQL flexible server: psql-db-dd57syhnhunji
  (✓) Done: Application Insights: appi-dd57syhnhunji
  (✓) Done: Portal dashboard: dash-dd57syhnhunji
  (✓) Done: Azure Cosmos DB: cosmos-dd57syhnhunji
  (✓) Done: Container Apps Environment: cae-dd57syhnhunji
  (✓) Done: Container Registry: crdd57syhnhunji

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details:
DeploymentActive: Unable to edit or replace deployment 'postgresql': previous deployment from '11/15/2023 12:46:43 AM' is still active (expiration time is '11/22/2023 12:45:37 AM'). Please see https://aka.ms/arm-deploy-resources for usage details.

TraceID: 403e06871d2d09afa9854bc70537cbd5
@dfberry ➜ /workspaces/contoso-real-estate (dfberry/1112-01) $ 
wbreza commented 10 months ago

Please review the deployment progress link in the Azure Portal to check to see if the postgresql resource is still actively running. azd will throw an error if any of the deployments are still active.

vhvb1989 commented 10 months ago

@dfberry, it might be too late now, but you can use azd hooks run postprovision to just run the postprovision hook without running provision all over again. The azd hooks run <hookName> can help on this cases (if provision had no issues) to just resume the operation.

rajeshkamal5050 commented 6 months ago

@dfberry, it might be too late now, but you can use azd hooks run postprovision to just run the postprovision hook without running provision all over again. The azd hooks run <hookName> can help on this cases (if provision had no issues) to just resume the operation.

@dfberry did you try the suggestion above?