{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/40857","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/40857/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/40857/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/40857/events","html_url":"https://github.com/ansible/ansible/issues/40857","id":327547546,"node_id":"MDU6SXNzdWUzMjc1NDc1NDY=","number":40857,"title":"Azure azure_rm_functionapp and FUNCTIONS_EXTENSION_VERSION","user":{"login":"vpopescu","id":7304633,"node_id":"MDQ6VXNlcjczMDQ2MzM=","avatar_url":"https://avatars1.githubusercontent.com/u/7304633?v=4","gravatar_id":"","url":"https://api.github.com/users/vpopescu","html_url":"https://github.com/vpopescu","followers_url":"https://api.github.com/users/vpopescu/followers","following_url":"https://api.github.com/users/vpopescu/following{/other_user}","gists_url":"https://api.github.com/users/vpopescu/gists{/gist_id}","starred_url":"https://api.github.com/users/vpopescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpopescu/subscriptions","organizations_url":"https://api.github.com/users/vpopescu/orgs","repos_url":"https://api.github.com/users/vpopescu/repos","events_url":"https://api.github.com/users/vpopescu/events{/privacy}","received_events_url":"https://api.github.com/users/vpopescu/received_events","type":"User","site_admin":false},"labels":[{"id":686214011,"node_id":"MDU6TGFiZWw2ODYyMTQwMTE=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.5","name":"affects_2.5","color":"ededed","default":false},{"id":379680468,"node_id":"MDU6TGFiZWwzNzk2ODA0Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/azure","name":"azure","color":"c5def5","default":false},{"id":785271699,"node_id":"MDU6TGFiZWw3ODUyNzE2OTk=","url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":61528803,"node_id":"MDU6TGFiZWw2MTUyODgwMw==","url":"https://api.github.com/repos/ansible/ansible/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":852590921,"node_id":"MDU6TGFiZWw4NTI1OTA5MjE=","url":"https://api.github.com/repos/ansible/ansible/labels/feature","name":"feature","color":"006b75","default":false},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":636327968,"node_id":"MDU6TGFiZWw2MzYzMjc5Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"zikalino","id":11562540,"node_id":"MDQ6VXNlcjExNTYyNTQw","avatar_url":"https://avatars1.githubusercontent.com/u/11562540?v=4","gravatar_id":"","url":"https://api.github.com/users/zikalino","html_url":"https://github.com/zikalino","followers_url":"https://api.github.com/users/zikalino/followers","following_url":"https://api.github.com/users/zikalino/following{/other_user}","gists_url":"https://api.github.com/users/zikalino/gists{/gist_id}","starred_url":"https://api.github.com/users/zikalino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zikalino/subscriptions","organizations_url":"https://api.github.com/users/zikalino/orgs","repos_url":"https://api.github.com/users/zikalino/repos","events_url":"https://api.github.com/users/zikalino/events{/privacy}","received_events_url":"https://api.github.com/users/zikalino/received_events","type":"User","site_admin":false},"assignees":[{"login":"zikalino","id":11562540,"node_id":"MDQ6VXNlcjExNTYyNTQw","avatar_url":"https://avatars1.githubusercontent.com/u/11562540?v=4","gravatar_id":"","url":"https://api.github.com/users/zikalino","html_url":"https://github.com/zikalino","followers_url":"https://api.github.com/users/zikalino/followers","following_url":"https://api.github.com/users/zikalino/following{/other_user}","gists_url":"https://api.github.com/users/zikalino/gists{/gist_id}","starred_url":"https://api.github.com/users/zikalino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zikalino/subscriptions","organizations_url":"https://api.github.com/users/zikalino/orgs","repos_url":"https://api.github.com/users/zikalino/repos","events_url":"https://api.github.com/users/zikalino/events{/privacy}","received_events_url":"https://api.github.com/users/zikalino/received_events","type":"User","site_admin":false}],"milestone":null,"comments":13,"created_at":"2018-05-30T02:11:10Z","updated_at":"2018-10-12T15:38:36Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!---\r\nVerify first that your issue/request is not already reported on GitHub.\r\nTHIS FORM WILL BE READ BY A MACHINE, COMPLETE ALL SECTIONS AS DESCRIBED.\r\nAlso test if the latest release, and devel branch are affected too.\r\nALWAYS add information AFTER (OUTSIDE) these html comments.\r\nOtherwise it may end up being automatically closed by our bot. -->\r\n\r\n##### SUMMARY\r\nNeed to support setting runtime version. Currently it defaults to runtime ~1, and should be able to select runtime beta as well (and in the future, additional runtimes)\r\n\r\nUsing the playbook below causes a 409/Conflict error. But I don't think this is the right way of doing it anyway, Microsoft seems to suggest that the app needs to be fully created, then the runtime changed from ~1 to beta using 'az functionapp config appsettings' So the creation would have to be followed by an update. https://docs.microsoft.com/en-us/azure/azure-functions/set-runtime-version\r\n\r\nSo we need probably a runtime: playbook entry that would translate into a az functionapp config when the functionapp is succesfully created.\r\n\r\nBut I am very new at ansible so I may be missing something obvious?\r\n\r\n\r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Insert, BELOW THIS COMMENT, the name of the module, plugin, task or feature.\r\nDo not include extra details here, e.g. \"vyos_command\" not \"the network module vyos_command\" or the full path-->\r\nazure_rm_functionapp\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste, BELOW THIS COMMENT, verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\n2.5.2\r\n```\r\n\r\n##### CONFIGURATION\r\n<!--- If using Ansible 2.4 or above, paste, BELOW THIS COMMENT, the results of \"ansible-config dump --only-changed\"\r\nOtherwise, mention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).-->\r\n\r\n##### OS / ENVIRONMENT\r\n<!--- Mention, BELOW THIS COMMENT, the OS you are running Ansible from, and the OS you are\r\nmanaging, or say \"N/A\" for anything that is not platform-specific.\r\nAlso mention the specific version of what you are trying to control,\r\ne.g. if this is a network bug the version of firmware on the network device.-->\r\nWindows, with Ubuntu subsystem.\r\n\r\n##### STEPS TO REPRODUCE\r\n<!--- For bugs, show exactly how to reproduce the problem, using a minimal test-case.\r\nFor new features, show how the feature would be used. -->\r\n\r\nCreate a new resource group in azure.\r\nCreate a resource group mygrouptest123\r\nCreate a storage account mystorageaccount123\r\nAttempt to create a function app, using the playbook entry below.\r\n\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n- name: \"Bad example, since probably cannot set runtime at creation time\"\r\n      azure_rm_functionapp:\r\n        resource_group: mygrouptest123\r\n        name: myfunctionapptest123\r\n        storage_account: \"mystorageaccount123\r\n        app_settings:\r\n             FUNCTIONS_EXTENSION_VERSION: beta\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\nThe function app is created, and the runtime is set to 'beta'.\r\nIncidentally, rm_azure_functionapp_facts should also query the runtime\r\n\r\n\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\nfatal: [localhost]: FAILED! => {\"changed\": false, \"msg\": \"Error creating or updating web app: 409 Client \r\nError: Conflict for url: https://management.azure.com/subscriptions/...redacted.../resourceGroups/mygrouptest123/providers/Microsoft.Web/sites/myfunctionapptest123?api-version=2016-08-01\"}\r\n\r\n```\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/429368441","html_url":"https://github.com/ansible/ansible/issues/40857#issuecomment-429368441","issue_url":"https://api.github.com/repos/ansible/ansible/issues/40857","id":429368441,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTM2ODQ0MQ==","user":{"login":"IainColledge","id":10600605,"node_id":"MDQ6VXNlcjEwNjAwNjA1","avatar_url":"https://avatars2.githubusercontent.com/u/10600605?v=4","gravatar_id":"","url":"https://api.github.com/users/IainColledge","html_url":"https://github.com/IainColledge","followers_url":"https://api.github.com/users/IainColledge/followers","following_url":"https://api.github.com/users/IainColledge/following{/other_user}","gists_url":"https://api.github.com/users/IainColledge/gists{/gist_id}","starred_url":"https://api.github.com/users/IainColledge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IainColledge/subscriptions","organizations_url":"https://api.github.com/users/IainColledge/orgs","repos_url":"https://api.github.com/users/IainColledge/repos","events_url":"https://api.github.com/users/IainColledge/events{/privacy}","received_events_url":"https://api.github.com/users/IainColledge/received_events","type":"User","site_admin":false},"created_at":"2018-10-12T15:38:36Z","updated_at":"2018-10-12T15:38:36Z","author_association":"NONE","body":"Looking at the code it seems that there is no way to override FUNCTIONS_EXTENSION_VERSION\r\n\r\nhttps://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/azure/azure_rm_functionapp.py\r\n\r\nIt seems recently that Microsoft now defaults to Version 2 instead of 1,  the Ansible module defaults to 1, at the very least this should reflect Azure behavior.\r\n\r\n> A function app runs on a specific version of the Azure Functions runtime. There are two major versions: 1.x and 2.x. By default, function apps that are created version 2.x of the runtime. \r\n\r\nhttps://docs.microsoft.com/en-us/azure/azure-functions/set-runtime-version\r\n\r\n"}}
{"actor":{"display_login":"IainColledge"}}