This file contains hidden or 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
| func init MyFunctionApp --worker-runtime dotnet |
This file contains hidden or 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
| @page "/counter" | |
| <h1>Counter</h1> | |
| <p>Current count: @currentCount</p> | |
| <button class="btn btn-primary" @onclick="IncrementCount">Click me</button> | |
| @code { | |
| private int currentCount = 0; |
This file contains hidden or 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
| func new --name DisableSecretHttpTrigger --template HttpTrigger --language C# |
This file contains hidden or 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
| @Microsoft.KeyVault(SecretUri=https://<keyvault_name>.vault.azure.net/secrets/<secret_name>) |
This file contains hidden or 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
| [FunctionName("CallbackAsync")] | |
| public async Task<IActionResult> CallbackAsync( | |
| [HttpTrigger(AuthorizationLevel.Function, "GET", "POST", Route = "callback")] HttpRequest req, | |
| ILogger log) | |
| { | |
| if (HttpMethods.IsGet(req.Method)) | |
| { | |
| string challenge = req.Query["hub.challenge"]; | |
| var result = new ObjectResult(challenge) { StatusCode = 200 }; |
This file contains hidden or 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
| var pattern = "<div.+data-article-id=\"(\\d+)\"\\s*id=\"article-body\">"; | |
| var regex = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); | |
| var url = "https://dev.to/<username>/xxxx-****-temp-slug-xxxx?preview=xxxx"; | |
| var http = new HttpClient(); | |
| var html = await http.GetStringAsync(url); | |
| var match = regex.Match(html); | |
| var articleId = Convert.ToInt32(match.Groups[1].Value); |
This file contains hidden or 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
| dotnet add package Azure.Messaging.EventGrid --version 4.0.0-beta.4 |
This file contains hidden or 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
| logicAppResourceId=$(az logic workflow show \ | |
| -g <resource_group_name> \ | |
| -n <logic_app_name> \ | |
| --query "id" -o tsv) |
This file contains hidden or 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
| namespace MyV1LegacyFunctionApp | |
| { | |
| public static class LoremIpsumHttpTrigger | |
| { | |
| [FunctionName("LoremIpsumHttpTrigger")] | |
| public static async Task<HttpResponseMessage> Run( | |
| [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "lorem/ipsum")] HttpRequestMessage req, | |
| ILogger log) | |
| { | |
| var content = new MyReturnObject(); |
This file contains hidden or 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
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| ... | |
| - name: 'Run Azure Functions Action' | |
| uses: Azure/functions-action@v1 | |
| with: | |
| app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | |
| package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output' |