I'm trying to scale my Azure elasticpool in datafactory with a web activity task passing the following api call:
{
"url": "https://management.azure.com/subscriptions/subID/resourceGroups/RGNAME/providers/Microsoft.Sql/servers/sqlservername/elasticPools/elasticpoolname?api-version=2020-08-01-preview",
"method": "PUT",
"headers": {
"Content-Type": "application/json"
},
"body": {
"sku": {
"name": "StandardPool",
"tier": "Standard",
"capacity": "50"
},
"location": "West Europe"
},
"authentication": {
"type": "MSI",
"resource": "https://management.azure.com/"
}
}
The activity fails, but the strange thing is that the scale actually works. Even though the scaling works I obviously don't want the activity to fail.
ADF has a contributor role in SQLServer
Any idea?
Here is the error:
"error": {
"code": "AuthorizationFailed",
"message": "The client 'ADF ID' with object id 'ADF ID' does not have authorization to perform action 'Microsoft.Sql/locations/elasticPoolOperationResults/read' over scope '/subscriptions/SUBID/resourceGroups/RGNAME/providers/Microsoft.Sql/locations/westeurope/elasticPoolOperationResults/id' or the scope is invalid. If access was recently granted, please refresh your credentials."
}
I reproduce same my environment. I got same error.
To resolve this issue. Go to SQL server -> Access control (IAM) + Add Contributor role -> Go to members Assign access to Manage identity and select azure data factory.
Header:
Content-Type application/jsonBody: {"sku":{"name":"GP_Gen5_2","tier":"GeneralPurpose"},"location":"eastus"}
Resource: https://management.azure.com/
script :
SELECT DATABASEPROPERTYEX(db_name(),'edition') AS ServiceTier , DATABASEPROPERTYEX(db_name(),'serviceobjective') AS ComputeSize