I am calling my azure function from ASD and the function returns 403.
I have configured it to send 401 in case of unauthorised requests.
I want to use managed identity to trigger the function.
Here is my function code.
package
import
import
import
import
import
import
import
import
import
/**
* Azure Functions with HTTP Trigger.
*/
public
/**
* This function listens at endpoint "/api/HttpExample". Two ways to invoke it using "curl" command in bash:
* 1. curl -d "HTTP Body" {your host}/api/HttpExample
* 2. curl "{your host}/api/HttpExample?name=HTTP%20Query"
*/
@
public
@
name
methods
authLevel
HttpRequestMessage
final
context
// Parse query parameter
final
final
if
return
}
String
{
"name" : "response"
}
"""
context
return
}
}
}
Here is my query -
DECLARE
EXEC
@url
@method
@credential
@response
SELECT
@response
I think I need to give my Sql servers managed identity some permissions but I am not able to figure what permission it needs.