There are two pieces to this puzzle.
1) Is the "Infrastructure as Code" or IaC. In your case the Azure Functions PaaS Service. This can be deployed using an Azure Resource Manager (ARM) template, built using Visual Studio 2017. This is the "runtime/host" that your function will be deployed to. See the Azure Resource Group deployment project type, part of the Azure SDK. Top tip - if you have an Azure Resource Group with a Functions PaaS instance in it, go to the instance and click on Platform Features -> Automation Template. This will give you the foundation for building your resource group deployment project.
2) Is the function itself. This needs to be deployed to your Azure Functions PaaS service. Azure functions have their own project type in Visual Studio 2017, however the template needs to be download. See Visual Studio 2017 Tools for Azure Functions.
Once you have built your function using (2) above, you publish to your function PaaS instance deployed (which was either manually deployed or deployed using (1) above).
Top Tip 2: You can build and test functions locally using the Azure Functions CLI.
Top Tip 3: Use the Azure Resource Explorer to help understand how the ARM structure looks for your subscriptions.