The bicep below creates an Azure Search Service. On the first run, it creates the search service as expected in about 5 seconds. If I run it again, it will fail after a long time (over 2 hours – I am waiting on the exact time).
The resource group’s deployment details show a status of InternalServerError. The operation details as this status message:
{
"status": "Failed",
"error": {
"code": "Unknown",
"message": "{"error":{"code":"","message":"An error has occurred."}} This could be a transient error, try to disable and enable all identities for the service and retry the operation. RequestId: f6910fa8-fa5c-4e2d-838e-c22335731c5d"
}
}
Any idea what is happening?
How can I troubleshoot this, or get more info on that requestId?
Here is the bicep:
param searchServiceName string
param location string
resource search 'Microsoft.Search/searchServices@2024-06-01-preview' = {
location: location
properties: {
replicaCount: 1
partitionCount: 1
hostingMode: 'default'
publicNetworkAccess: 'Enabled'
networkRuleSet: {
ipRules: []
bypass: 'None'
}
encryptionWithCmk: {
enforcement: 'Unspecified'
}
disableLocalAuth: false
authOptions: {
apiKeyOnly: {}
}
disabledDataExfiltrationOptions: []
semanticSearch: 'disabled'
}
name: searchServiceName
sku: {
name: 'standard'
}
}
2
Answers
I contacted support. This is a capacity issue in EastUS2. I moved to CentralUS and it's working.
We can’t specify the particular reason for the issue as you’re facing this issue only when you’re running this configuration for the second time or more.
But the error description we can say that you are using managed identity to get this thing done. If the service identity was previously assigned and not properly cleaned up, followup attempts to configure it could fail.
Disable and re-enable the service’s managed identities& make sure that it properly assigned.
when I tried to do that same from my end, I was able to run the code multiple time when I didn’t make any changes with my managed Identity.
Configuration:
Deployment:
This is for the second time I run the same script which already existing.
refer:
https://learn.microsoft.com/en-us/azure/automation/disable-managed-identity-for-automation
follow this to disable and reanbled the managed identity.
https://learn.microsoft.com/en-us/azure/search/search-get-started-bicep?tabs=CLI
https://learn.microsoft.com/en-us/azure/templates/microsoft.search/searchservices?pivots=deployment-language-bicep