简体   繁体   中英

mvn azure-functions:deploy not working with docker

I am able to deploy my azure function using mvn azure-function:deploy with os selected as linux .

But when I set the os as docker, with image on Azure Container Registry, there is no response from maven command. It neither throws an error nor does it deploy. It does not deploy the docker image

Here is my 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>${resourceGroup}</resourceGroup>
                <appServicePlanName>${appServicePlan}</appServicePlanName>
                <region>eastus</region>
                <runtime>
                    <os>docker</os>
                    <image>myappimages.azurecr.io/myapp:v0.0.5</image>
                    <serverId>SERVER_ID</serverId>
                    <registryUrl>myappimages.azurecr.io</registryUrl>
                </runtime>
                <appSettings>
                    <property>
                        <name>FUNCTIONS_EXTENSION_VERSION</name>
                        <value>~3</value>
                    </property>
                </appSettings>
            </configuration>
            <executions>
                <execution>
                    <id>package-functions</id>
                    <goals>
                        <goal>package</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

I then set the password for SERVER_ID in my ~/.m2/settings.xml :

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
     <server>
             <id>SERVER_ID</id>
                <username>myappimages</username>
                <password>xxxxxxxxxxxx</password>
      </server>
</servers>
</settings>

And finally when I deploy via mvn azure-function:deploy , this is the output:

[INFO] Updating target Function App myapp... 
[INFO] Set function worker runtime to java. [INFO] Successfully updated Function App myapp. 
[INFO] Skip deployment for docker app service [INFO]
[INFO] BUILD SUCCESS [INFO]
[INFO] Total time:  49.065 s [INFO] Finished at: 2022-02-09T23:08:40+05:30 [INFO]

I am not sure on what fixed it. Very likely upgrading to latest version looks like fixed it. I am able to deploy now via mvn.

    <azure.functions.maven.plugin.version>1.15.0</azure.functions.maven.plugin.version>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM