public static async Task WaitForStackStatus(string stackName, StackStatus finalStatus)
        {
            StackStatus currentStatus = await GetStackStatus(stackName);

            while (currentStatus != finalStatus)
            {
                if (!currentStatus.ToString().Contains("IN_PROGRESS"))
                {
                    throw new Exception($"Error while creation or updating stack: {currentStatus}");
                }
                Console.WriteLine(currentStatus);
                await Task.Delay(20000);

                currentStatus = await GetStackStatus(stackName);
            }
            Console.WriteLine(currentStatus);
        }
        private static async Task WaitForStackStatus(string stackName, StackStatus expectedStatus, Credentials credentials)
        {
            StackStatus stackStatus = await GetStackStatus(stackName, credentials);

            while (stackStatus != expectedStatus)
            {
                Console.WriteLine($"{stackStatus}...");

                if (!stackStatus.ToString().EndsWith("_IN_PROGRESS"))
                {
                    throw new System.InvalidOperationException($"Unexpected status {stackStatus}");
                }

                await Task.Delay(TimeSpan.FromSeconds(15));

                stackStatus = await GetStackStatus(stackName, credentials);
            }

            Console.WriteLine($"Stack {stackName} successfully reached {stackStatus} status.");
        }