microsoft / azure-maven-plugins

Maven plugins for Azure
MIT License
272 stars 140 forks source link

functions plugin does not redeploy app #2414

Closed end-user closed 6 months ago

end-user commented 6 months ago

Plugin name and version

azure-functions-maven-plugin v1.29.0

Plugin configuration in your pom.xml

 <plugin>
                <groupId>com.microsoft.azure</groupId>
                <artifactId>azure-functions-maven-plugin</artifactId>
                <version>${azure.functions.maven.plugin.version}</version>
                <configuration>
                    <appName>${functionAppName}</appName>
                    <resourceGroup>${functionResourceGroup}</resourceGroup>
                    <region>${functionAppRegion}</region>
                    <appServicePlanName>${functionAppServicePlanName}</appServicePlanName>
                    <!--                    <pricingTier>${functionPricingTier}</pricingTier>-->
                    <hostJson>${project.basedir}/src/main/resources/host.json</hostJson>
                    <localSettingsJson>${project.basedir}/src/main/resources/local.settings.json</localSettingsJson>
                    <runtime>
                        <os>linux</os>
                        <javaVersion>${java.version}</javaVersion>
                    </runtime>
                    <appSettings>
                        <property>
                            <name>FUNCTIONS_EXTENSION_VERSION</name>
                            <value>~4</value>
                        </property>
                    </appSettings>
                </configuration>
                <executions>
                    <execution>
                        <id>package-functions</id>
                        <goals>
                            <goal>package</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Expected behavior

using mvn -DskipTests package azure-functions:deploy will push an updated version to existing Azure enironment

Actual behavior

errors out with 'Website with given name already exists.'

Steps to reproduce the problem

run the above command

wangmingliang-ms commented 6 months ago

did you change the value of functionResourceGroup and functionAppServicePlanName? please make sure all its parent "components"(subscription, resource group, service plan, region, etc.) are correct if you want to update an exiting app. it will try to create a new app otherwise.

end-user commented 6 months ago

Well, there's no configuration for subscription, and the name and resource groups are the only required values, but yes, I confirmed it's all named the same/correctly.

end-user commented 6 months ago

Nope; I discovered that it was indeed pushing to the wrong subscription. The plugin output does a good job of displaying that information, I just hadn't looked at it.