Azure / ng-deploy-azure

Deploy Angular apps to Azure using the Angular CLI
MIT License
79 stars 37 forks source link

Spinner gets stuck after create a resource group #60

Closed softchris closed 4 years ago

softchris commented 4 years ago

Describe the bug Call ng add. Resource group is created and spinner gets stuck early on. Having tracked down the issue it's in the checkNameAvailability() function. The function is meant to validate a name and needs to respond true if name is available and false if not. Currently, it gets stuck in a loop of false responses

Suggested code fix is

  return async (account: string) => {
    spinner.start();
    const availability = await client.storageAccounts.checkNameAvailability(account);
    if (!availability.nameAvailable && warn) {
      spinner.fail(availability.message || 'chosen name is not available');
      return false;
    } else {
      spinner.stop();
      return true;
    }
  };
}

Expected behavior Expect azure.json to be generated