%3CLINGO-SUB%20id%3D%22lingo-sub-1287325%22%20slang%3D%22en-US%22%3ERe%3A%20Start%20your%20Infrastructure%20as%20Code%20journey%20with%20AzStackHub%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1287325%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20Blogpost%20Tiberiu%2C%20Thanks%20for%20sharing%20with%20the%20community%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1288972%22%20slang%3D%22en-US%22%3ERe%3A%20Start%20your%20Infrastructure%20as%20Code%20journey%20with%20AzStackHub%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1288972%22%20slang%3D%22en-US%22%3E%3CP%3EGood%20stuff%2C%20very%20helpful!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1292484%22%20slang%3D%22en-US%22%3ERe%3A%20Start%20your%20Infrastructure%20as%20Code%20journey%20with%20AzStackHub%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1292484%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20post%20Tibi!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1287120%22%20slang%3D%22en-US%22%3EStart%20your%20Infrastructure%20as%20Code%20journey%20with%20AzStackHub%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1287120%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAzure%20Stack%20Hub%20lights%20up%20IaaS%20capabilities%20in%20your%20datacenter.%20These%20range%20from%20foundational%20concepts%20like%20enabling%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fazure-stack-iaas-part-five%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eself-service%3C%2FA%3E%2C%20having%20a%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fazure-stack-iaas-part-nine%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Emarketplace%20of%20items%3C%2FA%3E%2C%20or%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fazure-stack-iaas-part-seven%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eenabling%20RBAC%3C%2FA%3E%20(all%20of%20them%20concepts%20we%E2%80%99ve%20explored%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-ca%2Fblog%2Fazure-stack-iaas-part-one%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Stack%20IaaS%20series%3C%2FA%3E)%20%E2%80%93%20all%20the%20way%20to%20enabling%20an%20Infrastructure%20as%20Code%20practice%2C%20or%20enabling%20hybrid%20applications.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegardless%20of%20your%20motivation%20to%20get%20started%20with%20Azure%20Stack%20Hub%20(regulatory%2C%20compliance%2C%20network%20requirements%2C%20backend%20systems)%2C%20every%20customer%20has%20their%20own%2C%20unique%20journey%20to%20the%20cloud.%20We%E2%80%99ve%20talked%20about%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fazure-stack-laas-part-two%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehow%20the%20journey%20could%20start%20with%20existing%20servers%3C%2FA%3E%20and%20have%20captured%20some%20of%20the%20lessons%20learned%20and%20questions%20that%20should%20be%20asked%20along%20the%20way%20(%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fresources%2Fmigrate-to-azure-stack-hub-patterns-and-practices-checklists%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fresources%2Fmigrate-to-azure-stack-hub-patterns-and-practices-checklists%2F%3C%2FA%3E).%3C%2FP%3E%0A%3CP%3EIdeally%2C%20every%20cloud%20migration%20project%20would%20include%20all%20the%20scripts%20and%20templates%20required%20to%20have%20an%20Infrastructure%20as%20Code%20(IaC)%20approach.%20This%20would%20enable%20the%20management%20of%20infrastructure%20(networks%2C%20virtual%20machines%2C%20load%20balancers%2C%20and%20connection%20topology)%20in%20a%20descriptive%20model%2C%20using%20the%20same%20versioning%26nbsp%3B%20features%20as%20DevOps%20teams%20use%20for%20source%20code.%20It%20would%20take%20advantage%20of%20idempotency%20and%20enable%20DevOps%20teams%20to%20test%20applications%20early%20in%20the%20development%20cycle%20in%20production-like%20environments.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20reality%20though%2C%20most%20deployments%20on%20Azure%20Stack%20Hub%20will%20start%20with%20either%20small%20POCs%2C%20migrations%20of%20that%20one%20VM%20which%20I%E2%80%99ll-migrate-like-this-while-the-others-I%E2%80%99ll-do-properly%20which%20then%20turns%20into%20the%20migration%20process%20used%20for%20everything%2C%20or%20multiple%20lift-and-shift%20migrations%20moved%20%E2%80%9Cas%20they%20are%E2%80%9D%20in%20the%20hopes%20that%20you%20will%20switch%20to%20a%20Infrastructure%20as%20Code%20later.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%20it%20is%20easier%20to%20start%20with%20IaC%20from%20the%20start%20of%20the%20project%2C%20it%E2%80%99s%20never%20too%20late%20to%20take%20advantage%20of%20the%20IaaS%20capabilities%20exposed%20by%20Azure%20Stack%20Hub.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20facilitate%20this%20transition%2C%20we%E2%80%99ve%20came%20up%20with%20a%20series%20of%20scripts%20(under%20the%20name%20of%20%E2%80%9C%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-stack%2Fuser%2Fazure-stack-network-howto-backup-replicator%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esubscription%20replicator%3C%2FA%3E%E2%80%9D)%20that%20will%20virtually%20read%20the%20resources%20in%20the%20current%20Azure%20Stack%20Hub%20user-subscription%20and%20recreate%20the%20ARM%20templates%20required%20to%20deploy%20these%20resources.%20This%20process%20applies%20only%20for%20the%20ARM-resources%20themselves%20(virtual%20networks%2C%20NSGs%2C%20VMs%2C%20RGs%2C%20etc)%2C%20not%20the%20actual%20data%20that%20lives%20in%20the%20respective%20VMs%20or%20storage%20accounts.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%E2%80%99ve%20used%20the%20initial%20process%20to%20replicate%20resources%20across%20multiple%20stamps%20%E2%80%93%20where%20customers%20wanted%20to%20change%20something%20in%20the%20original%20Azure%20Stack%20Hub%20stamp.%20The%20same%20process%20could%20however%20be%20used%20in%20a%20wider%20range%20of%20scenarios%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EMoving%20from%20an%20ASDK%20(POC)%20environment%20to%20a%20production%20Azure%20Stack%20Hub%3C%2FLI%3E%0A%3CLI%3EUpdating%20ASDKs%20to%20a%20newer%20version%2C%20without%20losing%20everything%20created%3C%2FLI%3E%0A%3CLI%3ECreating%20BCDR%20across%20multiple%20stamps%3C%2FLI%3E%0A%3CLI%3EEven%20starting%20your%20journey%20towards%20an%20Infrastructure%20as%20Code%20approach.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EHaving%20the%20ARM%20templates%20required%20to%20deploy%20the%20resources%2C%20could%20be%20the%20starting%20point%20of%20building%20a%20DevOps%20practice%2C%20including%20CI%2FCD%20pipelines%20for%20your%20infrastructure%2C%20and%20building%20the%20next%20deployments%20using%20code.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20following%20example%20is%20based%20off%20a%20scenario%20where%20you%E2%80%99ve%20used%20an%20ASDK%20and%20built%20your%20solution.%20This%20could%20be%20a%20POC%2C%20or%20the%20start%20of%20a%20project%20where%20things%20were%20tested%20in%20the%20ASDK.%20When%20completed%2C%20you%20plan%20to%20move%20to%20an%20Azure%20Stack%20Integrated%20System%2C%20and%20are%20looking%20to%20start%20an%20IaC%20practice%20as%20well.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-416712011%22%20id%3D%22toc-hId-416712011%22%3ESource%20environment%3C%2FH1%3E%0A%3CP%3EIn%20this%20example%2C%20the%20solution%20is%20comprised%20of%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_0-1586230997540.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182639iCE1CE3616B343437%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_0-1586230997540.png%22%20alt%3D%22rctibi_0-1586230997540.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E3%20Virtual%20Machines%20of%20different%20sizes%2C%20each%20with%20various%20NSGs%20and%20rules%3C%2FLI%3E%0A%3CLI%3EOne%20virtual%20network%2C%20which%20all%20these%20VMs%20are%20linked%20to%3C%2FLI%3E%0A%3CLI%3EOne%20storage%20account%20used%20to%20host%20the%20bootdiagnostics%20for%20the%203%20VMs%3C%2FLI%3E%0A%3CLI%3ECertain%20RBAC%20rules%20set%20for%20resources%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EAll%20these%20resources%20were%20deployed%20as%20part%20of%203%20different%20deployments%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_1-1586230997552.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182640iEA11697F13F07047%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_1-1586230997552.png%22%20alt%3D%22rctibi_1-1586230997552.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20reflects%20many%20cases%20where%20the%20initial%20deployment%20is%20done%20through%20the%20portal%2C%20after%20that%20things%20are%20added%2C%20changed%2C%20adjusted%2C%20and%20stabilized.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20VMs%20have%20different%20sizes%20and%20could%20have%20various%20settings%2C%20numbers%20of%20disks%2C%20or%20even%20NICs%20attached%20to%20them%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_0-1586233060234.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182664i99EFC9DF8B2EB5D8%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_0-1586233060234.png%22%20alt%3D%22rctibi_0-1586233060234.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_1-1586233071406.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182665i59669928408BDD35%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_1-1586233071406.png%22%20alt%3D%22rctibi_1-1586233071406.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EThe%20RBAC%20side%20has%20a%20few%20aspects%20to%20consider%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThe%20users%20typically%20used%20in%20a%20PoC%20will%20be%20different%20to%20the%20ones%20in%20a%20Production%20%E2%80%93%20so%20when%20%E2%80%9Cmoving%E2%80%9D%20these%20resources%20you%20will%20need%20to%20convert%20the%20assignments%20accordingly%3C%2FLI%3E%0A%3CLI%3EThe%20RBAC%20custom%20roles%20will%20need%20to%20be%20populated%20respectively%20as%20well%2C%20since%20their%20membership%20will%20change%2C%20when%20migrating%20you%20need%20to%20take%20into%20account%20what%20happens%20to%20these%20roles%3C%2FLI%3E%0A%3CLI%3EThe%20RBAC%20itself%20isn%E2%80%99t%20part%20of%20the%20scripts%20automatically%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThe%20last%20part%20is%20due%20to%20complexities%20around%20the%20roles.%20We%20will%20not%20cover%20in%20this%20article%20ways%20for%20you%20to%20replicate%20the%20custom%20RBAC%20roles%2C%20but%20these%20can%20be%20used%20and%20adapted%20as%20needed%20on%20each%20Azure%20Stack%20Hub%20stamp.%3C%2FP%3E%0A%3CP%3EIn%20this%20case%2C%20I%20have%20created%20a%20new%20role%20called%20%E2%80%9CVirtual%20Machine%20User%20Login%E2%80%9D%20(which%20is%20the%20same%20as%20the%20Azure%20role%20with%20the%20same%20name%20%E2%80%93%20if%20you%20are%20looking%20for%20more%20info%2C%20check%20the%20links%20below)%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_4-1586230997599.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182642iF148DE0840266B4C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_4-1586230997599.png%22%20alt%3D%22rctibi_4-1586230997599.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20role%20is%20assigned%20to%20a%20user%20at%20the%20RG%20level%20%E2%80%93%20remember%20that%20everything%20is%20deployed%20in%20a%20single%20RG%20in%20this%20case%2C%20so%20this%20user%20would%20have%20rights%20for%20all%20the%20VMs%20in%20this%20RGs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1107273485%22%20id%3D%22toc-hId-1107273485%22%3ELinks%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EIf%20you%20are%20looking%20to%20configure%20custom%20roles%2C%20a%20good%20starting%20point%20is%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure-Samples%2FAzure-Stack-Hub-Foundation-Core%2Fblob%2Fmaster%2FOperatorWorkshop%2Fazure-stack-hub-lab-guide-operator.md%23rbac--tags--auditing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%3C%2FA%3E%20exercise%20from%20the%20operator%20guide%20workshop.%3C%2FLI%3E%0A%3CLI%3EThe%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure-Samples%2FAzure-Stack-Hub-Foundation-Core%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure-Samples%2FAzure-Stack-Hub-Foundation-Core%2F%3C%2FA%3E%20are%20a%20set%20of%20materials%20(PowerPoint%20presentations%2C%20workshops%2C%20and%20links%20to%20videos)%20aiming%20to%20provide%20Azure%20Stack%20Hub%20Operators%20the%20foundational%20materials%20required%20to%20ramp-up%20and%20understand%20the%20basics%20of%20operating%20Azure%20Stack%20Hub%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1096770381%22%20id%3D%22toc-hId-1096770381%22%3ETarget%20environment%3C%2FH1%3E%0A%3CP%3EThe%20target%20environment%20is%20an%208%20node%20Azure%20Stack%20Hub%20Integrated%20System%20configured%20with%20Internet%20access.%20This%20isn%E2%80%99t%20required%2C%20as%20the%20Azure%20Stack%20Hub%20system%20could%20use%20%E2%80%9Clocal%E2%80%9D%20IP%20ranges%20(local%20for%20the%20respective%20Enterprise%20or%20Datacenter%20that%20it%20resides%20in)%2C%20but%20in%20this%20case%2C%20it%20does%20enable%20certain%20features.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20the%20ASDK%20is%20placed%20in%20a%20different%20location%20to%20the%20Azure%20Stack%20Hub%20Integrated%20System.%20Access%20from%20the%20ASDK%20will%20be%20outbound%20only%20and%20we%20can%20access%20the%20target%20environment%20directly%2C%20even%20though%20it%E2%80%99s%20in%20a%20different%20location.%20Of%20course%2C%20networking%20needs%20to%20be%20taken%20into%20consideration%20whenever%20resources%20are%20moved%20across%20environments%20and%20adjustments%20need%20to%20be%20made%20accordingly.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_5-1586230997611.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182643i044AC69D65EA5A68%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_5-1586230997611.png%22%20alt%3D%22rctibi_5-1586230997611.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20user-portal%2C%20we%E2%80%99ve%20already%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-stack%2Foperator%2Fazure-stack-subscribe-plan-provision-vm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ecreated%3C%2FA%3E%20a%20user%20subscription%20with%20sufficient%20quotas%20to%20support%20the%20resources%20we%20plan%20to%20move.%20In%20a%20real%20migration%2C%20this%20would%20need%20to%20be%20properly%20assessed%20and%20planned%2C%20in%20accordance%20to%20the%20capacity%20management%20plans%20for%20this%20Azure%20Stack%20Hub%20environment.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_6-1586230997621.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182645i1844709E6B65A6D4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_6-1586230997621.png%22%20alt%3D%22rctibi_6-1586230997621.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20needed%20before%20running%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-stack%2Fuser%2Fazure-stack-network-howto-backup-replicator%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Escripts%3C%2FA%3E%2C%20since%20the%20script%20will%20use%20the%20TenantID%20of%20the%20AAD%20used%20as%20well%20as%20the%20user%20SubscriptionID%20where%20the%20resources%20will%20be%20created.%20Both%20are%20needed%20during%20the%20deployment%20and%20the%20script%20will%20hydrate%20these%20when%20creating%20the%20ARM%20templates.%3C%2FP%3E%0A%3CP%3ENote%3A%20Before%20starting%20the%20script%2C%20you%20should%20note%20the%20source%20and%20target%20tenantIDs%20and%20subscriptionIDs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--710684082%22%20id%3D%22toc-hId--710684082%22%3EMoving%20the%20resources%3C%2FH1%3E%0A%3CH2%20id%3D%22toc-hId--20122608%22%20id%3D%22toc-hId--20122608%22%3EARM%20resources%3C%2FH2%3E%0A%3CP%3EThe%20location%20of%20the%20scripts%2C%20process%2C%20and%20setting%20up%20the%20environments%20are%20described%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-stack%2Fuser%2Fazure-stack-network-howto-backup-replicator%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EReplicate%20resources%20using%20the%20Azure%20Stack%20Hub%20subscription%20replicator%3C%2FA%3E.%20Completing%20the%20steps%2C%20will%20result%20in%20the%20creation%20of%20the%20parameter%20files%20as%20well%20as%20custom%20ARM%20templates%20where%20required%3A%3C%2FP%3E%0A%3CTABLE%20width%3D%22762%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22339%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_7-1586230997631.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182646i53113459B1E45954%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_7-1586230997631.png%22%20alt%3D%22rctibi_7-1586230997631.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22423%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_8-1586230997640.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182644i5D7F24361F514E6D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_8-1586230997640.png%22%20alt%3D%22rctibi_8-1586230997640.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThese%20are%20important%20as%20they%20act%20as%20a%20%E2%80%9Csnapshot%E2%80%9D%20in%20time%20of%20your%20deployment%20%E2%80%93%20meaning%2C%20if%20you%20were%20to%20use%20these%20and%20build%20ARM%20templates%20for%20every%20deployment%20moving%20forward%2C%20this%20would%20act%20as%20a%20%E2%80%9Cstarting%20point%E2%80%9D%20in%20your%20Infrastructure%20as%20Code%20journey.%3C%2FP%3E%0A%3CP%3EThe%20example%20given%20above%20is%20simple%3A%20a%20few%20virtual%20machines%2C%20a%20virtual%20network%2C%20and%20NSGs.%20Even%20so%2C%20you%20can%20notice%20how%20parameters%20include%20the%20IP%20settings%20of%20for%20each%20of%20those%20VMs%2C%20and%20how%20NSGs%20include%20the%20ports%20configured%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_9-1586230997653.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182647i246A1239702BA1E9%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_9-1586230997653.png%22%20alt%3D%22rctibi_9-1586230997653.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20easily%20image%20a%20complex%20scenario%2C%20where%20these%20have%20been%20vetted%20by%20the%20networking%20team%2C%20or%20are%20following%20certain%20design%20that%20is%20a%20standard%20in%20the%20company.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20can%20also%20be%20the%20moment%20where%20you%20adjust%20these%20settings%20to%20reflect%20the%20naming%20convention%20for%20your%20production%20environment%2C%20or%20configure%20certain%20ports%20required%20by%20other%20production%20applications.%20Since%20every%20ARM%20resource%20that%20is%20part%20of%20the%20deployment%20is%20characterized%20through%20these%20parameters%2C%20this%20can%20also%20be%20the%20time%20to%20standardize%20and%20ensure%20the%20target-requirements%20are%20met.%3C%2FP%3E%0A%3CP%3EIn%20our%20scenario%2C%20we%20are%20moving%20from%20an%20ASDK%20(which%20is%20an%20isolated%20environment%20with%20certain%20restrictions)%20to%20a%20Azure%20Stack%20Hub%20Integrated%20System.%20Following%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-stack%2Fuser%2Fazure-stack-network-howto-backup-replicator%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EReplicate%20resources%20using%20the%20Azure%20Stack%20Hub%20subscription%20replicator%3C%2FA%3E%20deployment%20steps%20you%20need%20to%20first%20deploy%20the%20Resource%20Group%20(RG)%20and%20then%20start%20the%20actual%20deployment.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20do%2C%20you%E2%80%99ll%20notice%20all%20the%20previous%20resources%20start%20to%20be%20deployed%20in%20their%20respective%20dependency%20order%3A%20first%20the%20things%20like%20virtual%20networks%2C%20public%20IPs%2C%20storage%20accounts%2C%20NSGs%2C%20and%20then%20the%20VMs%20themselves%20(which%20take%20a%20dependency%20on%20all%20the%20others).%3C%2FP%3E%0A%3CP%3EIn%20my%20case%2C%20the%20first%20time%20running%20the%20script%2C%20the%20VM%20creation%20failed%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_10-1586230997667.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182649iC1E5E37718EC5A74%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_10-1586230997667.png%22%20alt%3D%22rctibi_10-1586230997667.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20can%20see%2C%20the%20first%20resources%20were%20successfully%20deployed%2C%20but%20not%20the%20VMs%20themselves.%20A%20quick%20check%20on%20the%20deployment%20revealed%20the%20issue%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_11-1586230997678.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182648i3D310498D2461EA5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_11-1586230997678.png%22%20alt%3D%22rctibi_11-1586230997678.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EChecking%20the%20parameters%20file%20showed%20that%20the%20script%20expected%20a%20different%20region%20for%20that%20storage%20account%20%E2%80%93%20this%20type%20of%20%E2%80%9Cazurestack.external%E2%80%9D%20is%20specific%20to%20the%20ASDK%20and%20not%20something%20you%20would%20see%20on%20an%20Azure%20Stack%20Hub%20Integrated%20System%2C%20where%20this%20is%20replaced%20by%20an%20FQDN%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_12-1586230997691.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182650i9F73AD74101A5D06%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_12-1586230997691.png%22%20alt%3D%22rctibi_12-1586230997691.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESince%20this%20storage%20account%20is%20used%20for%20bootdiagnostics%20only%20(and%20common%20to%20all%203%20VMs)%2C%20a%20quick%20change%20in%20the%203%20parameter%20files%20(for%20each%20of%20the%20VMs)%20quickly%20got%20the%20deployment%20back%20on%20track%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_13-1586230997702.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182651i03D39A8DCC588ADF%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_13-1586230997702.png%22%20alt%3D%22rctibi_13-1586230997702.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1827577071%22%20id%3D%22toc-hId--1827577071%22%3EMoving%20the%20data%3C%2FH2%3E%0A%3CP%3EThe%20steps%20above%20would%20create%20the%20ARM%20resources%20(vnets%2C%20NSGs%2C%20VMs%2C%20storage%20accounts%2C%20etc)%20but%20not%20the%20actual%20data%20that%20would%20live%20in%20those%20storage%20accounts%2C%20or%20the%20data%20inside%20the%20VMs%20themselves.%20For%20this%20you%20would%20either%20need%20to%20rely%20on%20a%203%3CSUP%3Erd%3C%2FSUP%3E%20party%20backup-recovery%20partner%20(%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fazure-stack-laas-part-two%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fazure-stack-laas-part-two%2F%3C%2FA%3E)%2C%20or%20even%20to%20copy%20the%20VHD%20from%20the%20source.%3C%2FP%3E%0A%3CP%3EIn%20our%20current%20scenario%2C%20it%E2%80%99s%20not%20an%20issue%20to%20turn%20off%20the%20VM%20and%20export%20the%20Disk%3A%3C%2FP%3E%0A%3CP%3ENote%3A%20Since%20the%20source%20VM%20uses%20a%20Managed%20Disk%2C%20you%20will%20first%20need%20to%20export%20this%20disk%20to%20a%20VHD%20and%20then%20copy%20it%20(%20process%20is%20similar%20with%20the%20one%20used%20in%20Azure%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fscripts%2Fvirtual-machines-windows-powershell-sample-copy-managed-disks-vhd%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eexport%2Fcopy%20the%20VHDs%20across%20different%20regions%3C%2FA%3E)%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_14-1586230997718.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182652i9D29293B69FDEC7B%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_14-1586230997718.png%22%20alt%3D%22rctibi_14-1586230997718.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20copied%2C%20the%20VHD%20needs%20to%20be%20uploaded%20on%20the%20Azure%20Stack%20Hub%20Integrated%20System%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_15-1586230997723.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182653i778346FAEE071DD5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_15-1586230997723.png%22%20alt%3D%22rctibi_15-1586230997723.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20this%20system%2C%20we%E2%80%99ve%20already%20run%20the%20%E2%80%9CDeployResources.ps1%E2%80%9D%20as%20part%20of%20our%20deployment%2C%20which%20means%20all%20the%20VMs%20have%20been%20deployed.%3C%2FP%3E%0A%3CP%3EOne%20option%20would%20be%20to%20remove%20everything%20and%20deploy%20them%20again%20using%20the%20same%20scripts%2C%20but%20since%20the%20generated%20ARM%20templates%20have%20an%20incremental%20deployment%2C%20deleting%20just%20the%20VM%20itself%20and%20changing%20the%20ARM%20template%20would%20also%20work%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_16-1586230997733.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182654i77BB433BB8DC4F4C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_16-1586230997733.png%22%20alt%3D%22rctibi_16-1586230997733.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20ARM%20template%20used%20to%20create%20the%20VM%20(in%20this%20case%20found%20in%20the%20%E2%80%9CStandardized_ARM_Templates%5CCustom_ARM_Templates%5CvirtualMachines_VM1_ARM_Template_RG-POC1.json%E2%80%9D%20file)%20will%20use%20an%20image%20available%20in%20the%20Azure%20stack%20Marketplace%20(in%20this%20case%20would%20be%20a%20new%20Windows%20Server%202019%20server).%20To%20change%20this%20template%2C%20we%E2%80%99ll%20need%20to%20remove%20the%20parts%20that%20refer%20to%20this%20marketplace%20item%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_17-1586230997755.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182655i42BEB8CE5DE67B66%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_17-1586230997755.png%22%20alt%3D%22rctibi_17-1586230997755.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eand%20replace%20them%20with%20a%20new%20managed%20disk%20that%20is%20created%20from%20the%20existing%20vhd%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_18-1586230997762.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182656iB4C5AAEDD191B47E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_18-1586230997762.png%22%20alt%3D%22rctibi_18-1586230997762.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eand%20create%20the%20actual%20VM%20that%20will%20also%20take%20a%20dependency%20on%20that%20Managed%20Disk%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_19-1586230997781.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182658iDC762F141A2552F3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_19-1586230997781.png%22%20alt%3D%22rctibi_19-1586230997781.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%3A%20As%20you%20are%20building%20these%2C%20try%20to%20use%20parameters%20and%20ARM%20templates%20as%20much%20as%20possible.%20At%20first%2C%20it%20would%20be%20easier%20to%20go%20to%20the%20portal%20to%20change%20things%2C%20but%20having%20them%20as%20code%20will%20help%20drive%20the%20Infrastructure%20as%20Code%20practice.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20deploy%2C%20simply%20rerun%20the%20DeployResources.ps1%20using%20the%20same%20password%20for%20the%20Windows%20VMs%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_20-1586230997805.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182657i2D1C5A67C48905A2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_20-1586230997805.png%22%20alt%3D%22rctibi_20-1586230997805.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%E2%80%99ll%20notice%20from%20the%20deployments%20tab%2C%20most%20of%20the%20resources%20will%20not%20change%2C%20but%20the%20VM1%20will%20have%20an%20extra%20item%20created%20(the%20Managed%20Disk)%20and%20the%20VM%20will%20be%20created%20using%20that%20OS%20disk%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_21-1586230997815.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182659i04AA4B47A267DCE1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22rctibi_21-1586230997815.png%22%20alt%3D%22rctibi_21-1586230997815.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20the%20deployment%20completes%2C%20you%20will%20be%20able%20to%20login%20this%20VM%20using%20the%20initial%20user%20and%20password.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%3A%20Since%20the%20ASDK%20uses%20a%20specific%20set%20of%20%E2%80%9Cpublic%20IPs%E2%80%9D%20(which%20are%20NATed%20IPs%20by%20the%20ASDK)%2C%20the%20PublicIPs%20would%20change%20when%20the%20resources%20are%20created%2C%20but%20the%20PrivateIPs%20could%20be%20maintained%20if%20needed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20started%20on%20this%20Infrastructure%20as%20Code%20journey%2C%20all%20the%20servers%2C%20the%20networking%2C%20the%20storage%20accounts%2C%20every%20part%20of%20the%20infrastructure%20itself%20could%20be%20described%20as%20code.%20This%20could%20be%20included%20in%20a%20CI%2FCD%20pipeline%2C%20which%20would%20include%20tests%20%E2%80%93%20so%20when%20something%20changes%20(a%20VM%20is%20changed%2C%20or%20a%20new%20server%20added)%2C%20certain%20tests%20can%20be%20run%20to%20make%20sure%20things%20work%20as%20expected.%20The%20Infrastructure%20as%20Code%20process%20is%20a%20way%20of%20managing%20and%20provisioning%20resources%2C%20in%20a%20declarative%20way%2C%20taking%20advantage%20of%20the%20IaaS%20features%20exposed%20by%20Azure%20Stack%20Hub%20in%20a%20manner%20consistent%20with%20Azure%20operations.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1287120%22%20slang%3D%22en-US%22%3E%3CP%3ERegardless%20of%20your%20motivation%20to%20get%20started%20with%20Azure%20Stack%20Hub%20(regulatory%2C%20compliance%2C%20network%20requirements%2C%20backend%20systems)%2C%20every%20customer%20has%20their%20own%2C%20unique%20journey%20to%20the%20cloud.%20Now%20is%20the%20time%20to%20start%20framing%20that%20journey%20as%20a%20Infrastructure%20as%20Code%20one.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1287120%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Stack%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Einfrastructure%20as%20code%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

 

Azure Stack Hub lights up IaaS capabilities in your datacenter. These range from foundational concepts like enabling self-service, having a marketplace of items, or enabling RBAC (all of them concepts we’ve explored in the Azure Stack IaaS series) – all the way to enabling an Infrastructure as Code practice, or enabling hybrid applications.

 

Regardless of your motivation to get started with Azure Stack Hub (regulatory, compliance, network requirements, backend systems), every customer has their own, unique journey to the cloud. We’ve talked about how the journey could start with existing servers and have captured some of the lessons learned and questions that should be asked along the way (https://azure.microsoft.com/en-us/resources/migrate-to-azure-stack-hub-patterns-and-practices-checkl...).

Ideally, every cloud migration project would include all the scripts and templates required to have an Infrastructure as Code (IaC) approach. This would enable the management of infrastructure (networks, virtual machines, load balancers, and connection topology) in a descriptive model, using the same versioning  features as DevOps teams use for source code. It would take advantage of idempotency and enable DevOps teams to test applications early in the development cycle in production-like environments.

 

In reality though, most deployments on Azure Stack Hub will start with either small POCs, migrations of that one VM which I’ll-migrate-like-this-while-the-others-I’ll-do-properly which then turns into the migration process used for everything, or multiple lift-and-shift migrations moved “as they are” in the hopes that you will switch to a Infrastructure as Code later.

 

While it is easier to start with IaC from the start of the project, it’s never too late to take advantage of the IaaS capabilities exposed by Azure Stack Hub.

 

To facilitate this transition, we’ve came up with a series of scripts (under the name of “subscription replicator”) that will virtually read the resources in the current Azure Stack Hub user-subscription and recreate the ARM templates required to deploy these resources. This process applies only for the ARM-resources themselves (virtual networks, NSGs, VMs, RGs, etc), not the actual data that lives in the respective VMs or storage accounts.

 

We’ve used the initial process to replicate resources across multiple stamps – where customers wanted to change something in the original Azure Stack Hub stamp. The same process could however be used in a wider range of scenarios:

  • Moving from an ASDK (POC) environment to a production Azure Stack Hub
  • Updating ASDKs to a newer version, without losing everything created
  • Creating BCDR across multiple stamps
  • Even starting your journey towards an Infrastructure as Code approach.

Having the ARM templates required to deploy the resources, could be the starting point of building a DevOps practice, including CI/CD pipelines for your infrastructure, and building the next deployments using code.

 

The following example is based off a scenario where you’ve used an ASDK and built your solution. This could be a POC, or the start of a project where things were tested in the ASDK. When completed, you plan to move to an Azure Stack Integrated System, and are looking to start an IaC practice as well.

 

Source environment

In this example, the solution is comprised of:

rctibi_0-1586230997540.png

 

 

  • 3 Virtual Machines of different sizes, each with various NSGs and rules
  • One virtual network, which all these VMs are linked to
  • One storage account used to host the bootdiagnostics for the 3 VMs
  • Certain RBAC rules set for resources

All these resources were deployed as part of 3 different deployments

rctibi_1-1586230997552.png

 

This reflects many cases where the initial deployment is done through the portal, after that things are added, changed, adjusted, and stabilized.

 

The VMs have different sizes and could have various settings, numbers of disks, or even NICs attached to them:

 

rctibi_0-1586233060234.png

 

rctibi_1-1586233071406.png

 



The RBAC side has a few aspects to consider:

  • The users typically used in a PoC will be different to the ones in a Production – so when “moving” these resources you will need to convert the assignments accordingly
  • The RBAC custom roles will need to be populated respectively as well, since their membership will change, when migrating you need to take into account what happens to these roles
  • The RBAC itself isn’t part of the scripts automatically

The last part is due to complexities around the roles. We will not cover in this article ways for you to replicate the custom RBAC roles, but these can be used and adapted as needed on each Azure Stack Hub stamp.

In this case, I have created a new role called “Virtual Machine User Login” (which is the same as the Azure role with the same name – if you are looking for more info, check the links below):

rctibi_4-1586230997599.png

 

The role is assigned to a user at the RG level – remember that everything is deployed in a single RG in this case, so this user would have rights for all the VMs in this RGs.

 

Links

  • If you are looking to configure custom roles, a good starting point is this exercise from the operator guide workshop.
  • The https://github.com/Azure-Samples/Azure-Stack-Hub-Foundation-Core/ are a set of materials (PowerPoint presentations, workshops, and links to videos) aiming to provide Azure Stack Hub Operators the foundational materials required to ramp-up and understand the basics of operating Azure Stack Hub

 

Target environment

The target environment is an 8 node Azure Stack Hub Integrated System configured with Internet access. This isn’t required, as the Azure Stack Hub system could use “local” IP ranges (local for the respective Enterprise or Datacenter that it resides in), but in this case, it does enable certain features.

 

For example, the ASDK is placed in a different location to the Azure Stack Hub Integrated System. Access from the ASDK will be outbound only and we can access the target environment directly, even though it’s in a different location. Of course, networking needs to be taken into consideration whenever resources are moved across environments and adjustments need to be made accordingly.

 

rctibi_5-1586230997611.png

 

 

In the user-portal, we’ve already created a user subscription with sufficient quotas to support the resources we plan to move. In a real migration, this would need to be properly assessed and planned, in accordance to the capacity management plans for this Azure Stack Hub environment.

rctibi_6-1586230997621.png

 

This is needed before running the scripts, since the script will use the TenantID of the AAD used as well as the user SubscriptionID where the resources will be created. Both are needed during the deployment and the script will hydrate these when creating the ARM templates.

Note: Before starting the script, you should note the source and target tenantIDs and subscriptionIDs.

 

Moving the resources

ARM resources

The location of the scripts, process, and setting up the environments are described in the Replicate resources using the Azure Stack Hub subscription replicator. Completing the steps, will result in the creation of the parameter files as well as custom ARM templates where required:

rctibi_7-1586230997631.png

 

rctibi_8-1586230997640.png

 

 

These are important as they act as a “snapshot” in time of your deployment – meaning, if you were to use these and build ARM templates for every deployment moving forward, this would act as a “starting point” in your Infrastructure as Code journey.

The example given above is simple: a few virtual machines, a virtual network, and NSGs. Even so, you can notice how parameters include the IP settings of for each of those VMs, and how NSGs include the ports configured:

 

rctibi_9-1586230997653.png

 

 

You can easily image a complex scenario, where these have been vetted by the networking team, or are following certain design that is a standard in the company.

 

This can also be the moment where you adjust these settings to reflect the naming convention for your production environment, or configure certain ports required by other production applications. Since every ARM resource that is part of the deployment is characterized through these parameters, this can also be the time to standardize and ensure the target-requirements are met.

In our scenario, we are moving from an ASDK (which is an isolated environment with certain restrictions) to a Azure Stack Hub Integrated System. Following the Replicate resources using the Azure Stack Hub subscription replicator deployment steps you need to first deploy the Resource Group (RG) and then start the actual deployment.

 

As you do, you’ll notice all the previous resources start to be deployed in their respective dependency order: first the things like virtual networks, public IPs, storage accounts, NSGs, and then the VMs themselves (which take a dependency on all the others).

In my case, the first time running the script, the VM creation failed:

rctibi_10-1586230997667.png

 

As you can see, the first resources were successfully deployed, but not the VMs themselves. A quick check on the deployment revealed the issue

rctibi_11-1586230997678.png

 

Checking the parameters file showed that the script expected a different region for that storage account – this type of “azurestack.external” is specific to the ASDK and not something you would see on an Azure Stack Hub Integrated System, where this is replaced by an FQDN

rctibi_12-1586230997691.png

 

Since this storage account is used for bootdiagnostics only (and common to all 3 VMs), a quick change in the 3 parameter files (for each of the VMs) quickly got the deployment back on track:

rctibi_13-1586230997702.png

 

 

Moving the data

The steps above would create the ARM resources (vnets, NSGs, VMs, storage accounts, etc) but not the actual data that would live in those storage accounts, or the data inside the VMs themselves. For this you would either need to rely on a 3rd party backup-recovery partner (https://azure.microsoft.com/en-us/blog/azure-stack-laas-part-two/), or even to copy the VHD from the source.

In our current scenario, it’s not an issue to turn off the VM and export the Disk:

Note: Since the source VM uses a Managed Disk, you will first need to export this disk to a VHD and then copy it ( process is similar with the one used in Azure to export/copy the VHDs across different regions)

rctibi_14-1586230997718.png

 

Once copied, the VHD needs to be uploaded on the Azure Stack Hub Integrated System

rctibi_15-1586230997723.png

 

On this system, we’ve already run the “DeployResources.ps1” as part of our deployment, which means all the VMs have been deployed.

One option would be to remove everything and deploy them again using the same scripts, but since the generated ARM templates have an incremental deployment, deleting just the VM itself and changing the ARM template would also work:

rctibi_16-1586230997733.png

 

 

The ARM template used to create the VM (in this case found in the “Standardized_ARM_Templates\Custom_ARM_Templates\virtualMachines_VM1_ARM_Template_RG-POC1.json” file) will use an image available in the Azure stack Marketplace (in this case would be a new Windows Server 2019 server). To change this template, we’ll need to remove the parts that refer to this marketplace item:

rctibi_17-1586230997755.png

 

and replace them with a new managed disk that is created from the existing vhd

rctibi_18-1586230997762.png

 

and create the actual VM that will also take a dependency on that Managed Disk

rctibi_19-1586230997781.png

 

 

Note: As you are building these, try to use parameters and ARM templates as much as possible. At first, it would be easier to go to the portal to change things, but having them as code will help drive the Infrastructure as Code practice.

 

To deploy, simply rerun the DeployResources.ps1 using the same password for the Windows VMs:

rctibi_20-1586230997805.png

 

As you’ll notice from the deployments tab, most of the resources will not change, but the VM1 will have an extra item created (the Managed Disk) and the VM will be created using that OS disk:

rctibi_21-1586230997815.png

 

 

Once the deployment completes, you will be able to login this VM using the initial user and password.

 

Note: Since the ASDK uses a specific set of “public IPs” (which are NATed IPs by the ASDK), the PublicIPs would change when the resources are created, but the PrivateIPs could be maintained if needed.

 

Once started on this Infrastructure as Code journey, all the servers, the networking, the storage accounts, every part of the infrastructure itself could be described as code. This could be included in a CI/CD pipeline, which would include tests – so when something changes (a VM is changed, or a new server added), certain tests can be run to make sure things work as expected. The Infrastructure as Code process is a way of managing and provisioning resources, in a declarative way, taking advantage of the IaaS features exposed by Azure Stack Hub in a manner consistent with Azure operations.

3 Comments

Great Blogpost Tiberiu, Thanks for sharing with the community :cool:

New Contributor

Good stuff, very helpful!

Microsoft

Great post Tibi!