From 93fdb29bddf9b0a14113f31622e5d50b0be34ff2 Mon Sep 17 00:00:00 2001 From: Austin Rhodes <92001031+Yumulak@users.noreply.github.com> Date: Mon, 30 Oct 2023 18:17:49 -0400 Subject: [PATCH] working dropdowns for locations, user authentication --- .github/workflows/Weatherly.yml | 48 +++++++++++ .../Weatherly/mssql1.arm.json | 81 +++++++++++++++++++ Properties/serviceDependencies.Weatherly.json | 12 +++ Properties/serviceDependencies.json | 3 +- README.md | 14 ++++ 5 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/Weatherly.yml create mode 100644 Properties/ServiceDependencies/Weatherly/mssql1.arm.json create mode 100644 Properties/serviceDependencies.Weatherly.json create mode 100644 README.md diff --git a/.github/workflows/Weatherly.yml b/.github/workflows/Weatherly.yml new file mode 100644 index 0000000..85424a9 --- /dev/null +++ b/.github/workflows/Weatherly.yml @@ -0,0 +1,48 @@ +name: Build and deploy .NET Core application to Web App Weatherly +on: + push: + branches: + - main +env: + AZURE_WEBAPP_NAME: Weatherly + AZURE_WEBAPP_PACKAGE_PATH: .\published + CONFIGURATION: Release + DOTNET_CORE_VERSION: 7.0.x + WORKING_DIRECTORY: . +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v3 + 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: Test + run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build + - name: Publish + run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}" + - name: Publish Artifacts + uses: actions/upload-artifact@v3 + with: + name: webapp + path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} + deploy: + runs-on: windows-latest + needs: build + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v3 + with: + name: webapp + path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} + - name: Deploy to Azure WebApp + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.Weatherly_F47F }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} diff --git a/Properties/ServiceDependencies/Weatherly/mssql1.arm.json b/Properties/ServiceDependencies/Weatherly/mssql1.arm.json new file mode 100644 index 0000000..5171c58 --- /dev/null +++ b/Properties/ServiceDependencies/Weatherly/mssql1.arm.json @@ -0,0 +1,81 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "resourceGroupName": { + "type": "string", + "defaultValue": "WeatherlyRG", + "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('Weatherly_db', 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": [ + { + "kind": "v12.0", + "location": "[parameters('resourceLocation')]", + "name": "weatherlydbserver", + "type": "Microsoft.Sql/servers", + "apiVersion": "2017-10-01-preview" + }, + { + "sku": { + "name": "Standard", + "tier": "Standard", + "capacity": 10 + }, + "kind": "v12.0,user", + "location": "[parameters('resourceLocation')]", + "name": "weatherlydbserver/Weatherly_db", + "type": "Microsoft.Sql/servers/databases", + "apiVersion": "2017-10-01-preview", + "dependsOn": [ + "weatherlydbserver" + ] + } + ] + } + } + } + ], + "metadata": { + "_dependencyType": "mssql.azure" + } +} \ No newline at end of file diff --git a/Properties/serviceDependencies.Weatherly.json b/Properties/serviceDependencies.Weatherly.json new file mode 100644 index 0000000..6cb84f3 --- /dev/null +++ b/Properties/serviceDependencies.Weatherly.json @@ -0,0 +1,12 @@ +{ + "dependencies": { + "mssql1": { + "serviceConnectorResourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.Web/sites/Weatherly/providers/Microsoft.ServiceLinker/linkers/ConnectionStringsDefaultConnection_FCB2E0B773", + "secretStore": "AzureAppSettings", + "resourceId": "/subscriptions/[parameters('subscriptionId')]/resourcegroups/[parameters('resourceGroupName')]/providers/Microsoft.Sql/servers/weatherlydbserver/databases/Weatherly_db", + "type": "mssql.azure", + "connectionId": "ConnectionStrings:DefaultConnection", + "dynamicId": null + } + } +} \ No newline at end of file diff --git a/Properties/serviceDependencies.json b/Properties/serviceDependencies.json index d8177e0..35c4ecb 100644 --- a/Properties/serviceDependencies.json +++ b/Properties/serviceDependencies.json @@ -2,7 +2,8 @@ "dependencies": { "mssql1": { "type": "mssql", - "connectionId": "ConnectionStrings:DefaultConnection" + "connectionId": "ConnectionStrings:DefaultConnection", + "dynamicId": null } } } \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f58c485 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# ASP.NET MVC Weather App + +A web app made with ASP.NET that uses the OpenWeatherMap API to get current weather information. +## Video +https://github.com/Yumulak/ASP.NET-MVC-Weather-App/assets/92001031/ecfd4c12-f660-4979-80fc-b4160b47911c + +## Plans +### Search location by city and state +- use Geocoding API to translate to coordinates :heavy_check_mark: +### Database to persist user data +- User saved locations +### Authentication for users upon opening site +### Host website using Azure +- Host on Azure App Service :heavy_check_mark: