зеркало из https://github.com/Azure/ForresterDemo.git
Updated Workflow
This commit is contained in:
Родитель
502051ac69
Коммит
040c76c288
|
@ -0,0 +1,43 @@
|
|||
name: Build and deploy .NET Core application to Function App ToyotaLogisticsSystem2 with API Management Service ToyotaLogisticsSystem2-ToyotaLogisticsSystem2
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
env:
|
||||
AZURE_FUNCTIONAPP_NAME: ToyotaLogisticsSystem2
|
||||
AZURE_FUNCTIONAPP_PACKAGE_PATH: ToyotaFunctionApp/publish
|
||||
CONFIGURATION: Release
|
||||
DOTNET_CORE_VERSION: 3.1.x
|
||||
WORKING_DIRECTORY: ToyotaFunctionApp
|
||||
AZURE_APIM_RESOURCEGROUP: ToyotaLogistics
|
||||
AZURE_APIM_SERVICENAME: ToyotaLogisticsSystem2
|
||||
AZURE_APIM_API_ID: ToyotaLogisticsSystem2
|
||||
AZURE_APIM_RESOURCE_PATH: /
|
||||
AZURE_APIM_SWAGGERURL: https://toyotalogisticssystem2.azurewebsites.net/api/swagger.json
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
|
||||
- name: Restore
|
||||
run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
|
||||
- name: Build
|
||||
run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore
|
||||
- name: Publish
|
||||
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}"
|
||||
- name: Deploy to Azure Function App
|
||||
uses: Azure/functions-action@v1
|
||||
with:
|
||||
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
|
||||
publish-profile: ${{ secrets.ToyotaLogisticsSystem2_1792 }}
|
||||
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
|
||||
- name: Azure Login
|
||||
uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.ToyotaLogisticsSystem2_SPN }}
|
||||
- name: Import API into Azure API Management
|
||||
run: az apim api import --path "${{ env.AZURE_APIM_RESOURCE_PATH }}" --resource-group ${{ env.AZURE_APIM_RESOURCEGROUP }} --service-name ${{ env.AZURE_APIM_SERVICENAME }} --api-id ${{ env.AZURE_APIM_API_ID }} --specification-url "${{ env.AZURE_APIM_SWAGGERURL }}" --specification-format OpenApi --subscription-required false
|
|
@ -26,6 +26,8 @@ namespace ToyotaFunctionApp
|
|||
public static async Task<IActionResult> GetVehicleRequest(
|
||||
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequest req,
|
||||
ILogger log)
|
||||
|
||||
//this is the http trigger
|
||||
{
|
||||
log.LogInformation("C# HTTP trigger function processed a request.");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче