This commit is contained in:
Kartik Kanakasabesan 2021-07-27 14:53:10 -07:00
Родитель d31c1dc1b0
Коммит e3f8371576
4 изменённых файлов: 187 добавлений и 0 удалений

48
.github/workflows/ToyotaFunctionApp20210727144805.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,48 @@
name: Build and deploy .NET Core application to Function App ToyotaFunctionApp20210727144805 with API Management Service ToyotaFunctionAppapi-ToyotaFunctionApp
on:
push:
branches:
- main
env:
AZURE_FUNCTIONAPP_NAME: ToyotaFunctionApp20210727144805
AZURE_FUNCTIONAPP_PACKAGE_PATH: ToyotaFunctionApp\.
CONFIGURATION: Release
DOTNET_CORE_VERSION: 3.1.x
WORKING_DIRECTORY: ToyotaFunctionApp
DOTNET_CORE_VERSION_INPROC: ''
AZURE_APIM_RESOURCEGROUP: ToyotaLogistics
AZURE_APIM_SERVICENAME: ToyotaFunctionAppapi
AZURE_APIM_API_ID: ToyotaFunctionApp
AZURE_APIM_RESOURCE_PATH: /
AZURE_APIM_SWAGGERURL: https://toyotafunctionapp20210727144805.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: Setup .NET Core (for inproc extensions)
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION_INPROC }}
- 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.TOYOTAFUNCTIONAPP20210727144805_FFFF }}
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.ToyotaFunctionAppapi_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

Двоичные данные
.vs/slnx.sqlite

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,131 @@
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceGroupName": {
"type": "string",
"defaultValue": "ToyotaLogistics",
"metadata": {
"_parameterType": "resourceGroup",
"description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
}
},
"resourceGroupLocation": {
"type": "string",
"defaultValue": "eastus",
"metadata": {
"_parameterType": "location",
"description": "Location of the resource group. Resource groups could have different location than resources."
}
},
"resourceLocation": {
"type": "string",
"defaultValue": "[parameters('resourceGroupLocation')]",
"metadata": {
"_parameterType": "location",
"description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
}
}
},
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"name": "[parameters('resourceGroupName')]",
"location": "[parameters('resourceGroupLocation')]",
"apiVersion": "2019-10-01"
},
{
"type": "Microsoft.Resources/deployments",
"name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('ToyotaFunctionApp', subscription().subscriptionId)))]",
"resourceGroup": "[parameters('resourceGroupName')]",
"apiVersion": "2019-10-01",
"dependsOn": [
"[parameters('resourceGroupName')]"
],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "ToyotaFunctionAppapi",
"type": "Microsoft.ApiManagement/service",
"location": "[parameters('resourceLocation')]",
"properties": {
"publisherEmail": "demoadmin@pmgevents.onmicrosoft.com",
"publisherName": "Julie Strauss",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "toyotafunctionappapi.azure-api.net",
"encodedCertificate": null,
"keyVaultId": null,
"certificatePassword": null,
"negotiateClientCertificate": false,
"certificate": null,
"defaultSslBinding": true
}
],
"publicIPAddresses": null,
"privateIPAddresses": null,
"additionalLocations": null,
"virtualNetworkConfiguration": null,
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "None",
"certificates": null,
"apiVersionConstraint": {
"minApiVersion": null
}
},
"sku": {
"name": "Consumption",
"capacity": 0
},
"apiVersion": "2019-12-01"
},
{
"type": "Microsoft.ApiManagement/service/apis",
"name": "ToyotaFunctionAppapi/ToyotaFunctionApp",
"properties": {
"displayName": "ToyotaFunctionApp",
"apiRevision": "1",
"description": null,
"subscriptionRequired": true,
"serviceUrl": null,
"path": "",
"protocols": [
"https"
],
"authenticationSettings": {
"oAuth2": null,
"openid": null
},
"subscriptionKeyParameterNames": {
"header": "Ocp-Apim-Subscription-Key",
"query": "subscription-key"
},
"isCurrent": true
},
"apiVersion": "2019-12-01",
"dependsOn": [
"ToyotaFunctionAppapi"
]
}
]
}
}
}
],
"metadata": {
"_dependencyType": "apis.azure"
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"dependencies": {
"apis1": {
"resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.ApiManagement/service/ToyotaFunctionAppapi/apis/ToyotaFunctionApp",
"type": "apis.azure"
}
}
}