https://pulumi.com logo
Title
a

agreeable-caravan-84210

04/13/2021, 12:17 PM
Hey guys, I've got a question regarding Azure subscriptions. What's the best method for migrating existing stacks from one sub to another? At the time, I'm thinking
destroy
+
update
. On the other hand, Azure supports resources migration (through portal) but I'm guessing I'll need to edit the resources IDs in the stack files with the new subscription ID, is it worth the try? Thanks
g

gentle-diamond-70147

04/13/2021, 2:19 PM
I've not used the migration option through the Azure portal, but that sounds correct to me - updating the resource IDs and subscription ID in the stack state.
destroy
+
update
would likely be easiest if those resources can be thrown away.
a

agreeable-caravan-84210

04/13/2021, 3:22 PM
Thanks for the answers! Little update, So I've tried to update all related stack files (backups, history, stacks) changing the old subid for the new one after the manual migration in the Portal. When I tried to change a property and do an update I got this error
updating urn:pulumi:myStack::myProject::azure:storage/account:Account::mystack: Error updating Azure Storage Account network_rules "mystack4cbe748": storage.AccountsClient#Update: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="PatchResourceNotFound" Message="The resource '<https://management.azure.com/subscriptions/a5*******************************/resourceGroups/mystackmain229fd717/providers/Microsoft.Storage/storageAccounts/mystack4cbe748?api-version=2019-06-01>' was not found when performing the PATCH operation." Target="mystack4cbe748"
Either way, I won't be pursuing this method anymore since I've already started the destroy + update. I leave this here as insights for future issues.