Reputation: 243
I need to create an Azure function project via Docker. I learned something about the docker commands for creating the function app project and templates.
I already installed the docker and related SDKs in my system.
I used this command for create function with docker file "func init . --docker" but it'd not working properly,
This is the files created without the docker file, I don't know why it's not create.
After that I execute the "func new" command for creating the function with language and Function Templates also selected,
And also not create the project(*.csproj) file. I executed the commands properly but why it's not coming I don't know about it. Please give me a solution for this. Thank you.
Upvotes: 2
Views: 445
Reputation: 4202
I've got this up and running in WSL As stated in the readme one should make sure everything is set up correctly.
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
to install the previously downloaded package.sudo apt-get update
to update your local aptitude cache.sudo apt-get install azure-functions-core-tools
to install the azure functions core tools.sudo apt-get install dotnet-sdk-2.2
func init . --docker
and select dotnet as framework (option 1)This will result into a list of files in your current directory:
.
├── Dockerfile
├── host.json
├── local.settings.json
└── test.csproj
0 directories, 4 files
You can now create an Azure function by running func new
. Select a template (HttpTrigger
, option 2), provide a name SampleFunction
and you have your function ready.
Your directory now looks like this:
.
├── Dockerfile
├── SampleFunction.cs
├── host.json
├── local.settings.json
└── test.csproj
0 directories, 5 files
This is all done with func
version 2.3.199
Upvotes: 1