/msticpy-training

Training and support materials for MSTICPy

Primary LanguageJupyter NotebookMIT LicenseMIT

MSTICPy Training Materials

This repo is holds training materials and tools used for demos for the MSTICPy Python Package. Please refer to that site and the MSTICPy documentation on ReadTheDocs.

Workshop Materials

Recommended options to run the notebooks

There are several options to creating or finding an environment to run the workshop notebooks. The two recommended options are:

  1. Local Anaconda installation
  2. Visual Studio Code Dev Container (both of these assume prior installation of VSCode)

You can also opt to create and run a Docker container using Jupyter classic web interface. The Dockerfile.txt and instructions for doing this are in the workshop folder

The instructions for the other two options are below.


Local Anaconda installation

  1. Install Ananconda.
  2. Open the Ananconda prompt/terminal.
  3. Create a virtual environment: (replace with your choice of environment name)
   conda create --name msticpy python=3.11
  1. Activate the environment: (replace with your choice of environment name)
   conda activate msticpy
  1. Install Jupyter notebooks Conda package
   conda install -c anaconda notebook
  1. Clone the msticpy-training repo (replace <src_root> with the location that you want to clone the repo):
   cd <src_root>
   git clone https://github.com/microsoft/msticpy-training
  1. Install required Python packages
   pip install -r msticpy-training/requirements.txt
  1. Change directory to the workshop folder
   cd msticpy-training/workshops/Jun2023
  1. Login to Azure using Azure CLI (This will return a login URL and a device code - copy the code and paste into the login page prompt and continue with normal authentication flow).
   az login
  1. Run VS Code
    code .
  1. Install VSCode Jupyter and Python extensions

VS Code DevContainer Docker Instructions

Install docker for desktop on Windows :

Follow the instructions at docker docs - https://docs.docker.com/desktop/install/windows-install/

Build Docker image locally:

docker build -t msticpy-training -f ./.devcontainer/Dockerfile .

Run docker image:

docker run -p 8888:8888 msticpy-training

Connect VSCode to Connector: Attach to a Docker Container

To attach to a Docker container, either select Dev Containers: Attach to Running Container... from the Command Palette (F1) or use the Remote Explorer in the Activity Bar and from the Containers view, select the Attach to Container inline action on the container you want to connect to

  • Once you open a notebook in VSCode. You will see Select Kernel option on right hand top corner. Docker Select Kernel

  • Once you click on it, you will be prompted to install Jupyter VSCode extension in container. Install VSCode extension

  • After you finished installation, you can then click Select Kernel and choose Connect to local Jupyter server. Connect to Jupyter

  • Run Jupyter server URI from VSCode Terminal.

Retrieve Server URL

  • and then enter the URL on the next screen.

Enter URI

  • Finally, select a Remote Kernel.

Remote Kernel


Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.