Subchapter 6.2
references/README.mdMarkdown4 KBView on GitHub
The azurefd.net endpoint this script calls fronts the PCNX Copilot
Infrastructure service, owned by the Azure Kubernetes Service (AKS) team.
It receives the signed-in user’s ARM-audience (https://management.azure.com/)
bearer token as the Authorization header, along with an App-Tenant-Id
header derived from that token. This is the same authentication pattern Azure
Copilot’s in-portal search-and-navigation experience already uses against this
service.
Install-Module Az.Accounts -Scope CurrentUser./references/Invoke-PortalSearchNav.ps1 `
-ResourceUrl 'https://portal.azure.com/#@<tenant>/resource/subscriptions/<subscription-id>/resourceGroups/<rg>/providers/Microsoft.ContainerService/managedClusters/<cluster>/overview' `
-Query 'image cleaner'| Parameter | Required | Default | Description |
|---|---|---|---|
-ResourceUrl | Yes | — | Portal URL or bare ARM resource ID |
-Query | Yes | — | Natural-language search query |
-ArmProvider | No | auto-derived | Override the armProvider filter value |
-AppTenantId | No | auto-derived | Override the App-Tenant-Id header; also used to build the #@<tenant> portal link fragment |
-Locale | No | en.en-us | Locale for the search filter |
-UseDeviceAuthentication | No | $false | Use device-code authentication when a browser window cannot be opened |
-Raw | No | $false | Print raw JSON response only |
-ResourceUrl.resource-types.json to normalise armProvider casing and confirm the type is supported.Connect-AzAccount (browser sign-in, or device-code with -UseDeviceAuthentication), scoped to the resource’s subscription, then Get-AzAccessToken. The token’s tid claim is used as the App-Tenant-Id header.aks-search-direct-mid endpoint:
{
"search": "<query>",
"count": "true",
"filter": "armProvider eq '<armProvider>' and locale eq '<locale>'",
"queryType": "semantic",
"semanticConfiguration": "semantic"
}Accept, User-Data-Boundary: Global, Authorization, App-Tenant-Id.menuId / bladeName / blade properties.https://portal.azure.com, appending each discovered menuId as the trailing blade segment.The search service is enabled for these ARM resource types:
aiManagerscontainerServicesdeploymentSafeguardsfleetsmaintenanceWindowsmanagedClustersmanagedclustersnapshotsnodeCustomizationsopenShiftManagedClusterspreparedImageSpecificationssnapshotsconnectedClustersavailabilitySetscapacityReservationGroupscloudServicesdiskAccessesdiskEncryptionSetsdisksgallerieshostGroupsimagesinterconnectBlocksproximityPlacementGroupsrestorePointCollectionssnapshotssshPublicKeysvirtualMachinesvirtualMachineScaleSetsAdd an entry to resource-types.json:
{
"microsoft.network/virtualnetworks": {
"armProvider": "Microsoft.Network/virtualNetworks",
"extension": "Microsoft_Azure_Network"
}
}The key must be all-lowercase. armProvider must use the exact casing expected by the search index.
Only add types enabled by the search service.