Azure / Azure/Azure-Functions

Azure Web App Bot doesn' restart as intended

Open
#1,421 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

I have a Azure web app chat bot and I restart it every sunday at noon with an azure function.
This is the Function:

**Azure Function to restart Web app bot**
```
# Input bindings are passed in via param block.
param($Timer)

# Get the current universal time in the default string format
$currentUTCtime = (Get-Date).ToUniversalTime()

# The 'IsPastDue' porperty is 'true' when the current function invocation is later than scheduled.
if ($Timer.IsPastDue) {
Write-Host "PowerShell timer is running late!"
}
Restart-AzWebApp -ResourceGroupName "xxxx" -Name "xxxx"

# Write an information log with the current time.
Write-Host "PowerShell timer trigger function ran! TIME: $currentUTCtime"
```
I didn' modify much, only
```
Restart-AzWebApp -ResourceGroupName "xxxx" -Name "xxxx"
```
is not generated by azure.

If the function is triggered the bot stops and restart, but the restart doesnt't really start until the first user tries to connect to the bot. The first user has to wait like 30 seconds till he recieves an answer doesn't matter if he writes 10 minutes after the restart or 10 hours.

In my bot console I see some kind of restart message

```
2019-11-21T14:36:04 PID[5640] Information Loading modules from D:\Program Files (x86)\MiddlewareModules\1.1.12\Microsoft.Azure.AppService.Middleware.Modules.dll
2019-11-21T14:36:05 PID[5640] Information TLS 1.2 enabled.
Let's go!
```
"Let's go!" means my bot is ready to receive and answer, but this restart message first appears after the first user tries to connect/writes his first message.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.