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
Related
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?
I have few hundreds Azure Blob Storage Accounts under my Azure account.
I want to add to all of them the same Lifecycle management rule.
Can this be done from the UI without going one by one?
(I know I can write a script to do it, I was wondering if it is possible also from the UI)
Direct answer to your question is no - you cannot perform bulk lifecycle update through the portal.
The closest thing would be an existing Azure Automation Runbook for that, but I did not find any. You can create your own if it make sense. Here you can see an example how it looks:
Code is a pure powershell:
But if this is one-time task I would go with Azure CLI or Powershell script.
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.
I know how to add a co-administrator via the portal, but need a way to add it via PowerShell.
I need this method as I have lost access to the login id, but have the publish setting file so can administrator my virtual machines.
Unfortunately you can't. Azure PowerShell Cmdlets are essentially wrapper over Azure Service Management API and currently the API does not expose any method to add co-admins programmatically.
Azure have rolled out Roll Based Access Control which will allow you to automate the adding of new admins to your Azure Subscription. Intro here: https://azure.microsoft.com/en-us/documentation/articles/role-based-access-control-configure/
You would add a new user as an Owner at the Subscription scope. These operations are available using both PowerShell and REST
On Azure, I am currently using my "3-month Free Trial" subscription, and just recently I got access to a "Windows Azure MSDN - Visual Studio Ultimate" subscription.
Is it possible to move an existing set of hosted sites to another subscription using the Portal?
Obviously I could just re-publish the sites using Visual Studio, but I'm wondering if there is a way to do this in the GUI?
There is no way you can accomplish in the Portal interface. You do have an option to request Windows Azure Billing Team and request them move all of your currently configured and running services from one Subscription to other subscription, the key is "all".
IF you want to move one specific service from one subscription to another then the available option is to deploy directly to other subscription.
I did do this once. I had to contact their billing team and after a couple of days of back and forth between them it was taking too long so I just did it manually, redeploying the sites to the new subscription. This may not be possible if you have many sites. I did a backup and restore of the SQL Azure database.
I am battling with azure support right now on trying to do the same thing. From what I can tell your best bet is creating the services on your MSDN subscription and redeploying.
I don't know a way to do this from the portal but I do recommend using Windows Azure PowerShell which has the ability to manage multiple subscriptions and in your case you can just do this cmdlet to copy a service into another subscription:
Publish-AzureServiceProject -sn MyNewSubscriptionName