protected virtual string getResourceName(FathymResourceTypes resourceType, string desiredName) { string rscName = null; switch (resourceType) { case FathymResourceTypes.EventHub: case FathymResourceTypes.EventHubNamespace: case FathymResourceTypes.ApplicationInsights: case FathymResourceTypes.StreamAnalytics: case FathymResourceTypes.AppServicePlan: rscName = desiredName.ToLower(); break; case FathymResourceTypes.ClassicStorage: case FathymResourceTypes.DataLakeAnalytics: case FathymResourceTypes.DataLakeStore: case FathymResourceTypes.IotHub: case FathymResourceTypes.CosmosDB: case FathymResourceTypes.ServiceBusNamespace: case FathymResourceTypes.StorageAccount: default: rscName = desiredName.Replace("-", "").ToLower(); break; } return(rscName); }
protected virtual string getLocation(FathymResourceTypes resourceType, LocationZones desiredLocation) { switch (resourceType) { case FathymResourceTypes.ApplicationInsights: return(getLocation(LocationZones.USEast)); case FathymResourceTypes.DataLakeAnalytics: case FathymResourceTypes.DataLakeStore: return(getLocation(LocationZones.USCentral)); default: return(getLocation(desiredLocation)); } }
public virtual ResourceConfigurationResponse LoadResourceConfiguration(FathymResourceTypes resourceType, string clientName, string clientLookup, ProvisioningEnvironment environment, LocationZones desiredLocation, string clientFlowName, string clientFlowLookup, string uniqueLookup) { var resGrp = $"{ApplicationLookup}-{clientLookup}-{clientFlowLookup}-{environment}"; var resName = resGrp.Replace("-", ""); if (!uniqueLookup.IsNullOrEmpty()) { resName += $"{uniqueLookup}"; } resName = getResourceName(resourceType, resName); return(new ResourceConfigurationResponse() { ResourceGroupName = resGrp, ResourceName = resName, Tags = getTags(clientName, environment, clientFlowName), Location = getLocation(resourceType, desiredLocation), Status = Status.Success }); }