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

Update Storage to track 2 SDK #413

Merged
merged 7 commits into from
Oct 10, 2020
Merged

Conversation

FrankieTF
Copy link
Contributor

@FrankieTF FrankieTF commented Sep 23, 2020

Purpose:

  • Update Storage to track 2 SDK.

Updated projects (others not related to T1 SDK):

  • 3-WebApp-multi-APIs
    • Updated Storage, Microsoft.WindowsAzure.Storage to Azure.Storage.Blobs
  • 4-WebApp-your-API\4-2-B2C
    • Only removed Microsoft.WindowsAzure.Storage package since it's never used

There is a similar repo updated Storage to track 2 SDK

Frank Li (Wicresoft North America Ltd) added 2 commits September 23, 2020 14:45
@ghost
Copy link

ghost commented Sep 23, 2020

CLA assistant check
All CLA requirements met.

@FrankieTF FrankieTF changed the title Dev update sdk Update Storage to track 2 SDK Sep 23, 2020
@FrankieTF FrankieTF marked this pull request as ready for review September 24, 2020 05:07
Copy link
Contributor

@TiagoBrenck TiagoBrenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even after changing the try catch I was not able to get this sample to work. The error that I am getting is:

OpenIdConnectProtocolException: Message contains error: 'invalid_client', error_description: 'AADSTS650052: The app needs access to a service (\"https://*.blob.core.windows.net\") that your organization \"da0cc090-dd32-4d9f-984c-130b337f221c\" has not subscribed to or enabled. Contact your IT Admin to review the configuration of your service subscriptions. Trace ID: 3fff6b63-7c9a-4d13-bbdd-bd648e7f0900 Correlation ID: fac325fa-7b75-4ca6-84d6-1e69a8e387ab Timestamp: 2020-09-25 19:47:40Z', error_uri: 'https://login.microsoftonline.com/error?code=650052'.

@jmprieur I dont know if this issue is on M.I.W side, on the AuthorizeForScopes

Steps taken

  1. Register the app using AppCreation scripts
  2. Sign-in with a user
  3. Stop the application and start it again
  4. Navigate to Blob page

@jongio
Copy link
Member

jongio commented Sep 28, 2020

@TiagoBrenck - Can you please try again?
@jmprieur - Is there anyone else you'd like to review this?

@TiagoBrenck
Copy link
Contributor

@jongio even after changing the try catch I was not able to get this sample to work. The try catch is definitely a must, but I got the error:

OpenIdConnectProtocolException: Message contains error: 'invalid_client', error_description: 'AADSTS650052: The app needs access to a service (\"https://*.blob.core.windows.net\") that your organization \"da0cc090-dd32-4d9f-984c-130b337f221c\" has not subscribed to or enabled. Contact your IT Admin to review the configuration of your service subscriptions. Trace ID: 3fff6b63-7c9a-4d13-bbdd-bd648e7f0900 Correlation ID: fac325fa-7b75-4ca6-84d6-1e69a8e387ab Timestamp: 2020-09-25 19:47:40Z', error_uri: 'https://login.microsoftonline.com/error?code=650052'.

If you follow my steps mentioned here, could you make it to work?

@jongio
Copy link
Member

jongio commented Sep 30, 2020

@TiagoBrenck - Can you please try to run this sample without this PR? We want to make sure it is runable, because the updates we are doing are just to upgrade the libraries, which shouldn't cause the failure you are seeing above. So, basically, try to run from master please and let us know if you can get it to run.

@Shama-K Shama-K self-requested a review September 30, 2020 22:38
Copy link
Contributor

@Shama-K Shama-K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it worked fine.
Thanks.

Copy link
Contributor

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks @FrankieTF and @Shama-K

.AddInMemoryTokenCaches();
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAd"))
.EnableTokenAcquisitionToCallDownstreamApi(null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the null should not be necessary. Is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, removed.

@@ -18,9 +18,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.6.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.19.0" />
<PackageReference Include="Microsoft.Identity.Web" Version="0.4.0-preview" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll have a merge conflict here. Microsoft.Identity.Web is 1.0.0 now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to latest GA package.

@jmprieur jmprieur merged commit d80098e into Azure-Samples:master Oct 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants