Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Gunakan resep ini untuk membuat aplikasi analitis yang terhubung ke model semantik dengan mode GitHub agen Copilot. Copilot menata template aplikasi data, menambahkan konektor model semantik Fabric, membuat kueri dan visualisasi DAX, serta memvalidasi aplikasi.
Template aplikasi data menyediakan autentikasi Fabric, panduan generasi DAX, komponen visual, dan validasi browser. Konektor menyediakan akses model semantik yang didelegasikan melalui klien Fabric Apps. Untuk informasi selengkapnya, lihat Membuat aplikasi yang tersambung ke model semantik.
Di tutorial ini, Anda akan:
- Siapkan GitHub Copilot untuk pengembangan berbasis agen.
- Minta Copilot untuk membuat kerangka awal templat aplikasi data.
- Hubungkan aplikasi ke model semantik.
- Bangun penjelajah kinerja penjualan interaktif.
- Tinjau dan validasi perubahan yang dihasilkan.
- Sebarkan aplikasi ke Fabric.
- Verifikasi penerapan dan buka aplikasi.
Prasyarat
- Node.js 20 atau yang lebih baru.
- Visual Studio Code.
- GitHub Copilot di Visual Studio Code dengan mode agen yang tersedia.
- Akun GitHub dengan akses ke GitHub Copilot.
- Akun Microsoft dengan akses ke Fabric.
- Ruang kerja Fabric tempat Anda memiliki izin Kontributor, Anggota, atau Admin.
- Beban kerja Fabric Apps telah diaktifkan untuk tenant Anda.
- Pengaturan penyewa REST API Jalankan Kueri Model Semantik diaktifkan.
- Izin membangun dan membaca pada model semantik yang dihosting di kapasitas Fabric atau Power BI.
- ID workspace dan ID item untuk model semantik.
Note
Copilot meminta persetujuan sebelum menjalankan perintah terminal. Anda juga harus menyelesaikan login browser interaktif saat CLI Rayfin memintanya.
Buka mode agen GitHub Copilot
- Buka Kode Visual Studio.
- Buka folder induk tempat Anda ingin Copilot membuat proyek.
- Buka Obrolan.
- Pilih mode Agen .
- Pastikan bahwa agen memiliki akses ke terminal dan ruang kerja.
Jangan buka folder yang berisi file yang tidak terkait yang tidak ingin Anda periksa atau modifikasi oleh Copilot.
Buat kerangka aplikasi data
Salin prompt berikut ke Copilot Chat:
Set up a new Fabric data app for me, end to end.
Create the project in a folder named sales-insights. Before changing code, read any
copilot-instructions.md files and agent guidance included in the scaffolded project.
Do the work yourself instead of only printing instructions:
1. Run `npm create @microsoft/rayfin@latest -- "sales-insights" --template dataapp --workspace <workspace-name>`.
2. In the scaffolded project, run `npx rayfin connector add --type fabric-semanticmodel --workspace-id <workspace-id> --item-id <semantic-model-item-id> --name salesModel --operations executeQuery`.
3. Run the version-matched npm install command printed by the connector command.
4. Open and inspect the scaffolded project. Explain the data app template's DAX query,
visualization, data grid, theme, and browser-validation patterns.
5. Configure the template to use ConnectorsRayfinClient, the generated salesModel
schema, and the fabricSemanticModel() runtime. Don't retain or add a direct
Execute Queries REST API client.
6. If authentication is required, run `npx rayfin login` and pause while I complete
sign-in.
7. Run the existing build and report any errors.
8. Summarize the scaffolded app and wait for my semantic model requirements.
Ask before making a destructive change or using a force option.
Ganti <workspace-name>, <workspace-id>, dan <semantic-model-item-id> dengan nilai untuk workspace Fabric dan model semantik Anda. Setujui perintah saat Copilot menjalankannya, dan selesaikan alur masuk Rayfin saat diminta.
Tanyakan ke Copilot untuk membangun aplikasi Anda
Jelaskan audiens aplikasi, pertanyaan, interaksi, dan visualisasi. Konektor salesModel sudah mengidentifikasi model semantik.
Gunakan prompt berikut sebagai template awal untuk eksplorer kinerja penjualan. Sesuaikan kebutuhan bisnis dengan bidang yang tersedia di model Anda.
Use the existing salesModel connector to build a sales performance explorer for
sales managers.
Requirements:
- Inspect the generated connector schema and semantic model metadata before editing.
Use actual table, measure, and column names instead of guessing them.
- Show KPI callouts for the model's revenue, order volume, and margin measures when
those measures are available.
- Add a time-series chart for sales performance, a bar chart that compares a useful
business category, and a detailed data grid.
- Add date and category filters, and use the template's cross-highlighting behavior.
- Use the template's DAX generation patterns and visual primitives. Minimize the
number of DAX queries and don't duplicate queries for the same data.
- Submit DAX with client.connectors.salesModel.executeQuery(), check the returned
status, and handle success and error results.
- Apply the semantic model's format strings consistently to cards, charts, tooltips,
and the data grid.
- Include loading, empty, and error states.
- Don't add mock data, embed credentials, or implement a separate authentication flow.
- Preserve the template's Fabric authentication and the semantic model connector.
- Don't add dependencies unless they're necessary.
Before editing, inspect the relevant files and give me a short implementation plan.
Ask me to clarify any model fields that are ambiguous. Then make the changes, run
the existing build, and use the template's browser validation workflow to check the
layout at desktop and mobile sizes. Explain any errors you fix.
Tinjau rencana Copilot sebelum mengedit proyek. Jika paket tidak sesuai dengan kebutuhan Anda, perbaiki di Chat sebelum menyetujui pelaksanaan.
Meninjau perubahan yang dihasilkan
Setelah Copilot selesai, mintalah untuk meninjau hasil kerjanya:
Review the changes you made against every requirement in my previous prompt.
Check for:
- DAX queries that reference fields that aren't in the semantic model.
- Duplicate or unnecessary DAX queries.
- Hard-coded sample data, credentials, access tokens, or a second sign-in flow.
- Formatting that ignores the semantic model's format strings.
- Charts, filters, cross-highlighting, or data grid interactions that don't work.
- Missing loading, empty, or error states.
- TypeScript or build errors.
Fix confirmed issues, run the existing build and browser validation, and summarize
the final behavior.
Periksa perbedaan kontrol sumber di Visual Studio Code. Perhatikan secara khusus pada:
- Konfigurasi
salesModelkonektor, skema yang dihasilkan, dan kueri DAX. - Konfigurasi layanan di
rayfin/rayfin.yml. - Dependensi baru di
package.json. - Perubahan autentikasi atau panggilan REST langsung yang melewati konektor.
- Rahasia atau kredensial yang tidak boleh Anda lakukan.
Terapkan dan verifikasi koneksi model semantik
Tanyakan ke Copilot untuk mendistribusikan aplikasi dan memverifikasi koneksinya:
Deploy the app with `npx rayfin up`, then run `npx rayfin up status` and confirm
that the deployment is healthy. Give me the Fabric portal link from the command
output.
Don't add mock data if a semantic model query fails. Check the workspace and model
IDs in the connector configuration, the Semantic Model Execute Queries REST API
tenant setting, my Build and Read permissions, the DAX query, the connector error
result, and the browser console. Report the exact failure and the corrective action.
Buka aplikasi dari portal Fabric untuk menguji kueri model semantik secara langsung.
Memvalidasi aplikasi
Tanyakan ke Copilot untuk menjalankan validasi proyek yang sudah ada:
Validate the app without adding new tools.
1. Run the existing build and type-check commands from package.json.
2. Run the template's browser validation at desktop and mobile sizes.
3. Check for clipped charts, unreadable labels, empty visuals, and console errors.
4. Tell me which semantic model queries and user interactions I must verify in the
Fabric portal.
5. Fix confirmed build, type, or layout errors, and rerun the failed check.
Di portal Fabric, verifikasi kriteria penerimaan yang Anda berikan kepada Copilot. Uji autentikasi, filter, penyorotan silang, pemformatan data, status kosong, penanganan kesalahan, dan hasil setiap visual.
Sebarkan aplikasi yang sudah selesai
Setelah Anda meninjau perubahan dan menguji aplikasi, minta Copilot untuk menempatkannya:
Deploy the reviewed app to Fabric.
1. Show me the current git diff and summarize what will be deployed.
2. Run `npx rayfin up`.
3. Run `npx rayfin up status`.
4. Confirm that the deployment is healthy.
5. Give me the hosted app URL and Fabric portal link from the command output.
Stop and explain the issue if deployment or verification fails.
Perintah yang sama npx rayfin up memperbarui deployment yang sudah ada saat Anda melanjutkan pengembangan aplikasi.
Lanjutkan iterasi dengan Copilot
Gunakan prompt yang terfokus untuk perubahan selanjutnya. Sertakan perilaku yang diinginkan, pengguna yang terdampak, kendala, dan langkah validasi.
Add a product detail view to the sales performance explorer.
Open the view when a user selects a product in the data grid. Use fields and measures
that exist in the semantic model, reuse existing query results where practical, and
preserve filters and formatting. Run the existing build and browser validation, then
list the interactions and DAX results I should verify in the Fabric portal.
Jaga setiap permintaan agar cukup kecil untuk ditinjau. Tetapkan status kerja sebelum Anda meminta Copilot melakukan perubahan besar atau yang berpotensi merusak.
Memecahkan masalah alur kerja Copilot
Copilot hanya mencetak perintah
Beri tahu Copilot untuk menjalankan perintah itu sendiri dan melaporkan hasilnya. Konfirmasi bahwa Chat dalam mode Agen dan akses terminal diaktifkan.
Perintah menunggu hingga login
Selesaikan alur masuk ke browser. Kemudian beri tahu Copilot bahwa proses masuk selesai agar bisa dilanjutkan.
Copilot mengedit folder yang salah
Hentikan agen, buka folder proyek scaffolded di Visual Studio Code, dan mulai Chat baru dari workspace tersebut.
Penerapan berhasil tetapi kueri model semantik gagal
Minta Copilot untuk memeriksa ID ruang kerja dan model konektor, pengaturan penyewa REST API Execute Queries untuk Semantic Model, izin Build dan Read Anda, DAX yang dihasilkan, hasil kesalahan konektor, dan konsol browser. Jangan gantikan kueri yang gagal dengan data simulasi.
Copilot mengusulkan --force
Minta Copilot menunjukkan operasi skema yang berpotensi merusak terlebih dahulu. Terima --force hanya jika Anda memahami dan menyetujui kemungkinan kehilangan data.
Untuk masalah lain, lihat Troubleshoot Fabric Apps.