microsoft-identity-web icon indicating copy to clipboard operation
microsoft-identity-web copied to clipboard

Installed dotnet 8 SDK and IDE 17.10.0 but cannot install msidentity-app-sync

Open bkwdesign opened this issue 1 year ago • 1 comments
trafficstars

Microsoft.Identity.Web Library

Microsoft.Identity.Web

Microsoft.Identity.Web version

1.25.0

Web app

Sign-in users

Web API

Not Applicable

Token cache serialization

Not Applicable

Description

I'm using VS 2022 (VS 17.10.0)

My previously deployed NET6 web app has expired secrets and I'm wanting to use the msidentity tooling to update everything.

IDE does not show my web project having the MS Identity resource as being configured.

image

If I hit the green-plus-icon in the UI above and attempt in install the missing tooling, it fails.

If I try to run this CLI command, dotnet tool install -g msidentity-app-sync it fails

I cannot seem to install this resource - regardless of method (using the IDE UI, using CLI, and even grabbing source from git and calling dotnet pack also fails as described here)

dotnet --list-sdks 3.1.426 5.0.404 7.0.410 8.0.204 8.0.300

dotnet pack
  Determining projects to restore...
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-lib\app-provisioning-lib.csproj : warning NU1603: app-provisioning-lib depends on Microsof
t.Extensions.Configuration.Binder (>= 7.0.4) but Microsoft.Extensions.Configuration.Binder 7.0.4 was not found. An approximate best match of Microsoft.Extensions.Configuration.Binder 8.0.0 was resol
ved. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-lib\app-provisioning-lib.csproj : warning NU1603: app-provisioning-lib depends on System.T
ext.Json (>= 7.0.3) but System.Text.Json 7.0.3 was not found. An approximate best match of System.Text.Json 8.0.0 was resolved. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\
app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-tool\msidentity-app-sync.csproj : warning NU1603: app-provisioning-lib depends on Microsof
t.Extensions.Configuration.Binder (>= 7.0.4) but Microsoft.Extensions.Configuration.Binder 7.0.4 was not found. An approximate best match of Microsoft.Extensions.Configuration.Binder 8.0.0 was resol
ved. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-tool\msidentity-app-sync.csproj : warning NU1603: app-provisioning-lib depends on System.T
ext.Json (>= 7.0.3) but System.Text.Json 7.0.3 was not found. An approximate best match of System.Text.Json 8.0.0 was resolved. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\
app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-lib\app-provisioning-lib.csproj : error NU1100: Unable to resolve 'Azure.Identity (>= 1.11
.4)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repos\msidentity\microsoft-iden
tity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-lib\app-provisioning-lib.csproj : error NU1100: Unable to resolve 'Microsoft.Graph.Beta (>
= 5.42.0-preview)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repos\msidentity\
microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-lib\app-provisioning-lib.csproj : error NU1100: Unable to resolve 'Microsoft.Identity.Clie
nt.Extensions.Msal (>= 4.61.3)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repo
s\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-tool\msidentity-app-sync.csproj : error NU1100: Unable to resolve 'System.CommandLine.Drag
onFruit (>= 0.4.0-alpha.22272.1)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\re
pos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-tool\msidentity-app-sync.csproj : error NU1100: Unable to resolve 'Azure.Identity (>= 1.11
.4)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repos\msidentity\microsoft-iden
tity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-tool\msidentity-app-sync.csproj : error NU1100: Unable to resolve 'Microsoft.Graph.Beta (>
= 5.42.0-preview)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repos\msidentity\
microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-tool\msidentity-app-sync.csproj : error NU1100: Unable to resolve 'Microsoft.Identity.Clie
nt.Extensions.Msal (>= 4.61.3)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repo
s\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj : warning NU1603: Tests depends on Microsoft.NET.Test.Sdk (>= 16.6.1) but Microsoft.NET.
Test.Sdk 16.6.1 was not found. An approximate best match of Microsoft.NET.Test.Sdk 16.7.1 was resolved. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\ap
p-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj : warning NU1603: Tests depends on xunit.runner.visualstudio (>= 2.4.2) but xunit.runner
.visualstudio 2.4.2 was not found. An approximate best match of xunit.runner.visualstudio 2.4.3 was resolved. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-t
ool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj : error NU1100: Unable to resolve 'Microsoft.NETCore.App.Ref (= 7.0.19)' for 'net7.0'. P
ackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-p
rovisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj : error NU1100: Unable to resolve 'Microsoft.WindowsDesktop.App.Ref (= 7.0.19)' for 'net
7.0'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tool
s\app-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj : error NU1100: Unable to resolve 'Microsoft.AspNetCore.App.Ref (= 7.0.19)' for 'net7.0'
. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, NuGet. [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\ap
p-provisioning-tool\app-provisioning.sln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj : error NU1201: Project app-provisioning-lib is not compatible with net7.0 (.NETCoreApp,
Version=v7.0). Project app-provisioning-lib supports: net8.0 (.NETCoreApp,Version=v8.0) [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.s
ln]
C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj : error NU1201: Project msidentity-app-sync is not compatible with net7.0 (.NETCoreApp,V
ersion=v7.0). Project msidentity-app-sync supports: net8.0 (.NETCoreApp,Version=v8.0) [C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning.sln
]
  Failed to restore C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-tool\msidentity-app-sync.csproj (in 352 ms).
  Failed to restore C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-lib\app-provisioning-lib.csproj (in 352 ms).
  Failed to restore C:\Users\bwatts\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj (in 394 ms).

Reproduction steps

Stack trace (as shown in prior section) will occur when I try to compile app-provisioning-tool tool directly

Failure happens on dotnet pack

git clone https://github.com/AzureAD/microsoft-identity-web
cd tools\app-provisioning-tool
dotnet pack
dotnet tool install --global --add-source app-provisioning-tool\nupkg msidentity-app-sync

Above 4 lines were taken from app-provisioning-tool README

Error message

Failed to restore C:\XXXXX\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-tool\msidentity-app-sync.csproj (in 352 ms). Failed to restore C:\XXXXXX\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\app-provisioning-lib\app-provisioning-lib.csproj (in 352 ms). Failed to restore C:\XXXXXXX\source\repos\msidentity\microsoft-identity-web\tools\app-provisioning-tool\tests\Tests.csproj (in 394 ms).

Id Web logs

My app when run in Visual Studio will produce this error, and I can see in the Azure portal my client secrets have expired.

"error_description":"AADSTS7000222: The provided client secret keys for app '12345099-0000-aaaa-bbbb-aaabbcccdddd' are expired.
~``

### Relevant code snippets

```csharp
git clone https://github.com/AzureAD/microsoft-identity-web
cd tools\app-provisioning-tool
dotnet pack
dotnet tool install --global --add-source app-provisioning-tool\nupkg msidentity-app-sync

Above 4 lines were taken from app-provisioning-tool README



### Regression

_No response_

### Expected behavior

Expected tool to install successfully in my VS 2022 (17.10.0) and not get a nuget error

bkwdesign avatar Jun 19 '24 21:06 bkwdesign

@JoshLozensky - see the readme for details on how to set it up all up.

jennyf19 avatar Aug 21 '24 01:08 jennyf19

Task is to update the tool to use .NET 9, and re-release.

jennyf19 avatar Feb 03 '25 00:02 jennyf19

From copilot: The issue with installing the msidentity-app-sync tool seems to stem from package resolution problems related to the dependencies required for .NET 8.0. Here is a plan to address the issue:

1. Verify that all required SDKs and tools are installed. 2. Update the dependencies in the `app-provisioning-tool` project to match the required versions. 3. Ensure the NuGet package sources are correctly configured. 4. Attempt to build and pack the tool again. 5. Install the tool using the generated package.

I will execute the first step to check the installed SDKs and tools. Please ensure that you have the required .NET SDKs installed:

  1. Run dotnet --list-sdks to verify that you have the following SDKs installed:

    • .NET 9.0
  2. Verify that the msidentity-app-sync tool's dependencies match these SDK versions.

Next, we will need to update the dependencies in the app-provisioning-tool project to match the required versions. Ensure that the correct package sources are configured in your NuGet configuration file.

Once you have verified the SDKs and updated the dependencies, attempt to build and pack the tool again using the following commands:

git clone https://github.com/AzureAD/microsoft-identity-web
cd tools/app-provisioning-tool
dotnet pack
dotnet tool install --global --add-source app-provisioning-tool/nupkg msidentity-app-sync

If you encounter any errors during this process, please share the specific error messages for further assistance.

jennyf19 avatar Feb 04 '25 23:02 jennyf19

Hi @bkwdesign,

Thank you for creating this ticket. We have created a fix at this branch: mallikac/update-app-provisioning-tool. Can you please try this branch: and see if our fix resolves the issue?

mdchennu avatar Feb 10 '25 22:02 mdchennu