Как развернуть приложение логики Azure, используя VS, который вызывает отключенную (не запущенную) функцию Azure? - PullRequest
0 голосов
/ 11 апреля 2019

Как развернуть приложение логики Azure с помощью VS, который вызывает отключенную (не запущенную) функцию Azure?

Когда у меня запущена функция Azure, развертывание приложения логики Azure из VS 2017 завершается успешно, и всеудивительно.

Когда я не могу запустить функцию Azure, развертывание приложения логики Azure завершается неудачно со следующей ошибкой:

11:54:05 - Template deployment returned the following errors:
11:54:05 - 11:54:04 AM - Resource Microsoft.Logic/workflows '[CONFIDENTIAL STRING...]' failed with message '{
11:54:05 -   "error": {
11:54:05 -     "code": "ListFunctionKeysFailed",
11:54:05 -     "message": "Request to obtain the keys for function '/subscriptions/[CONFIDENTIAL STRING...] failed. Error details: 'System.InvalidOperationException: Runtime keys are stored on blob storage. This API doesn't support this configuration. Please change Environment variable AzureWebJobsSecretStorageType value to 'Files'. For more info, visit https://aka.ms/funcsecrets\r\n   at Kudu.Core.Functions.FunctionManager.<GetKeyObjectFromFile>d__9`1.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Core\\Functions\\FunctionManager.cs:line 141\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Core.Functions.FunctionManager.<GetFunctionSecretsAsync>d__12.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Core\\Functions\\FunctionManager.cs:line 220\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Services.Functions.FunctionController.<GetSecrets>d__12.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Services\\Functions\\FunctionController.cs:line 141'."
11:54:05 -   }
11:54:05 - }'
11:54:05 - 11:54:04 AM - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
11:54:05 - 11:54:04 AM - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
11:54:05 - 
11:54:05 - 
11:54:05 - Deploying template using PowerShell script failed.
11:54:05 - Tell us about your experience at https://go.microsoft.com/fwlink/?LinkId=691202

Ответы [ 2 ]

2 голосов
/ 12 апреля 2019

Я попытался получить ту же ошибку, затем я тестировал ее на портале Azure, чтобы развернуть его, на этот раз я получил подробное сообщение об ошибке.

enter image description here

Это связано с тем, что по умолчанию используется значение blob, даже если оно не отображается в настройках приложения, поэтому можно изменить значение переменной среды AzureWebJobsSecretStorageType на Files.

enter image description here

После этого вы сможете загрузить приложение логики с остановленной функцией в VS.

1 голос
/ 12 апреля 2019

Используете ли вы сценарий powershell по умолчанию в visual studio?Попробуйте добавить http-привязку к вашей функции и затем вызвать ее из скрипта, чтобы разбудить ее.

https://docs.microsoft.com/en-us/dotnet/api/system.net.ftpwebrequest?view=netframework-4.7.2

...