/// <summary>
        /// Delete resource group by tag
        /// </summary>
        /// <param name="tag"></param>
        /// <returns></returns>
        public async Task <ActionResult> DeleteResourceGroups(string tag)
        {
            try
            {
                tag.AssertNotEmpty(nameof(tag));

                var subscriptions = await new SubscriptionController().GetSubscriptions();
                var tagName       = tag.Split('=')[0];
                var tagValue      = tag.Split('=')[1];

                foreach (var subscription in subscriptions)
                {
                    var resourceGroups = await GetResourceGroupsByTag(subscription.SubscriptionId, tagName, tagValue);

                    foreach (var resourceGroup in resourceGroups)
                    {
                        var endpointUrl = string.Format(UriConstants.DeleteResourceGroupUri, subscription.SubscriptionId, resourceGroup.Name);

                        var client = new RestApiClient();
                        await client.CallDeleteAsync <ResourceGroup>(endpointUrl, await ServicePrincipal.GetAccessToken());
                    }
                }

                return(View());
            }
            catch (Exception exception)
            {
                ViewBag.ErrorMessage = "Error";
                ViewBag.ErrorDetails = exception.Message;

                Log.Error(exception);

                return(View("Error"));
            }
        }