Cannot reuse the automation account for Strat-Stop off hours VMs.

%3CLINGO-SUB%20id%3D%22lingo-sub-2321610%22%20slang%3D%22en-US%22%3ECannot%20reuse%20the%20automation%20account%20for%20Strat-Stop%20off%20hours%20VMs.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2321610%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20having%20an%20issue%20when%20I%20am%20starting%20to%20use%20the%20Azure%20Automation%20account%20to%20create%20Azure%20VMs%20off-hours%20Turnoff.%20Getting%20this%20error%20while%20setting%20this%20up.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22The%20resource%20'resource'%20already%20exists%20in%20location%20'eastus'%20in%20resource%20group%20'RG'.%20A%20resource%20with%20the%20same%20name%20cannot%20be%20created%20in%20location%20'eastus2'.%20Please%20select%20a%20new%20resource%20name.%20When%20creating%20a%20Start%20and%20Stop%20solution.%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2321610%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EVirtual%20Machine%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2333162%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20reuse%20the%20automation%20account%20for%20Strat-Stop%20off%20hours%20VMs.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2333162%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F397415%22%20target%3D%22_blank%22%3E%40harshvir%3C%2FA%3E%2C%26nbsp%3Byou%20cannot%20have%20two%20resources%20of%20the%20same%20type%2Bname%20in%20the%20same%20resource%20group.%20This%20is%20an%20Azure%20Resource%20Manager%20limitation%20coming%20from%20its%20resource%20ID%20scheme%20but%20it%20is%20also%20a%20good%20practice%20to%20avoid%20naming%20duplicates.%20Why%20would%20you%20want%20to%20have%20two%20resources%20with%20the%20same%20name%3F%20More%20details%20about%20Azure%20naming%20convention%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcloud-adoption-framework%2Fready%2Fazure-best-practices%2Fresource-naming%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDefine%20your%20naming%20convention%20-%20Cloud%20Adoption%20Framework%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello,

 

I am having an issue when I am starting to use the Azure Automation account to create Azure VMs off-hours Turnoff. Getting this error while setting this up. 

 

"The resource 'resource' already exists in location 'eastus' in resource group 'RG'. A resource with the same name cannot be created in location 'eastus2'. Please select a new resource name. When creating a Start and Stop solution."

2 Replies

@harshvir, you cannot have two resources of the same type+name in the same resource group. This is an Azure Resource Manager limitation coming from its resource ID scheme but it is also a good practice to avoid naming duplicates. Why would you want to have two resources with the same name? More details about Azure naming convention:

 

Define your naming convention - Cloud Adoption Framework | Microsoft Docs

Thanks, @hspinto,

Actually, we have issues with the Azure Automation RunAs account. I have an idea about the naming convention but when we trying to set up Start/Stop solution for the VMs the Log Analytic workspace needed the RunAs account. By default the RunAs account set as the Azure Automation Account name. That is the reason I get this error. As per the MS it is set up like that way. They have been notified the Product team seems to be a bug in Start/Stop process. We are now waiting on the MS reply on this. Whatever the solution MS is suggest I will share with you.