-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-Pick fixes for 1.8.2 patch release (#33984)
* cherry-pick Do not handle AADSTS errors as PowerShell not installed (#32251) * Do not handle AADSTS errors as PowerShell not installed * cherry-pick Fix regional endpoint validation error (#33544) * Fix regional endpoint validation error and update MSAL dependencies * update changelog for 1.8.2 release * update project version * cherry-pick First iteration of a simple ManagedIdentity integration test (#33017) * First iteration of a simple ManagedIdentity integration test --------- Co-authored-by: Christopher Scott <chriss@microsoft.com>
- Loading branch information
1 parent
3a2a7d4
commit 9623f9a
Showing
25 changed files
with
403 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
sdk/identity/Azure.Identity/integration/WebApp/Controllers/TestController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Linq; | ||
using Azure.Core; | ||
using Azure.Identity; | ||
using Azure.Storage.Blobs; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace WebApp.Controllers | ||
{ | ||
|
||
[ApiController] | ||
[Route("[controller]")] | ||
public class TestController : ControllerBase | ||
{ | ||
|
||
[HttpGet(Name = "GetTest")] | ||
public IActionResult Get() | ||
{ | ||
string resourceId = Environment.GetEnvironmentVariable("IDENTITY_WEBAPP_USER_DEFINED_IDENTITY")!; | ||
string account1 = Environment.GetEnvironmentVariable("IDENTITY_STORAGE_NAME_1")!; | ||
string account2 = Environment.GetEnvironmentVariable("IDENTITY_STORAGE_NAME_2")!; | ||
|
||
var credential1 = new ManagedIdentityCredential(); | ||
var credential2 = new ManagedIdentityCredential(new ResourceIdentifier(resourceId)); | ||
var client1 = new BlobServiceClient(new Uri($"https://{account1}.blob.core.windows.net/"), credential1); | ||
var client2 = new BlobServiceClient(new Uri($"https://{account2}.blob.core.windows.net/"), credential2); | ||
try | ||
{ | ||
var results = client1.GetBlobContainers().ToList(); | ||
results = client2.GetBlobContainers().ToList(); | ||
return Ok("Successfully acquired a token from ManagedIdentityCredential"); | ||
} | ||
catch (Exception ex) | ||
{ | ||
return BadRequest(ex.ToString()); | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
sdk/identity/Azure.Identity/integration/WebApp/Integration.Identity.WebApp.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Azure.Storage.Blobs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Azure.Identity.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
// Add services to the container. | ||
|
||
builder.Services.AddControllers(); | ||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | ||
builder.Services.AddEndpointsApiExplorer(); | ||
|
||
var app = builder.Build(); | ||
|
||
// Configure the HTTP request pipeline. | ||
app.UseHttpsRedirection(); | ||
|
||
app.UseAuthorization(); | ||
|
||
app.MapControllers(); | ||
|
||
app.Run(); |
8 changes: 8 additions & 0 deletions
8
sdk/identity/Azure.Identity/integration/WebApp/appsettings.Development.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
sdk/identity/Azure.Identity/integration/WebApp/appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<config> | ||
<!-- | ||
<add key="repositoryPath" value="./NugetInstall" /> | ||
<add key="globalPackagesFolder" value="./Nuget" /> | ||
--> | ||
<add key="repositoryPath" value="%AGENT_WORKFOLDER%/NugetInstall" /> | ||
<add key="globalPackagesFolder" value="%AGENT_WORKFOLDER%/Nuget" /> | ||
</config> | ||
<packageSources> | ||
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" /> | ||
</packageSources> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.