Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Donate Bitcoins

Programming and Learning from SD

I used the new Visual Studio Team Services buils to deploy to an Azure CloudService web app. It created the web app automatically for me, but was put into a default resource group. I wanted to move it to the resource goup I had defined for other parts of the system. I found out that it can’t be done through the Azure Portal

I’m new to using PowerShell to manage Azure and had to go through several blogs and steps to move my resource.

 

  1. Install Web Platform installer
  2. Use WPI to install Azure PowerShell
  3. install
  4. run Azure PowerShell as Administrator
  5. change the execution policy in PowerShell
    1. Set-ExecutionPolicy Unrestricted
  6. Install PackageManagement installer to be able to run Install-Module (https://www.microsoft.com/en-us/download/details.aspx?id=49186)  in PowerShell
    1. We need to get AzureRm and AzureRm.Resources from the PowerShell Gallery
  7. Install-Module -Name AzureRM to install AzureRm from the powershell gallery
  8. Install-Module –Name AzureRM.Resources
  9. Login-AzureRmAccount
    1. (web browser popup came up asking for username and password for Azure) ** This a command to remember!
  10. Get-AzureRmResourceGroup
    1. find the ResourceId of your Web app (I didn’t figure out how to filter by name)
  11. Move-AzureRmResource -ResourceId "/subscriptions/{your subscription here}/resourceGroups/Default-Web-NorthCentralUS/providers/Microsoft.Web/sites/cdd-Validate" -DestinationResourceGroupName continuousDeliveryDemo
    1. There wasn’t a –ResourceName option, that would have made it easier

 

I started my journey by finding this article (http://blog.kloud.com.au/2015/03/24/moving-resources-between-azure-resource-groups/) by searching. Then I had to figure out the steps above. I also found out that Switch-AzureMode is deprecated and removed, so the article is out of date. I suppose I could add this as a build task and never have it in the wrong resource group. I’ll continue to work from my CD and VSO attempts.

Here are some other articles that were useful to me.

https://www.powershellgallery.com/GettingStarted?section=Get%20Started

https://azure.microsoft.com/en-us/blog/azps-1-0/

https://channel9.msdn.com/Series/Windows-Azure-Virtual-Machines-and-Networking-Tutorials/Introduction-to-Windows-Azure-PowerShell – good 9 minute introduction video.

 

Hint: Run $PSVersionTable.PSVersion in PowerShell to get the version of PS you have. Posted on Thursday, January 21, 2016 4:34 PM Azure , DevOps | Back to top


Comments on this post: Moving a Cloud App to a different Azure Resource Group

# re: Moving a Cloud App to a different Azure Resource Group
Requesting Gravatar...
I had to work on this as well. Hope, I can get this done soon. - Green Water Technologies
Left by Green on Jan 27, 2016 5:37 AM

# re: Moving a Cloud App to a different Azure Resource Group
Requesting Gravatar...
I've used this process and it worked well. Thanks for sharing this idea. - Dennis Wong YOR Health
Left by James on Feb 18, 2016 6:22 AM

Your comment:
 (will show your gravatar)


Copyright © Aligned | Powered by: GeeksWithBlogs.net | Join free