Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop/2.0 into main #369

Merged
merged 11 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,5 @@ local.settings.json
appsettings.json

**/MsDeploy

*.feature.cs
7 changes: 5 additions & 2 deletions GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ branches:
- feature
- support
- hotfix
next-version: "1.1"

develop:
mode: ContinuousDeployment
tag: alpha
regex: ^develop/\d\.\d$
next-version: "2.0"
4 changes: 2 additions & 2 deletions Solutions/Marain.Tenancy.Cli/Marain.Tenancy.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>tenancy</AssemblyName>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -40,7 +40,7 @@
</PackageReference>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.1.0" />
<PackageReference Include="McMaster.Extensions.Hosting.CommandLine" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="[3.1.*,)" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="[6.0.*,)" />
<PackageReference Include="ConsoleTables" Version="2.4.2" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task OnExecute(CommandLineApplication app)

if (string.IsNullOrEmpty(this.Name))
{
throw new ArgumentException("Name must be supplied", nameof(this.Name));
throw new InvalidOperationException("Name must be supplied");
}

Guid wellKnownGuid = string.IsNullOrEmpty(this.WellKnownTenantGuid)
Expand Down
8 changes: 5 additions & 3 deletions Solutions/Marain.Tenancy.Cli/Marain/Tenancy/Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace Marain.Tenancy.Cli
{
using System;
using System.Threading.Tasks;
using Corvus.Identity.ManagedServiceIdentity.ClientAuthentication;

using Corvus.Identity.ClientAuthentication.Azure;

using Marain.Tenancy.Client;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down Expand Up @@ -35,12 +37,12 @@ public static async Task Main(string[] args)
services.AddJsonNetDateTimeOffsetToIso8601AndUnixTimeConverter();
services.AddSingleton<JsonConverter>(new StringEnumConverter(true));

var msiTokenSourceOptions = new AzureManagedIdentityTokenSourceOptions
var msiTokenSourceOptions = new LegacyAzureServiceTokenProviderOptions
{
AzureServicesAuthConnectionString = ctx.Configuration["AzureServicesAuthConnectionString"],
};

services.AddAzureManagedIdentityBasedTokenSource(msiTokenSourceOptions);
services.AddServiceIdentityAzureTokenCredentialSourceFromLegacyConnectionString(msiTokenSourceOptions);

var tenancyClientOptions = new TenancyClientOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Marain.Tenancy.Cli
{
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Marain.Tenancy.Cli.Commands;
using McMaster.Extensions.CommandLineUtils;
Expand All @@ -23,6 +24,7 @@ public class TenancyCliCommand
/// </summary>
/// <param name="app">The current <c>CommandLineApplication</c>.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "The command line framework requires this to be an instance method")]
protected Task<int> OnExecute(CommandLineApplication app)
{
app.ShowHelp();
Expand Down
8 changes: 8 additions & 0 deletions Solutions/Marain.Tenancy.Cli/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"Cli: list": {
"commandName": "Project",
"commandLineArgs": "list"
}
}
}
2 changes: 1 addition & 1 deletion Solutions/Marain.Tenancy.Cli/appsettings.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// If running with a local tenancy service, point TenancyClient:TenancyServiceBaseUri at the localhost address for that
// and set the ResourceIdForMsiAuthentication to an empty string.
"TenancyClient:TenancyServiceBaseUri": "https://mardevtenancy.azurewebsites.net/",
"TenancyClient:ResourceIdForMsiAuthentication": "f1815180-9920-477b-95cc-7b93c2cd5de0"
"TenancyClient:ResourceIdForMsiAuthentication": "e7281b1b-6540-4c1b-ac18-eb0c2d42bfbf"

// If TenancyClient:TenancyServiceBaseUri refers to an instance in Azure, or if you've configured
// TenantCosmosContainerFactoryOptions, this local service will need to authenticate.
Expand Down
Loading