Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non production deployment slots are using the same storage resource as the production slot #2163

Open
adeabayyup opened this issue Nov 4, 2022 · 2 comments

Comments

@adeabayyup
Copy link

Plugin name and version

azure-functions-maven-plugin, version 1.21.0

Plugin configuration in pom.xml

<plugin>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-functions-maven-plugin</artifactId>
        <version>${azure.functions.maven.plugin.version}</version>
        <configuration>
          <resourceGroup>${functionResourceGroup}</resourceGroup>
          <appName>${functionAppName}</appName>
          <region>${functionAppRegion}</region>
          <authType>azure_cli</authType>
          <runtime>
            <os>windows</os>
            <javaVersion>11</javaVersion>
          </runtime>
          <deploymentSlot>
            <name>stage</name>            
          </deploymentSlot>
          <appSettings>
            <property>
              <name>FUNCTIONS_EXTENSION_VERSION</name>
              <value>~4</value>
            </property>
          </appSettings>
        </configuration>
</plugin>

Expected behavior

If you deploy to stage when the 'stage' deployment slot doesn't exist, it will create a new deployment slot named 'stage' and copy the configuration settings of parent (prod). It should not copy application settings like WEBSITE_CONTENTSHARE and should create new storage for the new deployment slot and rewrite slot specific settings accordingly.

Actual behavior

All the parent application settings are copied to deployment slot's settings including WEBSITE_CONTENTSHARE. As a result both slots are reading the code from the same storage and you're effectively overwriting production code when you deploy to stage slot. I'm getting an issue similar to this.

Steps to reproduce the problem

  • Deploy your app using ./mvnw clean package azure-functions:deploy
  • By default it will deploy to production slot and create additional resources
  • Add this to pom.xml file
      <deploymentSlot>
              <name>stage</name>            
      </deploymentSlot> 
  • Deploy again and view the application settings of the stage slot. It will be same as the parent.
@Flanker32
Copy link
Member

@AidenFawkes Thanks a lot for your report and really sorry for the late response. We are using run from package deployment by default, which deployment in slot should not affect product deployment. Could you please help share us a demo project to reproduce this issue if possible?

As a workaround, if you want to have fresh app settings for the slot, you may set <configurationSource> as new, however, you may need to specify all app settings/configuration manually for the new slot.

  <deploymentSlot>
          <name>new-slot</name>        
           <configurationSource>new</configurationSource>    
  </deploymentSlot> 

@adeabayyup
Copy link
Author

adeabayyup commented Dec 1, 2022

Could you please help share us a demo project to reproduce this issue if

@Flanker32 Thank you for responding. After creating the sample project I will reply to this thread

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

No branches or pull requests

2 participants