rapid-motherboard-85863
02/08/2023, 2:40 PMbillowy-army-68599
02/08/2023, 3:44 PMrapid-motherboard-85863
02/08/2023, 3:51 PMbillowy-army-68599
02/08/2023, 3:52 PMrapid-motherboard-85863
02/08/2023, 3:54 PMbillowy-army-68599
02/08/2023, 3:57 PMrapid-motherboard-85863
02/08/2023, 4:01 PMbillowy-army-68599
02/08/2023, 4:03 PMrapid-motherboard-85863
02/08/2023, 4:04 PMvar asp = appServicePlanModule.CreateResource();
billowy-army-68599
02/08/2023, 4:07 PMrapid-motherboard-85863
02/08/2023, 4:10 PMpublic Component CreateResource(CustomResource? parent = null, CustomResource? associatedResource = null, CustomResource? dependsOn = null, string index = "01")
{
var ai = new Component($"ai-{index}", new ComponentArgs
{
ApplicationType = ApplicationType.Web,
ResourceGroupName = _configOptions.ResourceGroupName,
Location = _configOptions.Location,
ResourceName = $"{_configOptions.ResourcePrefix}-ai-{_configOptions.EnvironmentIdentifier.ToLower()}-{_configOptions.ProjectIdentifier.ToLower()}-{index}",
Kind = "web"
});
return ai;
}
billowy-army-68599
02/08/2023, 4:13 PMComponent($"ai-{index}"
This is going to create the same resource name every time it’s invokved, you need to have something in there that invites randomness like a name
property you can passrapid-motherboard-85863
02/08/2023, 4:13 PMbillowy-army-68599
02/08/2023, 4:26 PMindex = "01"
and then invoking like so appServicePlanModule.CreateResource()
isn’t that setting the index as 1 every time?rapid-motherboard-85863
02/08/2023, 4:27 PMbillowy-army-68599
02/08/2023, 4:29 PMrapid-motherboard-85863
02/08/2023, 4:31 PM