Update deploy.yml #9
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 basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# Runs a single command using the runners shell | |
- name: Install Prerequisites | |
shell: pwsh | |
run: | | |
Install-Module Az -Force | |
Import-Module Az.Accounts -Force | |
Install-Module FabricPS -Force | |
Import-Module FabricPS -Force | |
- name: Connect with SPN | |
shell: pwsh | |
run: | | |
# Define Service Principal credentials | |
$clientId = '${{ secrets.client_id }}' # Replace with your SP's Application (Client) ID | |
$tenantId = '${{ secrets.tenant_id }}' # Replace with your Azure Tenant ID | |
$clientSecret = '${{ secrets.client_secret }}' # Replace with your SP's Client Secret | |
# Convert the client secret to a SecureString | |
$secureClientSecret = ConvertTo-SecureString -String $clientSecret -AsPlainText -Force | |
# Create a PSCredential object | |
$credential = New-Object System.Management.Automation.PSCredential ($clientId, $secureClientSecret) | |
# Connect to Azure using the Service Principal | |
Connect-AzAccount -ServicePrincipal -Credential $credential -TenantId $tenantId | |
- name: Deploy some stuff | |
shell: pwsh | |
run: | | |
New-Notebook -WorkspaceId 'd387d230-e3d9-4378-8870-2130884c2e91' ` | |
-DisplayName 'New Notebook7' |