Skip to content

Commit

Permalink
Add new app config connection string (#4946)
Browse files Browse the repository at this point in the history
* Update APIVIew pipeline to set additional env variables for testing
  • Loading branch information
praveenkuttappan authored Dec 14, 2022
1 parent 28c8db9 commit 7be2314
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
25 changes: 6 additions & 19 deletions .azure-pipelines/apiview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,8 @@ stages:

- job: 'Test'

dependsOn:
- 'Build'

pool:
name: azsdk-pool-mms-win-2019-general
name: azsdk-pool-mms-win-2022-general
vmImage: MMS2019

steps:
Expand All @@ -168,25 +165,15 @@ stages:
pwsh: true
displayName: 'Start Azurite'

- script: |
npm install -g azurite
displayName: 'Install Azurite'
- task: Powershell@2
inputs:
workingDirectory: $(Agent.TempDirectory)
filePath: $(Build.SourcesDirectory)/eng/scripts/Start-LocalHostApp.ps1
arguments: >
-Process "azurite.cmd"
-ArgumentList "--silent"
-Port "10000"
pwsh: true
displayName: 'Start Azurite'

- task: UseDotNet@2
displayName: 'Install .NET'
inputs:
version: '$(DotNetRuntimeVersion)'

- pwsh: |
dotnet --list-runtimes
dotnet --version
displayName: 'List .Net run times'
- task: DotNetCoreCLI@2
displayName: 'Build & Test'
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/templates/steps/apiview-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ steps:
APIVIEW_AUTHENTICATIONSCHEME: "Test"
APIVIEW_SENDGRID__KEY: "Test"
APIVIEW_APIKEY: "$(azuresdk-apiview-apikey)"
APIVIEW_APPCONFIG: "$(apiview-appconfig-connectionstring)"
AZURE_CLIENT_ID: "$(apiview-appconfig-client-id)"
AZURE_TENANT_ID: "$(apiview-appconfig-tenant-id)"
AZURE_CLIENT_SECRET: "$(apiview-appconfig-client-secret)"

- task: Powershell@2
inputs:
Expand Down
19 changes: 15 additions & 4 deletions src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
<li class="nav-item">
<a class="nav-link" id="help-Java" data-toggle="tab" href="#java-help">Java</a>
</li>
<li class="nav-item">
<a class="nav-link" id="help-Kotlin" data-toggle="tab" href="#java-help">Kotlin</a>
</li>
<li class="nav-item">
<a class="nav-link" id="help-JavaScript" data-toggle="tab" href="#js-help">JS/TS</a>
</li>
Expand All @@ -120,7 +123,10 @@
<a class="nav-link" id="help-Swagger" data-toggle="tab" href="#swagger-help">Swagger</a>
</li>
<li class="nav-item">
<a class="nav-link" id="help-CADL" data-toggle="tab" href="#cadl-help">CADL</a>
<a class="nav-link" id="help-Cadl" data-toggle="tab" href="#cadl-help">Cadl</a>
</li>
<li class="nav-item">
<a class="nav-link" id="help-Json" data-toggle="tab" href="#json-help">Json</a>
</li>
</ul>

Expand Down Expand Up @@ -237,9 +243,14 @@
</div>
<div class="tab-pane" id="cadl-help">
<ol>
<li>
Provide URL to cadl project root path.
</li>

Provide URL to cadl project root path.

</ol>
</div>
<div class="tab-pane" id="json-help">
<ol>
Upload JSON API review token file.
</ol>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/APIView/APIViewWeb/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
config.AddEnvironmentVariables(prefix: "APIVIEW_");
config.AddUserSecrets(typeof(Program).Assembly);
IConfiguration settings = config.Build();
string connectionString = settings.GetConnectionString("AppConfig");
string connectionString = settings.GetValue<string>("APPCONFIG");
// Load configuration from Azure App Configuration
config.AddAzureAppConfiguration(options =>
{
Expand Down

0 comments on commit 7be2314

Please sign in to comment.