Skip to content

[EventGrid] Support TokenCredential#16355

Merged
ellismg merged 1 commit intoAzure:mainfrom
ellismg:ellismg/add-token-credential-for-event-grid
Jul 14, 2021
Merged

[EventGrid] Support TokenCredential#16355
ellismg merged 1 commit intoAzure:mainfrom
ellismg:ellismg/add-token-credential-for-event-grid

Conversation

@ellismg
Copy link
Copy Markdown
Member

@ellismg ellismg commented Jul 12, 2021

This change adds support for using Azure AD to authenticate when send
events using EventGridPublisherClient.

This change adds support for using Azure AD to authenticate when send
events using `EventGridPublisherClient`.
@ellismg ellismg requested review from ramya-rao-a and xirzec July 12, 2021 18:00
@ellismg ellismg requested review from bterlson and chradek as code owners July 12, 2021 18:00
@ellismg
Copy link
Copy Markdown
Member Author

ellismg commented Jul 12, 2021

I will be able to add recorded and live tests using TokenCredential once AAD support is enabled, I have tested this in the PPE environment manually.

Copy link
Copy Markdown
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

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

Very clean! Looks great

@ellismg ellismg merged commit 80bd6ad into Azure:main Jul 14, 2021
deyaaeldeen pushed a commit that referenced this pull request Jul 26, 2021
This change adds support for using Azure AD to authenticate when send
events using `EventGridPublisherClient`.
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Nov 10, 2021
attestation: fixing the segment `attestationProvider` to be `attestationProvider` which matches the API (Azure#16355)

Using the API Version in the Portal (2020-10-01):

Using API Version 2020-10-01 and a valid AttestationProvider with this endpoint returns an error that the `attestationProvider` resource type cannot be found:

```
$ az rest --method get --uri "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-dev/providers/Microsoft.Attestation/attestationProvider/tomdevaccprov/privateEndpointConnections?api-version=2020-10-01"
Not Found({"error":{"code":"InvalidResourceType","message":"The resource type could not be found in the namespace 'Microsoft.Attestation' for api version '2020-10-01'."}})
```

Updating this to `attestationProviders` fixes this (and correctly returns a 404 that there is no PrivateEndpointConnection for this Attestation Provider):

```
$ az rest --method get --uri "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-dev/providers/Microsoft.Attestation/attestationProviders/tomdevaccprov/privateEndpointConnections?api-version=2020-10-01"
Not Found({"error":{"code":"InvalidOperation","message":"PrivateEndpointConnection is not found."}})
```

---

Using API Version 2021-06-01-preview and a valid AttestationProvider with this endpoint returns an error that the `attestationProvider` resource type cannot be found:

```
$ az rest --method get --uri "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-dev/providers/Microsoft.Attestation/attestationProvider/tomdevaccprov/privateEndpointConnections?api-version=2021-06-01-preview"
Not Found({"error":{"code":"InvalidResourceType","message":"The resource type could not be found in the namespace 'Microsoft.Attestation' for api version '2021-06-01-preview'."}})
```

Updating this to `attestationProviders` fixes this (and correctly returns a 404 that there is no PrivateEndpointConnection for this Attestation Provider):

```
$ az rest --method get --uri "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-dev/providers/Microsoft.Attestation/attestationProviders/tomdevaccprov/privateEndpointConnections?api-version=2021-06-01-preview"
Not Found({"error":{"code":"InvalidOperation","message":"PrivateEndpointConnection is not found."}})
```
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.

2 participants