Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Wrong resource name for appServicePlan and functionApp #292

Closed
stelone opened this issue Aug 30, 2019 · 1 comment
Closed

Wrong resource name for appServicePlan and functionApp #292

stelone opened this issue Aug 30, 2019 · 1 comment

Comments

@stelone
Copy link
Contributor

stelone commented Aug 30, 2019

When the "name" of appServicePlan and functionApp is filled in the template, the resource created or updated have the wrong name.

The serverless template look like this :

service: dtp-dev-project-api
provider:
  name: azure
  runtime: nodejs8.11.1
  region: francecentral
  resourceGroup: pet-store-rg
  functionApp: 
    name: pet-store-api
  appServicePlan: 
    name: pet-store-plan
  appInsights: 
    name: pet-store-insights
  storageAccount: 
    name: pet-store-sa

The resource take appInsights name.

I identify in the folder armTemplates the cause :

AppServicePlanResource.ts :

export class AppServicePlanResource implements ArmResourceTemplateGenerator {
    public static getResourceName(config: ServerlessAzureConfig) {
      return AzureNamingService.getResourceName(config, config.provider.**appInsights**, "asp");
    }

FunctionAppResource.ts :

export class FunctionAppResource implements ArmResourceTemplateGenerator {
  public static getResourceName(config: ServerlessAzureConfig) {
    const safeServiceName = config.service.replace(/\s/g, "-");
    return AzureNamingService.getResourceName(config, config.provider.**appInsights**, safeServiceName);
  }
@tbarlow12
Copy link
Contributor

@stelone thank you for the issue & PR. The new beta should be out shortly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants