Подія
31 бер., 23 - 2 квіт., 23
Найбільша подія навчання Fabric, Power BI і SQL. 31 березня – 2 квітня. Щоб заощадити 400 грн, скористайтеся кодом FABINSIDER.
Реєструйтеся сьогодніЦей браузер більше не підтримується.
Замініть його на Microsoft Edge, щоб користуватися перевагами найновіших функцій, оновлень безпеки та технічної підтримки.
The Microsoft Fabric notebook is a primary code item for developing Apache Spark jobs and machine learning experiments. It's a web-based interactive surface used by data scientists and data engineers to write code benefiting from rich visualizations and Markdown text. Data engineers write code for data ingestion, data preparation, and data transformation. Data scientists also use notebooks to build machine learning solutions, including creating experiments and models, model tracking, and deployment.
With a Fabric notebook, you can:
This article describes how to use notebooks in data science and data engineering experiences.
The execution of a notebook can be triggered by three different manners in Fabric with full flexibility to meet different scenarios:
The flexibility of these execution options with different security context allows you to meet different scenarios and requirements, but also requires you to be aware of the security context when you design and develop your notebook, otherwise it may cause unexpected behavior and even some security issues.
The first time when a notebook is created, a warning message is shown to remind you the risk of running the code without reviewing it.
Here are some best practices to help you avoid security issues:
You can either create a new notebook or import an existing notebook.
Like other standard Fabric item creation processes, you can easily create a new notebook from the Fabric Data Engineering homepage, the workspace New option, or the Create Hub.
You can import one or more existing notebooks from your local computer using the entry in the workspace toolbar. Fabric notebooks recognize the standard Jupyter Notebook .ipynb files, and source files like .py, .scala, and .sql, and create new notebook items accordingly.
You can export your notebook to other standard formats. Synapse notebook can be exported into:
In Fabric, a notebook will by default save automatically after you open and edit it; you don't need to worry about losing code changes. You can also use Save a copy to clone another copy in the current workspace or to another workspace.
If you prefer to save a notebook manually, you can switch to the Manual save option to have a local branch of your notebook item, and then use Save or CTRL+s to save your changes.
You can also switch to manual save mode by selecting Edit -> Save options -> Manual. To turn on a local branch of your notebook then save it manually, select Save or use the Ctrl+s keyboard shortcut.
Fabric notebooks now support close interactions with lakehouses; you can easily add a new or existing lakehouse from the Lakehouse explorer.
You can navigate to different lakehouses in the Lakehouse explorer and set one lakehouse as the default by pinning it. Your default is then mounted to the runtime working directory, and you can read or write to the default lakehouse using a local path.
Примітка
You must restart the session after pinning a new lakehouse or renaming the default lakehouse.
Selecting the X icon beside a lakehouse name removes it from the notebook tab, but the lakehouse item still exists in the workspace.
Select Add lakehouse to add more lakehouses to the notebook, either by adding an existing one or creating a new lakehouse.
The subfolder and files under the Tables and Files section of the Lake view appear in a content area between the lakehouse list and the notebook content. Select different folders in the Tables and Files section to refresh the content area.
If you select a file (.csv,.parquet,.txt,.jpg,.png, etc.) with a right mouse click, you can use the Spark or Pandas API to load the data. A new code cell is generated and inserted beneath the focus cell.
You can easily copy a path with a different format from the select file or folder and use the corresponding path in your code.
The notebook resource explorer provides a Unix-like file system to help you manage your folders and files. It offers a writeable file system space where you can store small-sized files, such as code modules, semantic models, and images. You can easily access them with code in the notebook as if you were working with your local file system.
Примітка
notebookutils.notebook.run()
, use the notebookutils.nbResPath
command to access the target notebook resource. The relative path builtin/ will always point to the root notebook’s built-in folder.The built-in resources folder is a system-defined folder unique to each notebook. It is recommended to use built-in resource folder to storage any data used in the current notebook. Here are the key capabilities for the notebook resources.
builtin/YourData.txt
for quick exploration. The notebookutils.nbResPath
method helps you compose the full path.notebookutils.notebook.run()
.Environment Resources Folder is a shared repository designed to streamline collaboration across multiple notebooks.
You can find the Resources tab inside the environment and have the full operations to manage the resource files here. These files can be shared across multiple notebooks once the notebook is attached to the current environment.
In the Notebook page, you can easily find a second root folder under Resources inherited from the attached environment.
You can also operate on the files/folders same with the Built-in resources folder.
The Environment resource path is automatically mounted to the notebook cluster. You can use the relative path /env to access the environment resources.
Примітка
Reading/writing with a relative path is not functioning in a High concurrency session.
The file editor allows you to view and edit files directly within the notebook's resource folder and environment resource folder in notebook. Supported file types include CSV, TXT, HTML, YML, PY, SQL, and more. With the file editor, you can easily access and modify files within the notebook, it supports Keyword highlighting and provides necessary language service when opening and editing code files like .py and .sql.
You can access this feature through 'View and edit' in the file menu. Double-click on file is a faster way.
Content change on file editor needs to be saved manually by clicking the Save button or keyboard shortcut: Ctrl+S, file editor doesn't support autosave.
notebook mode also affects the file editor. You can only view files but cannot edit them if you are in the notebook mode without editing permission.
Примітка
Here are some limitations for file editor.
The Fabric notebook is a collaborative item that supports multiple users editing the same notebook.
When you open a notebook, you enter the coediting mode by default, and every notebook edit is automatically saved. If your colleagues open the same notebook at the same time, you see their profile, run output, cursor indicator, selection indicator, and editing trace. By using the collaboration features, you can easily accomplish pair programming, remote debugging, and tutoring scenarios.
Sharing a notebook is a convenient way for you to collaborate with team members. Authorized workspace roles can view or edit/run notebooks by default. You can share a notebook with specified permissions granted.
Select Share on the notebook toolbar.
Select the corresponding category of people who can view this notebook. You can choose Share, Edit, or Run permissions for the recipients.
After you select Apply, you can either send the notebook directly or copy the link to others. Recipients can then open the notebook with the corresponding view granted by their permission level.
To further manage your notebook permissions, select Workspace item list > More options, and then select Manage permissions. From that screen, you can update the existing notebook access and permissions.
Commenting is another useful feature for collaborative scenarios. Currently, Fabric supports adding cell-level comments.
Select the Comments button on the notebook toolbar or cell comment indicator to open the Comments pane.
Select code in the code cell, select New in the Comments pane, add comments, and then select Post comment to save.
If you need them, find the Edit comment, Resolve thread, and Delete thread options by selecting the More option next to your comment.
"Tagging" refers to mentioning and notifying a user in a comment thread, enhancing collaboration efficiently on the specifics.
Select a section of code in a cell and new a comment thread.
Input user name and choose the correct one on the suggestion list if you want to mention someone for discussion about a certain section.
Share your insights and Post them.
An Email notification is triggered, and user clicks on Open Comments link to quickly locate this cell.
Moreover, authorize and configure the permissions for users when tagging someone who doesn’t have access, ensuring that your code assets are well managed.
Примітка
For a comment item, the tagged user will not receive an Email notification anymore if you update the comment within one hour. But it sends Email notification to the new tagged user.
Примітка
Currently, the feature is in preview.
Version history allows you to easily version your live notebook changes. It supports history tracking and notebook management with robust built-in version control capabilities, which is especially helpful for collaborative work with multiple contributors on the same notebook.
Access version history from notebook global toolbar.
Notebook supports two ways of creating checkpoints.
Manual checkpoint: You can manually create new version to record your development milestones, providing flexibility for managing your notebook versions.
System checkpoint: These checkpoints are created automatically every 5 minutes based on editing time interval by Notebook system, ensuring that your work is consistently saved and versioned. You can find the modification records from all the contributors in the system checkpoint timeline list.
You can click on a checkpoint to open the diff view, it highlights the content differences between the selected checkpoint and the current live version, including the differences of cell content, cell output, and metadata. The version of this checkpoint can be managed individually in 'more options' menu.
You can manage the version from the checkpoint drop-down menu, if you want to keep a pervious version, click restore from checkpoint and overwrite the current notebook, or using save as copy to clone it to a new notebook.
Примітка
Fabric notebooks support four modes that you can easily switch: Develop mode,Run only mode, Edit mode, and View mode. Each mode maps to a specific permission combination. When sharing the notebook to other team members, you can grant proper permissions to the recipients. They can see the best available notebook mode according to their permission, and they are able to switch between the mode they have permission to.
Подія
31 бер., 23 - 2 квіт., 23
Найбільша подія навчання Fabric, Power BI і SQL. 31 березня – 2 квітня. Щоб заощадити 400 грн, скористайтеся кодом FABINSIDER.
Реєструйтеся сьогодніНавчання
Модуль
Use Spark Notebooks in an Azure Synapse Pipeline - Training
This module describes how Apache Spark notebooks can be integrated into an Azure Synapse Analytics pipeline.
Сертифікація
Microsoft Certified: Fabric Analytics Engineer Associate - Certifications
Як асоційований спеціаліст з аналітики тканин, ви маєте мати досвід у розробці, створенні та розгортанні рішень для аналітики даних корпоративного масштабу.
Документація
Use Python experience on Notebook - Microsoft Fabric
Learn how to work with pure Python notebooks for data exploration, visualization, and machine learning.
Develop, execute, and manage notebooks - Microsoft Fabric
Learn how to author, execute, and manage Microsoft Fabric notebook jobs with rich built-in features.
Load data into your lakehouse with a notebook - Microsoft Fabric
Learn how to use a notebook to load data into your lakehouse with either an existing notebook or a new one.