In the older SDK (vss-web-extension-sdk) - we could use VSS.getWebContext() to get the project name and id. I coudln't find a similar method in the newer SDK (azure-devops-extensions-sdk)
How can I get the project name with the new azure-devops-extensions-sdk
?
There are samples azure-devops-extension-sample
Sample code:
import * as SDK from "azure-devops-extension-sdk";
import { CommonServiceIds, IProjectPageService } from "azure-devops-extension-api";
const projectService = await SDK.getService<IProjectPageService>(CommonServiceIds.ProjectPageService);
const project = await projectService.getProject();