diff --git a/.github/workflows/echobot-build-ECHO.yml b/.github/workflows/echobot-build-ECHO.yml new file mode 100644 index 000000000..f4791d747 --- /dev/null +++ b/.github/workflows/echobot-build-ECHO.yml @@ -0,0 +1,106 @@ +name: .NET BOT D1 BUILD ECHO + +on: + push: + branches: + - 'master' + paths: + - './Samples/PublicSamples/EchoBot/src/**' + - .github/workflows/echobot-build-ECHO.yml + + pull_request: + branches: + - 'master' + paths: + - './Samples/PublicSamples/EchoBot/src/**' + - .github/workflows/echobot-build-ECHO.yml + + workflow_dispatch: + +env: + # /home/runner/work/publish + Base: publish + Component: EchoBot + BuildName: 0.1.${{ github.run_number }} + Environment: D1 + OrgName: ECHO + Location: centralus + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1 + + - name: Navigate to Workspace + run: cd $GITHUB_WORKSPACE + + - name: Run pwsh + shell: pwsh + run: | + echo "${{ env.Base }}/${{ env.Component }}/${{ env.BuildName }}/" + - uses: nuget/setup-nuget@v1 + - run: nuget restore Samples\PublicSamples\EchoBot\src\EchoBot.sln + + - name: Create Build Directory + run: mkdir ${{ env.Base }}/${{ env.Component }}/${{ env.BuildName }}/ + + - name: Build Solution + run: | + msbuild.exe Samples\PublicSamples\EchoBot\src\EchoBot.sln /nologo /p:platform="x64" /p:OutDir=${{ github.workspace }}/${{ env.Base }}/${{ env.Component }}/${{ env.BuildName }}/ + + - name: Run pwsh + shell: pwsh + run: | + Get-ChildItem -Path ${{ github.workspace }}\${{ env.Base }}\${{ env.Component }}\${{ env.BuildName }}\ + echo ${{ github.workspace }} + + - name: Login via Az module + uses: azure/login@v2 + with: + creds: ${{ secrets.AZURE_CREDENTIALS_ECHO_BOT }} + enable-AzPSSession: true + + - name: G1_RG_UploadArtifacts_to_Blob + uses: Azure/powershell@v2 + with: + inlineScript: | + Get-ChildItem -Path ./${{ env.Base }}/${{ env.Component }}/${{ env.BuildName }}/ # -Recurse + + $Params = @{ + App = 'BOT' + BuildName = $env:BuildName + ComponentName = $env:Component + BasePath = $env:Base + OrgName = $env:OrgName + Location = $env:location + } + & ./Samples/PublicSamples/EchoBot/ADF/release-az/Sync-AzBuildComponent.ps1 @Params + azPSVersion: latest + + - name: G1_RG_UpdateBuildMeta_to_Blob + uses: Azure/powershell@v2 + with: + inlineScript: | + echo $home + ls $home + + $Params = @{ + App = 'BOT' + BuildName = $env:BuildName + ComponentName = $env:Component + BasePath = $env:Base + OrgName = $env:OrgName + Location = $env:location + Environment = $env:Environment + } + & ./Samples/PublicSamples/EchoBot/ADF/release-az/Update-AzBuildMetaData.ps1 @Params + azPSVersion: latest + + + diff --git a/.github/workflows/echobot-infra-ECHO.yml b/.github/workflows/echobot-infra-ECHO.yml new file mode 100644 index 000000000..fadb10415 --- /dev/null +++ b/.github/workflows/echobot-infra-ECHO.yml @@ -0,0 +1,57 @@ +name: .NET BOT D1 INFRA ECHO + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the main branch + # https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows + push: + branches: + - 'master' + paths: + - './Samples/PublicSamples/EchoBot/ADF/**' + - .github/workflows/echobot-infra-ECHO.yml + + pull_request: + branches: + - 'master' + paths: + - './Samples/PublicSamples/EchoBot/ADF/**' + - .github/workflows/echobot-infra-ECHO.yml + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + OrgName: ECHO + Location: centralus + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + EnvironmentDeploy: + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login via Az module + uses: azure/login@v2 + with: + creds: ${{secrets.AZURE_CREDENTIALS_ECHO_BOT}} + enable-AzPSSession: true + + - name: Deploy_All_Subscription + uses: Azure/powershell@v2 + with: + azPSVersion: latest + inlineScript: | + $Params = @{ + OrgName = $env:OrgName + Location = $env:location + FullUpload = $true + } + ./Samples/PublicSamples/EchoBot/ADF/main.ps1 @Params + if ($e){throw $e} + + + diff --git a/Samples/PublicSamples/EchoBot/ADF/azuredeploy-ECHO.parameters.json b/Samples/PublicSamples/EchoBot/ADF/azuredeploy-ECHO.parameters.json new file mode 100644 index 000000000..241104837 --- /dev/null +++ b/Samples/PublicSamples/EchoBot/ADF/azuredeploy-ECHO.parameters.json @@ -0,0 +1,297 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "Environment": { + "value": "D" + }, + "DeploymentID": { + "value": "1" + }, + "Stage": { + "value": { + "SUB": 1, + "RG": 1, + "RBAC": 1, + "UAI": 1, + "KV": 1, + "OMS": 1, + "OMSDataSources": 0, + "OMSUpdateWeekly": 0, + "OMSUpdateMonthly": 0, + "OMSSolutions": 0, + "SA": 1, + "RSV": 1, + "NSGSPOKE": 1, + "VNet": 1, + "VNetPeering": 0, + "LB": 1, + "BastionHost": 0, + "VMSS": 1, + "SetExternalDNS": 1, + "SetInternalDNS": 1 + } + }, + "Extensions": { + "value": { + "VMInsights": 1 + } + }, + "DeploymentInfo": { + "value": { + "uaiInfo": [ + { + "name": "StorageAccountFileContributor", + "RBAC": [ + { + "Name": "Storage File Data SMB Share Contributor" + }, + { + "Name": "Storage Blob Data Contributor" + } + ] + }, + { + "name": "KeyVaultSecretsGet", + "RBAC": [ + { + "Name": "Key Vault Secrets User" + } + ] + } + ], + "DNSServers": [], + "SubnetInfo": [ + { + "name": "snFE01", + "prefix": "32/27", + "NSG": 1, + "FlowLogEnabled": true, + "FlowAnalyticsEnabled": true, + "securityRules": [ + { + "name": "CALL_SIGNALING", + "properties": { + "protocol": "TCP", + "sourcePortRange": "*", + "destinationPortRange": "9442", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "VirtualNetwork", + "access": "Allow", + "priority": 100, + "direction": "Inbound", + "sourcePortRanges": [], + "destinationPortRanges": [], + "sourceAddressPrefixes": [], + "destinationAddressPrefixes": [] + } + }, + { + "name": "TEAMS_MEDIA_UDP", + "properties": { + "protocol": "UDP", + "sourcePortRange": "*", + "destinationPortRange": "*", + "destinationAddressPrefix": "VirtualNetwork", + "access": "Allow", + "priority": 105, + "direction": "Inbound", + "sourcePortRanges": [], + "destinationPortRanges": [], + "sourceAddressPrefixes": [ + "52.112.0.0/14", + "52.120.0.0/14" + ], + "destinationAddressPrefixes": [] + } + }, + { + "name": "CALL_NOTIFICATION", + "properties": { + "protocol": "TCP", + "sourcePortRange": "*", + "destinationPortRange": "9441", + "sourceAddressPrefix": "AzureCloud", + "destinationAddressPrefix": "VirtualNetwork", + "access": "Allow", + "priority": 120, + "direction": "Inbound", + "sourcePortRanges": [], + "destinationPortRanges": [], + "sourceAddressPrefixes": [], + "destinationAddressPrefixes": [] + } + }, + { + "name": "MEDIA_CONTROL_PLANE", + "properties": { + "protocol": "TCP", + "sourcePortRange": "*", + "destinationPortRange": "8445", + "sourceAddressPrefix": "AzureCloud", + "destinationAddressPrefix": "VirtualNetwork", + "access": "Allow", + "priority": 130, + "direction": "Inbound", + "sourcePortRanges": [], + "destinationPortRanges": [], + "sourceAddressPrefixes": [], + "destinationAddressPrefixes": [] + } + } + ] + } + // { + // "name": "AzureBastionSubnet", + // "prefix": "96/27", + // "NSG": 1, + // "FlowLogEnabled": true, + // "FlowAnalyticsEnabled": true + // } + ], + "BastionInfo": { + "name": "HST01", + "PublicIP": "Static", + "SKU": "Standard" + }, + "storageAccountInfo": [ + { + "namesuffix": "diag", + "skuName": "Standard_LRS", + "allNetworks": "Allow", + "logging": { + "r": 0, + "w": 0, + "d": 1 + }, + "blobVersioning": 1, + "changeFeed": 1, + "softDeletePolicy": { + "enabled": 1, + "days": 7 + } + }, + { + "namesuffix": "global", + "skuName": "Standard_LRS", + "allNetworks": "Allow", + "logging": { + "r": 0, + "w": 0, + "d": 1 + }, + "blobVersioning": 1, + "changeFeed": 1, + "softDeletePolicy": { + "enabled": 1, + "days": 7 + }, + "containers": [ + { + "name": "builds" + } + ] + } + ], + "LBInfo": [ + { + "Name": "BotVmss01", + "Sku": "Standard", + "Type": "Public", + "BackEnd": [ + "BotVmss01" + ], + "FrontEnd": [ + { + "LBFEName": "BotVmss01", + "PublicIP": "Static" + } + ], + "NATPools": [ + { + "Name": "MediaControlPlane", + "frontendPortRangeStart": 6000, + "frontendPortRangeEnd": 6500, + "enableFloatingIP": false, + "backendPort": 8445, + "idleTimeoutInMinutes": 4, + "protocol": "Tcp", + "LBFEName": "BotVmss01" + }, + { + "Name": "BotNotification", + "frontendPortRangeStart": 7000, + "frontendPortRangeEnd": 7500, + "enableFloatingIP": false, + "backendPort": 9441, + "idleTimeoutInMinutes": 4, + "protocol": "Tcp", + "LBFEName": "BotVmss01" + } + ], + "Probes": [ + { + "ProbeName": "CallSignaling", + "LBBEProbePort": 9442 + } + ], + "Services": [ + { + "LBFEName": "BotVmss01", + "LBBEName": "BotVmss01", + "RuleName": "API-CallSignaling", + "LBFEPort": 443, + "LBBEPort": 9442, + "ProbeName": "CallSignaling", + "DirectReturn": false + } + ] + } + ], + "VMSSInfo": [ + { + "Name": "BOT01", + "AutoScale": true, + "PredictiveScale": "Enabled", + "saname": "data", + "Role": "BOT", + "DSConfig": "BotServers", + "DDRole": "64GBSS", + "OSType": "Server2022", + "LB": "BotVmss01", + "NATName": [ + "BotNotification", + "MediaControlPlane" + ], + "zones": [ + "1", + "2", + "3" + ], + "LBBE": [ + "BotVmss01" + ], + "NICs": [ + { + "Subnet": "FE01", + "Primary": 1, + "FastNic": 1, + "PublicIP": 1 + } + ], + "AutoScalecapacity": { + "minimum": "2", + "maximum": "9", + "default": "3" + }, + "Health": { + "protocol": "https", + "port": "9442", + "requestPath": "/health" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/Samples/PublicSamples/EchoBot/ADF/release-az/Create-KeyVault.ps1 b/Samples/PublicSamples/EchoBot/ADF/release-az/Create-KeyVault.ps1 index 2485704e7..712b361fb 100644 --- a/Samples/PublicSamples/EchoBot/ADF/release-az/Create-KeyVault.ps1 +++ b/Samples/PublicSamples/EchoBot/ADF/release-az/Create-KeyVault.ps1 @@ -44,8 +44,9 @@ if (! (Get-AzKeyVault -Name $KVName -EA SilentlyContinue)) try { New-AzKeyVault -Name $KVName -ResourceGroupName $RGName -Location $Location ` - -EnabledForDeployment -EnabledForTemplateDeployment -EnablePurgeProtection:$EnablePurgeProtection ` - -EnableRbacAuthorization -Sku Standard -ErrorAction Stop + -EnabledForDeployment -EnabledForTemplateDeployment -EnablePurgeProtection:$EnablePurgeProtection + -Sku Standard ` + -ErrorAction Stop } catch {