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

[BUG] - Azure Search DataSource connection with Managed Identity #29813

Closed
gregoks opened this issue Jul 12, 2022 · 3 comments
Closed

[BUG] - Azure Search DataSource connection with Managed Identity #29813

gregoks opened this issue Jul 12, 2022 · 3 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search Service This issue points to a problem in the service.

Comments

@gregoks
Copy link

gregoks commented Jul 12, 2022

Library name and version

Azure.Search.Documents 11.4.0-beta.8

Describe the bug

Hi!

I'm trying to create datasource connection in my search index using managed identity. I followed this guide - https://docs.microsoft.com/en-us/azure/search/search-howto-managed-identities-cosmos-db

This is the code that I'm using (CosmosDB):

var connectionString =
                    "ResourceId=/subscriptions/<guid>/resourceGroups/mp-mprp-dev-df-global-rg/providers/Microsoft.DocumentDb/databaseAccounts/<dbName>";
                var ds = new SearchIndexerDataSourceConnection("dsName", SearchIndexerDataSourceType.CosmosDb, connectionString, searchIndexerDataContainer)
                {
                    DataChangeDetectionPolicy = new HighWaterMarkChangeDetectionPolicy(SearchIndexConstants.HighWaterMarkColumnName),
                    DataDeletionDetectionPolicy = new SoftDeleteColumnDeletionDetectionPolicy
                    {
                        SoftDeleteColumnName = SearchIndexConstants.SoftDeleteColumnName,
                        SoftDeleteMarkerValue = SearchIndexConstants.SoftDeleteMarkerValue
                    },
                    Identity = new SearchIndexerDataUserAssignedIdentity("/subscriptions/<guid>/resourcegroups/mp-sch-dev-df-eastus-rg/providers/microsoft.managedidentity/userassignedidentities/mp-sch-identity")
                };

but im getting the following error:

The request is invalid. Details: dataSource : A type named 'Microsoft.Azure.Search.SearchIndexerDataUserAssignedIdentity' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.
Status: 400 (Bad Request)Content:
{"error":{"code":"","message":"The request is invalid. Details: dataSource : A type named 'Microsoft.Azure.Search.SearchIndexerDataUserAssignedIdentity' could not be resolved by the model. When a model is available, each type name must resolve to a valid type."}}Headers:
Cache-Control: no-cache
Pragma: no-cache
client-request-id: 9b24fd07-fcb8-47f4-8be8-546c205a8f97
x-ms-client-request-id: 9b24fd07-fcb8-47f4-8be8-546c205a8f97
request-id: 9b24fd07-fcb8-47f4-8be8-546c205a8f97
elapsed-time: 5
Preference-Applied: REDACTED
Strict-Transport-Security: REDACTED
Date: Tue, 12 Jul 2022 14:25:54 GMT
Content-Type: application/json; charset=utf-8
Content-Language: REDACTED
Expires: -1
Content-Length: 263

Would appreciate any assistance

Expected behavior

The API should return 200 and create data source connection using managed identity

Actual behavior

There is an error:

The request is invalid. Details: dataSource : A type named 'Microsoft.Azure.Search.SearchIndexerDataUserAssignedIdentity' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.
Status: 400 (Bad Request)Content:
{"error":{"code":"","message":"The request is invalid. Details: dataSource : A type named 'Microsoft.Azure.Search.SearchIndexerDataUserAssignedIdentity' could not be resolved by the model. When a model is available, each type name must resolve to a valid type."}}Headers:
Cache-Control: no-cache
Pragma: no-cache
client-request-id: 9b24fd07-fcb8-47f4-8be8-546c205a8f97
x-ms-client-request-id: 9b24fd07-fcb8-47f4-8be8-546c205a8f97
request-id: 9b24fd07-fcb8-47f4-8be8-546c205a8f97
elapsed-time: 5
Preference-Applied: REDACTED
Strict-Transport-Security: REDACTED
Date: Tue, 12 Jul 2022 14:25:54 GMT
Content-Type: application/json; charset=utf-8
Content-Language: REDACTED
Expires: -1
Content-Length: 263

Reproduction Steps

Try to create data source connection to search index using managed identity

Environment

IDE - Visual Studio 17.2.4
Windows
DotNet 6

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 12, 2022
@azure-sdk azure-sdk added Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage. Search labels Jul 12, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 12, 2022
@jsquire jsquire added customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Jul 12, 2022
@jsquire
Copy link
Member

jsquire commented Jul 12, 2022

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@jsquire jsquire removed the needs-team-triage Workflow: This issue needs the team to triage. label Jul 12, 2022
@gmndrg
Copy link

gmndrg commented Jul 12, 2022

@gregoks This has been identified as a preview feature bug. This has been filed and will be fixed on best effort. Thank you so much for reporting this!

@ShivangiReja ShivangiReja added the Service This issue points to a problem in the service. label Jul 13, 2022
@ShivangiReja
Copy link
Member

This issue has been fixed here.

We have also updated SDK code as a part of this PR. We will release this bug fix in our next beta version.

Thanks @gregoks for filing this issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search Service This issue points to a problem in the service.
Projects
None yet
Development

No branches or pull requests

5 participants