This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a sample code for HAL and Swagger integration | |
* http://devkimchi.com/2041/creating-service-contract-with-autorest-swagger-and-hal | |
* http://blog.kloud.com.au/2015/10/26/creating-service-contract-with-autorest-swagger-and-hal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://prod-23.centralus.logic.azure.com:443/workflows/0c9def69700c4b2995e2e587123306f7/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=ORQeXlFZxBeF7xmF9pO73sgYl_-w0v6V9uugi8bhHeA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Service1Client : ClientBase<IService1>, IService1 | |
{ | |
public Service1Client() | |
{ | |
} | |
// This constructor is of no use for Azure Functions | |
// because it doesn't use Web.config or App.config | |
public Service1Client(string endpointConfigurationName) | |
: base(endpointConfigurationName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class WcfCallingHttpTrigger | |
{ | |
[FunctionName("WcfCallingHttpTrigger")] | |
public static async Task<HttpResponseMessage> Run( | |
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "data/{value}")] HttpRequestMessage req, | |
int value, | |
TraceWriter log) | |
{ | |
log.Info("C# HTTP trigger function processed a request."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
... | |
<system.serviceModel> | |
<bindings> | |
<basicHttpBinding> | |
<binding name="BasicHttpBinding_IService1"/> | |
</basicHttpBinding> | |
</bindings> | |
<client> | |
<endpoint name="BasicHttpBinding_IService1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class GistExample | |
{ | |
public static string Lorem => "Ipsum"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: This is NOT a real tenant Id, subscription Id, client Id nor client secret. Use yours. | |
$tenantId = "32a489b1-612c-4d44-b4dd-714376ac7479" | |
$subscriptionId = "4ba9940b-0057-4184-9965-eb686c3027bc" | |
$clientId = "310c7137-af66-4bb1-ac76-c4cb4fcbe4e1" | |
$clientSecret = "QMvihWUWlRuPs3nNjxxzR/rULyKOAibRBkWDsbokzqw=" | |
$authUri = "https://login.microsoftonline.com/$tenantId/oauth2/token?api-version=1.0" | |
$resourceUri = "https://management.core.windows.net/" | |
$authRequestBody = @{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: This is NOT a real resource group name nor function app name. Use yours. | |
$resourceGroupName = "my-resource-group" | |
$functionAppName = "my-azure-function" | |
$accessTokenHeader = @{ "Authorization" = "Bearer " + $auth.access_token } | |
$azureRmBaseUri = "https://management.azure.com" | |
$azureRmApiVersion = "2016-08-01" | |
$azureRmResourceType = "Microsoft.Web/sites" | |
$azureRmResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/$azureRmResourceType/$functionAppName" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$azureRmListFunctionsEndpoint = "/functions" | |
$listFunctionsUri = $azureRmBaseUri + $azureRmResourceId + $azureRmListFunctionsEndpoint + "?api-version=" + $azureRmApiVersion | |
$listFunctions = Invoke-RestMethod -Method Get -Uri $listFunctionsUri -Headers $accessTokenHeader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$functionAppBaseUri = "https://$functionAppName.azurewebsites.net/admin" | |
$functionName = "test1" | |
$functionKeysEndpoint = "/functions/$functionName/keys" | |
$functionKeysUri = $functionAppBaseUri + $functionKeysEndpoint | |
$adminTokenHeader = @{ "Authorization" = "Bearer " + $adminBearerToken } | |
$functionKeys = Invoke-RestMethod -Method Get -Uri $functionKeysUri -Headers $adminTokenHeader |
OlderNewer