Giter VIP home page Giter VIP logo

Comments (5)

PramodValavala-MSFT avatar PramodValavala-MSFT commented on May 14, 2024 1

There was a similar request at MicrosoftDocs/azure-docs#19298 for which I found that there is a provision to use an existing App Service Plan by setting this configuration to the maven plugin as mentioned in the README

<appServicePlanName>${functionAppServicePlanName}</appServicePlanName>

assuming a property with the same name is defined in pom.xml

Currently, the code at this line creates a new app service plan if the above configuration is not set.
But if it is set, it tries to use an existing plan without really checking if it exists.

Unfortunately, looking at the Java SDK, the functions / appservice implementation doesn't allow for passing a name when creating the app service plan but is possible in general as evident from this code.

On the bright side, storage account does seem to be possible as available here for new storage accounts with name and also existing ones.

from azure-maven-plugins.

jdneo avatar jdneo commented on May 14, 2024

Yes, I agree that with standard naming scheme, user can easily guess it in advance. But it will also increase the posibility of creation failure because of the duplicated dns name. Could you please help describe more about the usage scenario?

@hexiaokai What do you think about this?

from azure-maven-plugins.

JonathanGiles avatar JonathanGiles commented on May 14, 2024

I thought there might be a concern about naming collisions. Is it possible for you to query if the name exists, and if it does create the service with a -1, -2, etc?

from azure-maven-plugins.

jdneo avatar jdneo commented on May 14, 2024

Emm, in the plugin code, we pass the app name to the Azure ava SDK to provision the resource:

https://github.com/Microsoft/azure-maven-plugins/blob/master/azure-functions-maven-plugin/src/main/java/com/microsoft/azure/maven/function/DeployMojo.java#L146

I'm not sure if it is possible to specify the appservice plan name now in the Azure Java SDK.

from azure-maven-plugins.

PramodValavala-MSFT avatar PramodValavala-MSFT commented on May 14, 2024

Here is a workaround for this until its officially supported

As a workaround, you could use the maven plugin just for building and then use func to deploy.

I assume you've already created a function app as documented in the Azure CLI Quickstart.

  1. Build the app
mvn clean package
  1. Use func to publish
# Change to the staging directory
cd target/azure-functions/<appName>
# Would be something like this - cd target/azure-functions/<artifactId>-20190506045816127

# Deploy using func
func azure functionapp <FunctionAppName>

from azure-maven-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.