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

Help for configuration in Kotlin DSL #68

Closed
abouquet opened this issue Sep 21, 2020 · 3 comments
Closed

Help for configuration in Kotlin DSL #68

abouquet opened this issue Sep 21, 2020 · 3 comments

Comments

@abouquet
Copy link

abouquet commented Sep 21, 2020

I would like to configure this plugin in a Kotlin DSL way.

It seems the proper way is doing this

plugins {
    kotlin("jvm")
    id("com.microsoft.azure.azurefunctions") version "1.4.0"
}

azurefunctions {
    //subscription = <redacted>
    resourceGroup = "azure-functions-beeobs-rg"
    appName = "azure-functions-beeobs"
    pricingTier = "Consumption"
    localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
    allowTelemetry = false

   // It seems I can't declare any nested properties there
    appSettings["foo"] = "bar"
    runtime.os = "linux"
    authentication.type = "azure_cli"
    deployment.type = "run_from_blob"
     */
}

But when I'm trying to run azureFunctionsRun gradle task, I get the following error

(...)\api\build.gradle.kts:70:5: Unresolved reference: appSettings

Got the same with runtime.os authentication.type and deployment.type

Can anyone point me the right way to configure it in kts ?

Sample project : azure-function-kts-issue-68.zip

Thanks

@andxu
Copy link
Contributor

andxu commented Sep 23, 2020

Hi @abouquet , thank you for using our gradle plugin, I looked your project and had no idea of solving the configuration issue which is related to gradle.kts, I am not familiar with kotlin, sorry. If you solve this problem out, I can put your sample configuration in github wiki page.

@abouquet
Copy link
Author

Thanks for your answer !

I'm still learning Kotlin and indeed it's maybe related to the way we have to set nested properties in .kts gradle files.
I've been struggling with it for several hours and can't spend more time on it atm.

I think for a workaround, I will stick to a groovy build.gradle and came back after if I find a good solution.

@andxu
Copy link
Contributor

andxu commented Sep 24, 2020

Close this issue since no action is needed.

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

No branches or pull requests

2 participants