Recap: June 2024

Professional Development

  • Learned to configure Azure alerts based on the occurrence of specified trace messages in an application.
  • Learned how to implement custom JSON list view formatting in SharePoint, including conditional formatting.

Code Written

SharePoint Value Replacement Function

  • Languages: PowerShell
  • Justification:
    • In some business cases, it becomes necessary to replace all occurrences of a specified value with another value. For example:
      • A choice option for Status may be renamed from “In Progress” to “In Work”
      • A user named John Smith may have left the company and all of his previously-assigned items may need to be re-assigned to a new employee, Sue Johnson.
      • A product number may have changed from ABC123 to XYZ426
  • Function:
    • User is prompted for the SharePoint column name where the data is stored.
    • User is prompted to confirm the column’s data type.
    • User is prompted to confirm which value is being queried and which value will take its place.
    • User is prompted to confirm the SharePoint sites and lists to check (with a one-step option to check all sites / lists)
    • The script runs a report to find all occurrences of the specified value and outputs them to both the host and a csv inventory.
    • User confirms the findings and authorizes the script to continue with the value replacements.
    • Basic validations are performed depending on the column’s data type. For example, a choice value will not be set unless it has already been added as a valid option to the choice column.
    • Value replacements are completed until all items have been processed.
    • A final CSV log is produced to confirm the successes and failures of the job for further review, if necessary

Synapse Pipeline Initiator

  • Languages: PowerShell
  • Justification:
    • Azure Synapse is a powerful tool that connects automation logic (pipelines) and data storage (e.g. SQL Database).
    • The interface for this app can be somewhat cumbersome and, depending on a user’s background, unintuitive.
    • Additionally, some users may only need to interact with the system by “kicking off” a pipeline run and letting the system perform its work.
    • A script allows you to permit these users to do only what is explicitly required – an improvement in convenience and data integrity.
  • Function:
    • Infrastructure note: An Azure application principal (Enterprise App) can be granted Synapse-specific RBAC roles for authenticating a script such as this while also applying least-privilege principals.
    • Prompt the user to confirm that they would like to run the specified pipeline.
    • Initiate the pipeline run.
    • Every 60 seconds, ask the pipeline run for its status. Print the status to the host.
    • Repeat the status queries until the status is no longer “InProgress”
    • When status switches to “Success” or “Failed”, the final status will be printed to the host and the script will end.

Personal Enjoyment

Tagged in:,

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *