Product Help

temp working doc

  • Q: Look into the Telemetry SDK to find where key fulfillment for App Insight happens within a deployed azure function

    • A: The key for local testing is stored in the local.settings.json file. This is not the case for a deployed function. Within a deployed function Azure stores the Connection string under the environment values in the instance of the function. (Prove this provided screenshots)

  • Test an end to end deployment for an azure function from Visual Studios to Azure Repo to ADO pipeline to Azure functions

    • this will include mapping any API Keys/tokens requiring input

Azure Repo's in DevOps setup

  • Required

    • Azure DevOps Account

    • Azure DevOps Personal Access Token

  • Create GIT Repo

  • Run the following ADO provided command

git remote add origin https://{ADO Instance}@dev.azure.com/{ADO Org}/{Project}/_git/{Project} git push -u origin --all Password for 'https://{ADO Instance}@dev.azure.com': {input PAT} No refs in common and none specified; doing nothing. Perhaps you should specify a branch. Everything up-to-date
  • Commit and push code to the repo

  • It will then require device authentication follow the instructions provided in IDE

Setup Azure Function in Azure

  • Required

    • Azure Subscription

  • Navigate to the Function App section in azure while logged into the relevant subscription.

  • Click + Create, Select Consumption (Note discuss) click select. Fill in the required fields.

    Function App Setup
  • Fill in later Storage Networking

  • Monitoring

  • Enable Application Insights set to yes

  • Choose the relevant Application Insight

    Application Insight Setup
  • Click Review and Create

Azure Repo Pipeline Setup

  • Required

    • Azure DevOps Account

    • User Access Administrator or Owner

  • Click pipelines -> Create Pipeline

  • Select Azure Repos Git

  • Select the Repo

  • Select .NET Core Function App to Windows on Azure

  • It will then Prompt you to choose the Azure Subscription

    Azure Subscription
  • Select the relevant subscription and click continue.

  • It will then prompt you to choose the Function App name and the working directory.

    Function App Name
  • Click Validate and Configure

  • It will generate a YAML file for the pipeline as this

# .NET Core Function App to Windows on Azure # Build a .NET Core function app and deploy it to Azure as a Windows function App. # Add steps that analyze code, save build artifacts, deploy, and more: # https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core trigger: - main variables: # Azure Resource Manager connection created during pipeline creation azureSubscription: 'a0afb841-8319-4c01-b41b-f94c8ef8b31b' # Function app name functionAppName: 'aohwv-endtoend' # Agent VM image name vmImageName: 'windows-latest' # Working Directory workingDirectory: '$(System.DefaultWorkingDirectory)/' stages: - stage: Build displayName: Build stage jobs: - job: Build displayName: Build pool: vmImage: $(vmImageName) steps: - task: DotNetCoreCLI@2 displayName: Build inputs: command: 'build' projects: | $(workingDirectory)/*.csproj arguments: --output $(System.DefaultWorkingDirectory)/publish_output --configuration Release - task: ArchiveFiles@2 displayName: 'Archive files' inputs: rootFolderOrFile: '$(System.DefaultWorkingDirectory)/publish_output' includeRootFolder: false archiveType: zip archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip replaceExistingArchive: true - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip artifact: drop - stage: Deploy displayName: Deploy stage dependsOn: Build condition: succeeded() jobs: - deployment: Deploy displayName: Deploy environment: 'development' pool: vmImage: $(vmImageName) strategy: runOnce: deploy: steps: - task: AzureFunctionApp@2 displayName: 'Azure functions app deploy' inputs: connectedServiceNameARM: '$(azureSubscription)' appType: functionApp appName: $(functionAppName) package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
  • Click Save and Run

Last modified: 28 January 2025