azure-functions

Azure Function deployments cause brief 503 errors even when auto swap is turned on

ε祈祈猫儿з 提交于 2021-01-27 05:26:24
问题 I'm deploying updates to my Function app through the VS publish window. I set up a deployment slot with auto swap turned on. My updates through VS are going to the slot. The problem is, right after the publish is successful and when I test my API endpoints, I briefly receive 503 errors. I was under the impression that auto swap was seamless and end-users would not experience such interruptions. Am I missing something? How can I make my deployments unnoticeable to the users? 回答1: Switching to

How do I return JSON from an Azure Function

拥有回忆 提交于 2021-01-20 18:45:54
问题 I am playing with Azure Functions. However, I feel like I'm stumped on something pretty simple. I'm trying to figure out how to return some basic JSON. I'm not sure how to create some JSON and get it back to my request. Once upon a time, I would create an object, populate its properties, and serialize it. So, I started down this path: #r "Newtonsoft.Json" using System.Net; public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { log.Info($"Running Function"

How to use SignalR in an Azure function app?

六月ゝ 毕业季﹏ 提交于 2021-01-20 16:54:50
问题 I'm building a small game that will be driven by web socket using SignalR on one hand and Azure function app on the other hand. Basically, the user establishes a web socket connection with the server and sends/receives a message from it. This is mainly done this way because players can discuss with each other in real-time. Besides, I'd like to have some Azure function apps that run and execute some instructions. For example, every minute, an app would make some monsters move. If these

How to use SignalR in an Azure function app?

▼魔方 西西 提交于 2021-01-20 16:54:18
问题 I'm building a small game that will be driven by web socket using SignalR on one hand and Azure function app on the other hand. Basically, the user establishes a web socket connection with the server and sends/receives a message from it. This is mainly done this way because players can discuss with each other in real-time. Besides, I'd like to have some Azure function apps that run and execute some instructions. For example, every minute, an app would make some monsters move. If these

How to use SignalR in an Azure function app?

时光怂恿深爱的人放手 提交于 2021-01-20 16:50:26
问题 I'm building a small game that will be driven by web socket using SignalR on one hand and Azure function app on the other hand. Basically, the user establishes a web socket connection with the server and sends/receives a message from it. This is mainly done this way because players can discuss with each other in real-time. Besides, I'd like to have some Azure function apps that run and execute some instructions. For example, every minute, an app would make some monsters move. If these

Make back end APIs only accessible via Azure API management

半世苍凉 提交于 2021-01-20 16:50:10
问题 I have multiple Web APIs deployed in Azure without applying authentication, so anyone has access to internet has the access to the Web APIs. Now I would like to apply authentications to the Web APIs, instead of implementing the same authentication logic in different Web APIs, I found Azure API gateway (API management) is a potential solution. With Azure API management documentation, I learned I can apply policies like validate-jwt to authenticate requests to back end Web APIs. However,

Make back end APIs only accessible via Azure API management

房东的猫 提交于 2021-01-20 16:48:21
问题 I have multiple Web APIs deployed in Azure without applying authentication, so anyone has access to internet has the access to the Web APIs. Now I would like to apply authentications to the Web APIs, instead of implementing the same authentication logic in different Web APIs, I found Azure API gateway (API management) is a potential solution. With Azure API management documentation, I learned I can apply policies like validate-jwt to authenticate requests to back end Web APIs. However,

How to inject or use IConfiguration in Azure Function V3 with Dependency Injection when configuring a service

流过昼夜 提交于 2021-01-20 15:58:33
问题 Normally in a .NET Core project I would create a 'boostrap' class to configure my service along with the DI registration commands. This is usually an extension method of IServiceCollection where I can call a method like .AddCosmosDbService and everything necessary is 'self-contained' in the static class containing that method. The key though is that the method gets an IConfiguration from the Startup class. I've worked with DI in Azure Functions in past but haven't come across this specific

How to inject or use IConfiguration in Azure Function V3 with Dependency Injection when configuring a service

巧了我就是萌 提交于 2021-01-20 15:57:32
问题 Normally in a .NET Core project I would create a 'boostrap' class to configure my service along with the DI registration commands. This is usually an extension method of IServiceCollection where I can call a method like .AddCosmosDbService and everything necessary is 'self-contained' in the static class containing that method. The key though is that the method gets an IConfiguration from the Startup class. I've worked with DI in Azure Functions in past but haven't come across this specific

How to inject or use IConfiguration in Azure Function V3 with Dependency Injection when configuring a service

你离开我真会死。 提交于 2021-01-20 15:56:42
问题 Normally in a .NET Core project I would create a 'boostrap' class to configure my service along with the DI registration commands. This is usually an extension method of IServiceCollection where I can call a method like .AddCosmosDbService and everything necessary is 'self-contained' in the static class containing that method. The key though is that the method gets an IConfiguration from the Startup class. I've worked with DI in Azure Functions in past but haven't come across this specific