Delete Azure Subscription Completely with Powershell - azure

I am looking for a powershell cmdlet that deletes the Azure subscription completely. I was not able to find one. I saw something similar posted 2 years back cannot remove azure subscription
Is there a way to remove the subscription completely (all resources associated to subscription)? I don't want to loop through and remove all resource groups.

There is no such powershell cmdlet to delete Azure subscription.
At this point you should now be able to cancel the subscription through the portal.
For more details, “Cancel your subscription for Azure”.
If you still have questions, contact support (Which is free of cost) to get your issue resolved quickly.

Related

"Azure DevOps Organization" resource in Azure

I have resource group that is named "VisualStudioOnline-" and inside there is a single resource as given below. Looks like Azure DevOps created it. What is it used for and can I delete it?
PS: I would need to continue use the DevOps organization and projects.
You can navigate to https://dev.azure.com/ and delete the organization from there or you could hit the following url and delete it,
https://dev.azure.com/{ORGANIZATION_NAME}/_settings/
replace ORGANIZATION_NAME with actual value
I don't think you can delete it if you want to keep your Azure Devops environment. As far as I know, billing for Azure Devops needs to be linked to a certain Azure subscription, hence the appearance of the organization in your subscription.
note
I believe it is possible to move the organization to another subscription though (from within Azure Devops UI >> organization settings >> billing >> 'change billing'). This will link the billing for your Devops to the other subscription.
I have never done this myself, but perhaps the resource would then also be moved to the other subscription?

Move Visual Studio(MSDN) subscriptions into specific management group

We currently have a lot of subscriptions in Azure which we managed, these range from the different execution environments(dev,test,etc) and are all grouped inside a management group structure to make RBAC and policies easier. The problem we are facing at the moment is that out root of the management group structure has a bunch of Visual Studio Professional(/MSDN) subscriptions. We are looking to automate a script to check for the offerId of the subscription and move all these into a specific management group.
So far we have had no joy or functions using the Powershell or Azure CLI to actually filter the subscriptions by OfferId. Even if I could get a subscription export with OfferId I could use that list to automate move all these subscriptions into a specific management group. Has anybody experienced the same, or should I rather just leave those subscriptions lying there. The idea behind having it separate is to have it isolated and more control over it, reporting on costs etc for the management group will also be an advantage.
If you want to move subscriptions to the Azure management group with PowerShell, please refer to the following script :
#create management group
New-AzManagementGroup -GroupName 'Contoso'
#move Subscription
New-AzManagementGroupSubscription -GroupName 'Contoso' -SubscriptionId ''
Besides, please note that if you want to do that, you need to have enough RBAC permissions
For more details, please refer to https://learn.microsoft.com/en-us/azure/governance/management-groups/manage#move-subscriptions-in-the-hierarchy.

Azure CLI - delete subscription?

I am looking for a way to delete Azure subscription programmatically. I'm mainly interested in Azure CLI but i can not find the way to do that in proper way.
By the way there is PowerShell Command which provide exactly needed action. Remove-AzureSubscription
there is no way to delete a subscription. the linked cmdlet doesn't do what you think it does:
The Remove-AzureSubscription cmdlet deletes an Azure subscription from your subscription data file so Windows PowerShell can't find it. This cmdlet does not delete the subscription from Microsoft Azure, or change the actual subscription in any way.
only Azure Support might be able to help you, although in my case they said its impossible to delete subscriptions.
New feature in REST API already as preview:
The operation to cancel a subscription
https://learn.microsoft.com/en-us/rest/api/resources/subscriptions%20(preview)/cancel

"No quotas available" in brand new Azure subscription

We have a brand new (as in, created a couple of days ago and no resources in it yet) Azure pay-as-you-go subscription, and now when I try to provision something, I'm not allowed.
Looking at the subscription in the portal, under "Usage + quotas" the list is empty.
Did we do something wrong when signing up? How do we enable it?
You only need to register to the Microsoft.Compute Resource Provider on the Subscriptions Blade.
Go to Subscriptions
Select the desired subscription
Click on Resource Providers
Register to the option "Microsoft.Compute"
Turns out there were some things I could do myself on this, and some things I had to turn to Azure Support for.
Thing I could do myself: Enable a bunch of resource providers
It turned out the subscription did not have a single resource provider enabled. To fix, I found the Subscription blade, and clicked the "Resource Providers" menu item (toward the bottom). That opened up a list where I could register lots of stuff. This also enabled corresponding quotas on the subscription.
Thing I couldn't do myslef: Increase e.g. VM quotas
Some of those quotas, however, I wasn't able to figure out how to turn on myself. Crucially, one of them was for provisioning VM:s (including "hidden" ones, e.g. the underlying VM:s in an AKS cluster or an App Service). Thankfully, Azure Support were really responsive and from first contact until I was able to provision stuff took less than a business day.

Subscription I have been removed from, still showing in Azure Portal

A couple of clients gave me access to their Azure subscriptions so that I could do work for them. The work has been completed and I asked them to remove my permission from their subscriptions.
They have done this but for some reason their subscriptions still show up in my list of available subscriptions when I click on my profile in the top right of the Azure Portal.
I can click on one of the subscriptions and switch to it, but I cannot see any of their resources, or create new ones. This confirms that I do not have permissions for that subscription anymore.
So if my access has been removed, which is it still showing up in the list of subscriptions which are available to me? Is there any way I can remove it from the list?
Thanks :)
It is not possible at the moment.
The link here shows a reply from Azure customer care.
Greetings from Microsoft Azure. I reviewed your request and would like
to mention that there is unfortunately no option to remove the
disabled subscription from the Azure portal. This is by design to
enable customer’s view the subscriptions purchased by them right from
the day the Azure account was created.
This means you are still a member of the directory (even though you are no longer an admin of anything). You can ask the administrator of the directory to remove you.
You should also upvote this suggestion: https://feedback.azure.com/forums/223579-azure-portal/suggestions/13327620-remove-old-directories
If you are a co-admin you can remove yourself by navigating to Settings->Administrators->Select->Remove from the classic portal (old)

Resources