Skip to content

Add initial Azure Function files#1

Open
MWG-Logan wants to merge 1 commit into
mainfrom
dev
Open

Add initial Azure Function files#1
MWG-Logan wants to merge 1 commit into
mainfrom
dev

Conversation

@MWG-Logan
Copy link
Copy Markdown
Member

Introduce the foundational files for an Azure Function project, including configuration, deployment settings, and a PowerShell script for user management via the Cloudflare API. This setup enables the execution of scheduled tasks and integrates necessary dependencies for development.

Copilot AI review requested due to automatic review settings March 17, 2026 13:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the initial scaffolding for a PowerShell-based Azure Functions app intended to run scheduled Cloudflare user-management tasks, aligning the existing MemberDeployment script approach with a timer-triggered, deployable Function App structure.

Changes:

  • Created an Azure Functions (PowerShell) timer-triggered function to add Cloudflare account members from a CSV.
  • Added Function App configuration files (host.json, profile.ps1, requirements.psd1) and local development example settings.
  • Added VS Code launch/tasks/settings recommendations for local debugging and execution.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
MemberDeploymentFunction/AddCfUsersTimer/run.ps1 Implements the timer-triggered Cloudflare member provisioning logic.
MemberDeploymentFunction/AddCfUsersTimer/function.json Defines the timer trigger schedule binding.
MemberDeploymentFunction/host.json Configures Function host logging and timeout.
MemberDeploymentFunction/profile.ps1 Cold-start profile notes (no Az modules).
MemberDeploymentFunction/requirements.psd1 Declares no PowerShell modules required by default.
MemberDeploymentFunction/local.settings.json.example Provides local dev app settings template (tokens, dry-run).
MemberDeploymentFunction/.gitignore Prevents committing local settings and CSV.
MemberDeploymentFunction/usersExample.csv Example CSV format for user/role inputs.
.vscode/tasks.json Adds a task to start the Functions host from VS Code.
.vscode/launch.json Adds attach debugger configuration for PowerShell Functions worker.
.vscode/settings.json Configures VS Code Azure Functions project settings.
.vscode/extensions.json Recommends Azure Functions + PowerShell extensions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +17 to +24
$UsersCsvPath = "$PSScriptRoot/../users.csv"
if (-not (Test-Path -LiteralPath $UsersCsvPath)) { throw "users.csv not found at: $UsersCsvPath" }

$users = Import-Csv -LiteralPath $UsersCsvPath
if (-not $users -or $users.Count -eq 0) { throw "users.csv is empty." }
foreach ($u in $users) {
if (-not $u.Email -or -not $u.Role) {
throw "users.csv row missing Email or Role: $($u | ConvertTo-Json -Compress)"
Comment on lines +6 to +7
$DryRun = ($env:CF_DRY_RUN -eq "true")

Token = if ($isPartner) { $PartnerToken } else { $PersonalToken }
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants