%3CLINGO-SUB%20id%3D%22lingo-sub-1634164%22%20slang%3D%22en-US%22%3EUse%20a%20Custom%20Automation%20Account%20for%20Azure%20to%20Azure%20Site%20Recovery%20Mobility%20Service%20Updates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1634164%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESr.%20Customer%20Engineer%20Dave%20Newman%20here%20on%20a%20short%20post%20regarding%20Azure%20Site%20Recovery.%20Hope%20this%20helps%20you%20in%20your%20day%20to%20day%20cloud%20journey%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20replicating%20Azure%20VMs%20from%20one%20Azure%20Region%20to%20another%20for%20DR%20purposes%2C%20the%20Mobility%20Service%20extension%20must%20be%20added%20to%20each%20protected%20VM.%20The%20extension%20installation%20is%20completed%20automatically%20during%20the%20%E2%80%9CEnable%20replication%E2%80%9D%20phase%20of%20protecting%20Azure%20VMs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPeriodically%2C%20the%20Azure%20Site%20Recovery%20(ASR)%20product%20group%20will%20release%20an%20Update%20rollup%20to%20include%20new%20features%2C%20component%20updates%2C%20support%20improvements%20and%20bug%20fixes.%20These%20are%20not%20always%20on%20a%20consistent%20cadence.%20Typically%2C%20there%20will%20be%20at%20least%20one%20each%20quarter%20but%20sometimes%2C%20the%20case%20of%20bug%20fixes%20there%20could%20be%20more%20than%20one.%20At%20the%20time%20of%20this%20writing%20there%20have%20been%208%20releases%20in%20the%20last%2012%20months.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20ASR%20product%20team%20has%20created%20an%20automated%20process%20that%20will%20update%20the%20Mobility%20service%20extension%20on%20Azure%20VMs%20that%20are%20being%20replicated.%20When%20you%20establish%20a%20new%20Recovery%20services%20vault%20in%20your%20target%20region%20and%20select%20VMs%20from%20the%20source%20region%20to%20protect%2C%20the%20process%20of%20creating%20new%20resources%20on%20the%20target%20side%20includes%20the%20creation%20of%20a%20new%20Azure%20automation%20account%20that%20will%20manage%20this%20process.%20When%20enabled%2C%20the%20management%20of%20the%20agent%20versions%20is%20handled%20by%20a%20global%20runbook.%20A%20job%20is%20created%20in%20that%20Automation%20account%20that%20will%20initialize%20daily%20at%20midnight%20to%20check%20for%20the%20presence%20of%20a%20new%20agent%20version.%20If%20none%20is%20found%2C%20then%20the%20job%20completes%20with%20no%20action.%20If%20a%20new%20version%20is%20found%2C%20the%20extension%20will%20be%20updated%20on%20the%20VMs%20via%20an%20Azure%20Automation%20runbook%20to%20bring%20the%20systems%20into%20compliance%20with%20that%20latest%20version.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20seems%20great%20but%20there%20are%20%3CSTRONG%3Ea%20few%20issues%3C%2FSTRONG%3E.%20The%20new%20Azure%20Automation%20account%20is%20automatically%20named%20and%20there%20is%20no%20option%20to%20specify%20what%20that%20name%20will%20be.%20This%20will%20%3CSTRONG%3Ebreak%20naming%20convention%3C%2FSTRONG%3E.%20Good%20governance%20rules%20in%20Azure%20dictate%20that%20wherever%20possible%20that%20a%20naming%20convention%20should%20be%20followed.%20The%20way%20the%20ASR%20automatically%20chooses%20a%20name%20is%20that%20it%20takes%20the%20first%208%20characters%20of%20the%20name%20of%20the%20Recovery%20service%20vault%2C%20appends%20a%20dash%20(hyphen)%20and%20%3CSTRONG%3Ethree%20random%20alphanumeric%20characters%3C%2FSTRONG%3E%20and%20then%20appends%20the%20string%20%E2%80%9C-asr-automationaccount%E2%80%9D.%3C%2FP%3E%0A%3CP%3EIf%20your%20vault%20is%20currently%20named%20%E2%80%9CAZWUSPRODRSV01%E2%80%9D%2C%20then%20the%20name%20of%20your%20automation%20account%20would%20look%20something%20like%20%E2%80%9CAZWUSPRO-%3CEM%3Ea1b%3C%2FEM%3E-asr-automationaccount%E2%80%9D.%20(the%20%E2%80%9C%3CEM%3Ea1b%3C%2FEM%3E%E2%80%9D%20character%20set%20will%20be%20a%20randomly%20chosen%20alphanumeric%20string.)%20Not%20a%20very%20governance%20compliant%20name.%3C%2FP%3E%0A%3CP%3EThe%20second%20issue%20is%20that%20when%20creating%20an%20Azure%20Automation%20account%2C%20the%20default%20process%20for%20authenticating%20action%20is%20to%20use%20a%20%E2%80%9CRunAs%20Account%E2%80%9D%20as%20defined%20in%20the%20Automation%20account.%20This%20account%20is%20an%20Azure%20AD%20Service%20Principal%20that%20is%20granted%20a%20Role%20Based%20Access%20Control%20(RBAC)%20role%20by%20the%20creation%20process.%20The%20granted%20role%20is%20Contributor%20at%20the%20Subscription%20level.%20That%20means%20that%20the%20person%20creating%20the%20Automation%20account%20needs%20to%20have%20rights%20in%20Azure%20AD%20to%20create%20Azure%20AD%20Service%20Principals%20%3CSTRONG%3Eand%20%3C%2FSTRONG%3Ehave%20Owner%20or%20User%20Access%20Admin%20RBAC%20role%20at%20the%20subscription%20level.%20Other%20than%20User%20Access%20Admin%2C%20you%20cannot%20assign%20roles%20with%20greater%20privilege%20than%20you%20have%20been%20granted.%20If%20you%20are%20on%20the%20DR%2FBackup%20team%20at%20your%20organization%2C%20you%20may%20not%20have%20those%20permissions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EThe%20question%20at%20hand%20is%2C%20how%20can%20you%20create%20a%20naming%20convention%20compliant%20Azure%20automation%20account%20and%20tell%20ASR%20to%20use%20that%20Automation%20account%20for%20the%20process%20of%20updating%20the%20Mobility%20service%20extension%20on%20protected%20Azure%20VMs%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%20one%20in%20this%20is%20to%20ensure%20that%20a%20naming%20convention%20compliant%20Azure%20automation%20account%20exists%20in%20the%20%3CSTRONG%3Esame%20location%20and%20resource%20group%20as%20your%20recovery%20services%20vault%20%3C%2FSTRONG%3Eon%20the%20target%20side.%20The%20creation%20of%20an%20Automation%20account%20often%20requires%20coordination%20between%20the%20Identity%20team%20and%20the%20Azure%20team.%20As%20mentioned%20previously%2C%20the%20person%20creating%20this%20Azure%20resource%20needs%20to%20have%20the%20Owner%20RBAC%20role%20defined%20at%20the%20Subscription%20level.%20%26nbsp%3BAs%20a%20person%20on%20the%20DR%2FBackup%20Team%20you%20may%20need%20to%20work%20with%20someone%20else%20who%20has%20the%20appropriate%20permissions%20to%20have%20this%20resource%20created.%20The%20creation%20of%20the%20Azure%20AD%20Service%20Principal%20account%20is%20something%20that%20could%20be%20achieved%20by%20temporarily%20granting%20the%20built-in%20Azure%20AD%20role%20of%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fusers-groups-roles%2Fdirectory-assign-admin-roles%23available-roles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EApplication%20Administrator%20or%20Application%20Developer%3C%2FA%3E%20to%20the%20user%20creating%20the%20Automation%20account.%20A%20tutorial%20for%20the%20creation%20of%20an%20Automation%20account%20can%20be%20found%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fautomation%2Fautomation-create-standalone-account%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20the%20Automation%20account%20exists%2C%20the%20recovery%20service%20vault%20in%20the%20target%20region%20needs%20to%20be%20configured%20to%20use%20that%20account.%20This%20can%20either%20be%20done%20at%20the%20instantiation%20of%20the%20vault%20or%20can%20be%20done%20to%20an%20existing%20vault.%20Both%20methods%20will%20be%20shown.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20building%20out%20your%20recovery%20services%20vault%20for%20the%20first%20time%20for%20Azure%20to%20Azure%20DR%20replication%2C%20you%20can%20follow%20the%20normal%20steps%20as%20outlined%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsite-recovery%2Fazure-to-azure-tutorial-enable-replication%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%20tutorial%3C%2FA%3E.%20Before%20you%20complete%20the%20tutorial%2C%20stop%20at%20the%20end%20of%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsite-recovery%2Fazure-to-azure-tutorial-enable-replication%23configure-replication-settings%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EConfigure%20replication%20settings%3C%2FA%3E%20section.%20Do%20not%20click%20the%20%3CSTRONG%3ECreate%20target%20resources%3C%2FSTRONG%3E%20button%20just%20yet.%20The%20tutorial%20shows%20how%20you%20can%20customize%20the%20process%20so%20that%20you%20can%20use%20naming%20convention%20conforming%20target%20objects.%20There%20is%20another%20option%20visible%20on%20that%20blade%20that%20the%20tutorial%20does%20not%20cover.%20At%20the%20bottom%20of%20the%20blade%20there%20is%20an%20option%20for%20Extension%20settings%20with%20a%20%3CFONT%20color%3D%22%233366FF%22%3E%5B%2B%5D%20Show%20details%3C%2FFONT%3E%20link.%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-center%22%20image-alt%3D%22configuresettings.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216487i3E8E5F96F20CFE1A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22configuresettings.jpg%22%20alt%3D%22configuresettings.jpg%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%20it%20indicates%20that%20extension%20updates%20are%20being%20managed%20for%20you.%20But%20this%20is%20where%20it%20wants%20to%20do%20the%20collection%20of%20actions%20as%20mentioned%20earlier%20in%20this%20document%20that%20might%20fail%20because%20of%20permissions.%20If%20you%20open%20the%20Extension%20settings%2C%20you%20will%20see%20that%20there%20are%20a%20few%20options.%20You%20have%20the%20option%20to%20turn%20the%20process%20off%20and%20manage%20updates%20manually%20if%20you%20wish.%20This%20avoids%20the%20need%20for%20an%20Automation%20account%20but%20adds%20the%20manual%20effort%20of%20keeping%20the%20VMs%20updated%20as%20new%20versions%20become%20available.%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%22extensionsettings.jpg%22%20style%3D%22width%3A%20575px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216488i0AEECB445366A946%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22extensionsettings.jpg%22%20alt%3D%22extensionsettings.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20other%20box%20allows%20you%20to%20choose%20a%20specific%2C%20pre-existing%2C%20naming%20convention%20compliant%20Automation%20account.%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-center%22%20image-alt%3D%22automationaccount.jpg%22%20style%3D%22width%3A%20455px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216489iC636626F129E5E3A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22automationaccount.jpg%22%20alt%3D%22automationaccount.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20this%20has%20been%20defined%20you%20can%20Create%20target%20resources%20and%20the%20system%20will%20not%20attempt%20to%20create%20resources%20that%20do%20not%20line%20up%20with%20your%20well-defined%20Azure%20governance.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20already%20configured%20replication%20for%20VMs%20and%20have%20seen%20the%20process%20of%20creating%20that%20Automation%20account%20fail%20because%20of%20lack%20of%20permissions%2C%20we%20will%20now%20show%20how%20to%20resolve%20that%20issue.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20an%20%3CSTRONG%3Eexisting%20recovery%20services%20vault%3C%2FSTRONG%3E%20that%20you%20want%20to%20either%20establish%20or%20reconfigure%2C%20you%20will%20need%20to%20navigate%20to%20the%20Manage%20section%20in%20the%20left%20side%20menu%20of%20your%20vault%20and%20choose%20the%20Site%20Recovery%20infrastructure%20option.%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-center%22%20image-alt%3D%22asrinfra.jpg%22%20style%3D%22width%3A%20249px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216490i9FE1E5E888D07231%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22asrinfra.jpg%22%20alt%3D%22asrinfra.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFrom%20the%20Site%20Recovery%20infrastructure%20blade%2C%20choose%20Extension%20update%20settings.%20This%20allows%20you%20to%20toggle%20on%20and%20off%20the%20automatic%20management%20of%20the%20extension%20updates.%20It%20also%20indicates%20the%20name%20of%20the%20Automation%20account%20being%20used%20if%20this%20function%20is%20turned%20on.%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-center%22%20image-alt%3D%22extensionupdate.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216493i8B16DD521C8FE497%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22extensionupdate.jpg%22%20alt%3D%22extensionupdate.jpg%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%3EIf%20the%20toggle%20is%20set%20to%20off%20because%20the%20automation%20account%20failed%20to%20create%2C%20and%20%3CSTRONG%3Eif%20a%20new%20automation%20account%20has%20already%20been%20created%20and%20is%20available%20in%20the%20same%20resource%20group%20and%20in%20the%20same%20Azure%20location%20as%20the%20vault%3C%2FSTRONG%3E%2C%20that%20automation%20account%20will%20display%20as%20the%20account%20the%20system%20wants%20to%20use.%20If%20that%20is%20the%20case%2C%20then%20all%20you%20need%20to%20do%20to%20resolve%20this%20issue%20is%20to%20flip%20this%20switch%20to%20On.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EThis%20document%20has%20shown%20how%20can%20you%20create%20a%20naming%20convention%20compliant%20Azure%20automation%20account%20and%20tell%20ASR%20to%20use%20that%20Automation%20account%20for%20the%20process%20of%20updating%20the%20Mobility%20service%20extension%20on%20protected%20Azure%20VMs.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20ask%20that%20I%20have%20heard%20many%20times%20on%20this%20issue%20up%20updating%20ASR%20is%20%E2%80%93%20can%20I%20do%20this%20for%20my%20on-premises%20to%20Azure%20VMware%20systems%20that%20have%20the%20Mobility%20Service%20agent%20installed.%20The%20short%20answer%20is%20that%20there%20is%20no%20automated%20process%20available%20from%20the%20ASR%20product%20team%20currently%2C%20but%20it%20is%20something%20on%20the%20product%20roadmap.%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Fsmile_40x40.gif%22%20alt%3D%22%3Asmile%3A%22%20title%3D%22%3Asmile%3A%22%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHope%20this%20helps%20you%20in%20your%20cloud%20journey%20for%20protecting%20your%20Azure%20VMs.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1634164%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22asrlogo.jpg%22%20style%3D%22width%3A%20562px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216499iBE4356415253760D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22asrlogo.jpg%22%20alt%3D%22asrlogo.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAzure%20Site%20Recovery%20is%20a%20great%20tool%20but%20sometimes%20the%20system%20makes%20decisions%20for%20you%20that%20may%20not%20match%20with%20your%20corporate%20governance%20plans.%20This%20blog%20outlines%20how%20to%20resolve%20one%20of%20those%20issues%20in%20regards%20to%20an%20automation%20account%20used%20for%20Mobility%20Agent%20updates.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1634164%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDaveNewman%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1643442%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20a%20Custom%20Automation%20Account%20for%20Azure%20to%20Azure%20Site%20Recovery%20Mobility%20Service%20Updates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1643442%22%20slang%3D%22en-US%22%3E%3CP%3EGood%20Info!%20Is%20there%20a%20way%20to%20manage%20multiple%20vaults%20with%20a%20single%20automation%20account%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1644748%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20a%20Custom%20Automation%20Account%20for%20Azure%20to%20Azure%20Site%20Recovery%20Mobility%20Service%20Updates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1644748%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F719681%22%20target%3D%22_blank%22%3E%40cgoenka%3C%2FA%3E%26nbsp%3B%26nbsp%3BThere%20is%20a%20requirement%20that%20the%20automation%20account%20be%20in%20the%20same%20region%20and%20resource%20group%20as%20the%20vault.%20If%20you%20have%20multiple%20vaults%20in%20the%20same%20region%20and%20in%20the%20same%20resource%20group%20then%20this%20could%20be%20possible%20but%20usually%20the%20need%20for%20multiple%20vaults%20is%20related%20to%20being%20in%20different%20regions.%20I%20have%20not%20tested%20this%20but%20it%20should%20work.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1651511%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20a%20Custom%20Automation%20Account%20for%20Azure%20to%20Azure%20Site%20Recovery%20Mobility%20Service%20Updates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1651511%22%20slang%3D%22en-US%22%3E%3CP%3EDave%2C%20I%20am%20currently%20working%20in%20an%20environment%20that%20requires%20the%20strictest%20least-privilege%20for%20that%20automation%20account.%3C%2FP%3E%3CP%3EIs%20there%20a%20reference%20on%20the%20minimum%20required%20Roles%20for%20the%20ASR%20update%20automation%20account%20Run-as%20account%3F%26nbsp%3B%20Many%20thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E

 

Sr. Customer Engineer Dave Newman here on a short post regarding Azure Site Recovery. Hope this helps you in your day to day cloud journey

 

When replicating Azure VMs from one Azure Region to another for DR purposes, the Mobility Service extension must be added to each protected VM. The extension installation is completed automatically during the “Enable replication” phase of protecting Azure VMs.

 

Periodically, the Azure Site Recovery (ASR) product group will release an Update rollup to include new features, component updates, support improvements and bug fixes. These are not always on a consistent cadence. Typically, there will be at least one each quarter but sometimes, the case of bug fixes there could be more than one. At the time of this writing there have been 8 releases in the last 12 months.

 

The ASR product team has created an automated process that will update the Mobility service extension on Azure VMs that are being replicated. When you establish a new Recovery services vault in your target region and select VMs from the source region to protect, the process of creating new resources on the target side includes the creation of a new Azure automation account that will manage this process. When enabled, the management of the agent versions is handled by a global runbook. A job is created in that Automation account that will initialize daily at midnight to check for the presence of a new agent version. If none is found, then the job completes with no action. If a new version is found, the extension will be updated on the VMs via an Azure Automation runbook to bring the systems into compliance with that latest version.

 

This seems great but there are a few issues. The new Azure Automation account is automatically named and there is no option to specify what that name will be. This will break naming convention. Good governance rules in Azure dictate that wherever possible that a naming convention should be followed. The way the ASR automatically chooses a name is that it takes the first 8 characters of the name of the Recovery service vault, appends a dash (hyphen) and three random alphanumeric characters and then appends the string “-asr-automationaccount”.

If your vault is currently named “AZWUSPRODRSV01”, then the name of your automation account would look something like “AZWUSPRO-a1b-asr-automationaccount”. (the “a1b” character set will be a randomly chosen alphanumeric string.) Not a very governance compliant name.

The second issue is that when creating an Azure Automation account, the default process for authenticating action is to use a “RunAs Account” as defined in the Automation account. This account is an Azure AD Service Principal that is granted a Role Based Access Control (RBAC) role by the creation process. The granted role is Contributor at the Subscription level. That means that the person creating the Automation account needs to have rights in Azure AD to create Azure AD Service Principals and have Owner or User Access Admin RBAC role at the subscription level. Other than User Access Admin, you cannot assign roles with greater privilege than you have been granted. If you are on the DR/Backup team at your organization, you may not have those permissions.

 

The question at hand is, how can you create a naming convention compliant Azure automation account and tell ASR to use that Automation account for the process of updating the Mobility service extension on protected Azure VMs?

 

Step one in this is to ensure that a naming convention compliant Azure automation account exists in the same location and resource group as your recovery services vault on the target side. The creation of an Automation account often requires coordination between the Identity team and the Azure team. As mentioned previously, the person creating this Azure resource needs to have the Owner RBAC role defined at the Subscription level.  As a person on the DR/Backup Team you may need to work with someone else who has the appropriate permissions to have this resource created. The creation of the Azure AD Service Principal account is something that could be achieved by temporarily granting the built-in Azure AD role of Application Administrator or Application Developer to the user creating the Automation account. A tutorial for the creation of an Automation account can be found here.

 

Once the Automation account exists, the recovery service vault in the target region needs to be configured to use that account. This can either be done at the instantiation of the vault or can be done to an existing vault. Both methods will be shown.

 

If you are building out your recovery services vault for the first time for Azure to Azure DR replication, you can follow the normal steps as outlined in this tutorial. Before you complete the tutorial, stop at the end of the Configure replication settings section. Do not click the Create target resources button just yet. The tutorial shows how you can customize the process so that you can use naming convention conforming target objects. There is another option visible on that blade that the tutorial does not cover. At the bottom of the blade there is an option for Extension settings with a [+] Show details link.

 

configuresettings.jpg

 

As you can see, it indicates that extension updates are being managed for you. But this is where it wants to do the collection of actions as mentioned earlier in this document that might fail because of permissions. If you open the Extension settings, you will see that there are a few options. You have the option to turn the process off and manage updates manually if you wish. This avoids the need for an Automation account but adds the manual effort of keeping the VMs updated as new versions become available.

 

extensionsettings.jpg

 

The other box allows you to choose a specific, pre-existing, naming convention compliant Automation account.

 

automationaccount.jpg

 

Once this has been defined you can Create target resources and the system will not attempt to create resources that do not line up with your well-defined Azure governance.

 

If you have already configured replication for VMs and have seen the process of creating that Automation account fail because of lack of permissions, we will now show how to resolve that issue.

 

For an existing recovery services vault that you want to either establish or reconfigure, you will need to navigate to the Manage section in the left side menu of your vault and choose the Site Recovery infrastructure option.

 

asrinfra.jpg

 

From the Site Recovery infrastructure blade, choose Extension update settings. This allows you to toggle on and off the automatic management of the extension updates. It also indicates the name of the Automation account being used if this function is turned on.

 

extensionupdate.jpg

 

 

If the toggle is set to off because the automation account failed to create, and if a new automation account has already been created and is available in the same resource group and in the same Azure location as the vault, that automation account will display as the account the system wants to use. If that is the case, then all you need to do to resolve this issue is to flip this switch to On.

This document has shown how can you create a naming convention compliant Azure automation account and tell ASR to use that Automation account for the process of updating the Mobility service extension on protected Azure VMs.

 

The ask that I have heard many times on this issue up updating ASR is – can I do this for my on-premises to Azure VMware systems that have the Mobility Service agent installed. The short answer is that there is no automated process available from the ASR product team currently, but it is something on the product roadmap. :smile:

 

Hope this helps you in your cloud journey for protecting your Azure VMs. 

 

 

 

6 Comments
Occasional Visitor

Good Info! Is there a way to manage multiple vaults with a single automation account?

@cgoenka  There is a requirement that the automation account be in the same region and resource group as the vault. If you have multiple vaults in the same region and in the same resource group then this could be possible but usually the need for multiple vaults is related to being in different regions. I have not tested this but it should work. 

Senior Member

Dave, I am currently working in an environment that requires the strictest least-privilege for that automation account.

Is there a reference on the minimum required Roles for the ASR update automation account Run-as account?  Many thanks!

@mikewo-dc  - sorry for the late reply. 

https://docs.microsoft.com/en-us/azure/automation/manage-runas-account#limit-run-as-account-permissi... 

This doc shows how to limit the permissions assigned to a RunAsAccount in Azure automation. There is a built-in RBAC role called Site Recovery Contributor which should provide you with the detailed list of permissions to choose from. 

https://docs.microsoft.com/en-us/azure/automation/manage-runas-account#limit-run-as-account-permissi...

 

Senior Member

Hi Dave not a problem at all, thanks for the reply. My colleague did find this page ( https://docs.microsoft.com/en-us/azure/site-recovery/site-recovery-role-based-linked-access-control  ) which describes all the permissions needed for Site Recovery management (e.g. Site Recovery Contributor) and also for enabling Virtual Machine replication (e.g. Virtual Machine Contributor is recommended). We guess the RunAsAccount that updates the SiteRecovery-Windows extension probably needs only a subset of these, but Site Recovery Contributor and Virtual Machine Contributor would seem to be sufficient?

@mikewo-dc  - yes - you would need the Site Recovery Contributor to make the change within ASR and the VM Contributor to trigger the extension update. I have not tested this but it should work that way.