A cloud-based identity and access management service for securing user authentication and resource access
@Alexandre , You can expose an application as an API by setting the identifierUris. You can update the script by adding the following lines of code:
$appName = "SampleAPI1"
$app = New-AzureADApplication -DisplayName $appName -ReplyUrls "http://localhost:1234"
Set-AzureADApplication -ObjectId $app.ObjectId -IdentifierUris ("api://" + $app.AppId) -Verbose
Once you run the Set-AzureADApplication cmdlet with the -IdentifierUris switch, you would find that the application would be exposed as an API to be consumed by other applications.
Hope this helps.
Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as Answer; if the above response helped in answering your query.