31
loading...
This website collects cookies to deliver better user experience
func init TelegramFunctions --worker-runtime dotnet-isolated
cd TelegramFunctions
func new --name SetUpBot --template "HTTP trigger" --authlevel "anonymous"
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
func start
az login
// below creates a resource group in a specified location
az group create --name RESOURCE_GROUP_NAME --location germanywestcentral
// below creates a storage account needed to set up the functions
az storage account create --name STORAGE_ACCOUNT_NAME --location germanywestcentral --resource-group RESOURCE_GROUP_NAME --sku Standard_LRS
// below creates the functions app on a Consumption plan with isolated execution mode
az functionapp create --resource-group RESOURCE_GROUP_NAME --consumption-plan-location germanywestcentral --runtime dotnet-isolated --functions-version 4 --name FUNCTIONS_APP_NAME --storage-account STORAGE_ACCOUNT_NAME
func azure functionapp publish FUNCTIONS_APP_NAME
dotnet add package Telegram.Bot --version 17.0.0
az functionapp config appsettings set --name FUNCTIONS_APP_NAME --resource-group RESOURCE_GROUP_NAME --settings "TelegramBotToken=YOUR_BOT_TOKEN"
func azure functionapp publish FUNCTIONS_APP_NAME
az group delete --name RESOURCE_GROUP_NAME