Skip to content

Commit

Permalink
Merge pull request #5 from suhasaraos/master
Browse files Browse the repository at this point in the history
Architecture Center contribution for upgrade to Ase V2 to V3
  • Loading branch information
josevarela committed Jul 28, 2023
2 parents 9554677 + b15c388 commit 2baaa84
Show file tree
Hide file tree
Showing 33 changed files with 2,505 additions and 2,721 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/function-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Deploy Function App

on:
push:
branches:
- master
paths:
- 'code/function-app-ri/**'

jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup .NET Core 3
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x

- name: Restore NuGet Packages
run: dotnet restore ${{ vars.FUNCTION_APPPATH }}

- name: Build
run: dotnet build ${{ vars.FUNCTION_APPPATH }} --configuration ${{ vars.BUILDCONFIGURATION }} --no-restore

- name: Publish
run: dotnet publish ${{ vars.FUNCTION_APPPATH }} --configuration ${{ vars.BUILDCONFIGURATION }} --output ${{ github.workspace }}/VoteCounter --no-restore


- name: Archive Files
uses: actions/upload-artifact@v2
with:
name: drop
path: ${{ github.workspace }}/VoteCounter

deploy:
needs: build
runs-on: self-hosted
environment: 'production'
steps:
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: actions/download-artifact@master
with:
name: drop
path: ${{ github.workspace }}/VoteCounter

- name: Deploy
uses: azure/webapps-deploy@v2
with:
app-name: ${{ vars.FUNCTION_APP_NAME }}
package: ${{ github.workspace }}/VoteCounter
slot-name: production
62 changes: 62 additions & 0 deletions .github/workflows/voting-data-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Deploy VotingData App

on:
push:
branches:
- master
paths:
- 'code/web-app-ri/VotingData/**'

jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup .NET Core 3
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x

- name: Restore NuGet Packages
run: dotnet restore ${{ vars.VOTINGDATA_APPPATH }}

- name: Build
run: dotnet build ${{ vars.VOTINGDATA_APPPATH }} --configuration ${{ vars.BUILDCONFIGURATION }} --no-restore

- name: Publish
run: dotnet publish ${{ vars.VOTINGDATA_APPPATH }} --configuration ${{ vars.BUILDCONFIGURATION }} --output ${{ github.workspace }}/VotingData --no-restore


- name: Archive Files
uses: actions/upload-artifact@v2
with:
name: drop
path: ${{ github.workspace }}/VotingData

deploy:
needs: build
runs-on: self-hosted
environment: 'production'
steps:
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: actions/download-artifact@master
with:
name: drop
path: ${{ github.workspace }}/VotingData

- name: Deploy
uses: azure/webapps-deploy@v2
with:
app-name: ${{ vars.VOTINGDATA_WEB_APP_NAME }}
package: ${{ github.workspace }}/VotingData
slot-name: production
62 changes: 62 additions & 0 deletions .github/workflows/voting-web-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Deploy VotingWeb App

on:
push:
branches:
- master
paths:
- 'code/web-app-ri/VotingWeb/**'

jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup .NET Core 3
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x

- name: Restore NuGet Packages
run: dotnet restore ${{ vars.VOTINGWEB_APPPATH }}

- name: Build
run: dotnet build ${{ vars.VOTINGWEB_APPPATH }} --configuration ${{ vars.BUILDCONFIGURATION }} --no-restore

- name: Publish
run: dotnet publish ${{ vars.VOTINGWEB_APPPATH }} --configuration ${{ vars.BUILDCONFIGURATION }} --output ${{ github.workspace }}/VoteWeb --no-restore


- name: Archive Files
uses: actions/upload-artifact@v2
with:
name: drop
path: ${{ github.workspace }}/VoteWeb

deploy:
needs: build
runs-on: self-hosted
environment: 'production'
steps:
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: actions/download-artifact@master
with:
name: drop
path: ${{ github.workspace }}/VoteWeb

- name: Deploy
uses: azure/webapps-deploy@v2
with:
app-name: ${{ vars.VOTINGWEB_APP_NAME }}
package: ${{ github.workspace }}/VoteWeb
slot-name: production
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ ClientBin/
*.dbproj.schemaview
*.jfm
*.pfx
*.crt
*.key
*.publishsettings
orleans.codegen.cs

Expand Down
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ Then follow the steps for either standard or high availability deployments.
### For standard deployment

```
chmod +x deploy_std.sh
./deploy_std.sh
chmod +x commands_std.azcli
./commands_std.azcli
```

### For high availability deployment
Expand All @@ -80,7 +80,7 @@ chmod +x deploy_ha.sh

## Insert Document in Cosmos Db

1. After deployment ends in the last step, run the following commands to get the resourceURl
1. After deployment ends in the last step, run the following commands to get the resourceURL

```
echo "{\"id\": \"1\", \"Message\": \"Powered by Azure\", \"MessageType\": \"AD\", \"Url\": \"${RESOURCE_URL}\"}"
Expand All @@ -103,21 +103,15 @@ The following snippet shows an example of the JSON response:

- Go to Azure portal and open the resource group of deployment above. Click on **Azure Cosmos Db Account**, then select **Firewall and virtual network**, then delete your public ip.

## Register domain by adding a record in hosts file [OPTIONAL]

1. Go to Azure portal, open the the resource group of deployment above, and click on **AppGatewayIp**, then copy the IP Address value.
2. Edit local host file.
3. Add a new record using the IP read in step 1 above with the domain defined in APPGW_URL.

## Set up managed identities as users in the Sql Database

[Create SQL server MSI Integration](./create_sqlserver_msi_integration.md).

## Publish Asp.net core Web, Api and Function applications

1. [Prepare Jumpbox](./prepare_jumpbox.md).
1. [Prepare Jumpbox and Github Actions](./prepare_jumpbox.md).

2. [Compile and Deploy Applications](./compile_and_deploy.md).
2. Run Github Actions to Deploy Web Apps

3. At this point you should be able to test the application:
8.1 For standard deployment, open: https://votingapp-std.contoso.com.
Expand Down
2 changes: 1 addition & 1 deletion code/function-app-ri/FunctionApp/VoteCounter.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion code/web-app-ri/VotingData/VotingData.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<UserSecretsId>746f30e9-2ecb-4b24-b825-02d383365fc3</UserSecretsId>
</PropertyGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release'">
Expand Down
10 changes: 5 additions & 5 deletions code/web-app-ri/VotingWeb/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>@ViewData["Title"]</title>

<link href="~/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="~/css/site.css" rel="stylesheet"/>

@Html.Raw(JavaScriptSnippet.FullScript)
Expand All @@ -16,10 +16,10 @@
@RenderBody()
</div>

<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/lib/angular/angular.js"></script>
<script src="~/lib/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.3/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/2.5.6/ui-bootstrap-tpls.js"></script>
<script src="~/js/site.js?n=1"></script>

@RenderSection("Scripts", required: false)
Expand Down
2 changes: 1 addition & 1 deletion code/web-app-ri/VotingWeb/VotingWeb.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<UserSecretsId>d2110877-4dcc-4be2-862a-15df3591e3ac</UserSecretsId>
</PropertyGroup>
<!-- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
2 changes: 1 addition & 1 deletion code/web-app-ri/VotingWeb/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Prerequisites
### Prerequisites

1. deploy the Reference Implementation
2. remote to the Jumpbox
Expand Down
Loading

0 comments on commit 2baaa84

Please sign in to comment.